diff --git a/.github/actions/setup-api-tools/action.yml b/.github/actions/setup-api-tools/action.yml index 23e04113d..618392ec2 100644 --- a/.github/actions/setup-api-tools/action.yml +++ b/.github/actions/setup-api-tools/action.yml @@ -13,11 +13,11 @@ runs: - uses: dtolnay/rust-toolchain@master with: toolchain: 1.85.0 - components: rustfmt - + components: rustfmt, clippy + - name: Install uv uses: astral-sh/setup-uv@v5 - + - name: Install uv dependencies working-directory: api/oas_generator shell: bash diff --git a/.gitignore b/.gitignore index 3fc493b60..190f40156 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,8 @@ AGENTS.md .kiro/ packages/python/**/*algokit_*.py -packages/python**/*.dll -packages/python**/*.so -packages/python**/*.dylib -packages/python**/*.whl +packages/python/**/*.dll +packages/python/**/*.so +packages/python/**/*.dylib +packages/python/**/*.whl diff --git a/Cargo.lock b/Cargo.lock index a9db36c50..a77e0d829 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,6 @@ version = "0.0.1" dependencies = [ "algokit_http_client", "algokit_transact", - "algokit_transact_ffi", "base64 0.22.1", "rmp-serde", "rmpv", @@ -44,11 +43,25 @@ dependencies = [ "snafu", "tokio", "tokio-test", - "uniffi", "url", "uuid", ] +[[package]] +name = "algod_client_ffi" +version = "0.0.1" +dependencies = [ + "algod_client", + "algokit_http_client", + "algokit_transact_ffi", + "async-trait", + "serde_json", + "snafu", + "tokio", + "tokio-test", + "uniffi", +] + [[package]] name = "algokit_abi" version = "0.1.0" @@ -163,6 +176,7 @@ name = "algokit_utils_ffi" version = "0.1.0" dependencies = [ "algod_client", + "algod_client_ffi", "algokit_abi", "algokit_http_client", "algokit_transact", @@ -509,7 +523,7 @@ dependencies = [ "clap", "rustversion", "serde", - "toml", + "toml 0.5.11", "toml_edit 0.19.15", "version_check", "which", @@ -1831,7 +1845,6 @@ name = "indexer_client" version = "2.0.0" dependencies = [ "algokit_http_client", - "algokit_transact_ffi", "base64 0.22.1", "serde", "serde_bytes", @@ -1841,7 +1854,6 @@ dependencies = [ "snafu", "tokio", "tokio-test", - "uniffi", "url", "uuid", ] @@ -1956,7 +1968,6 @@ name = "kmd_client" version = "0.0.1" dependencies = [ "algokit_http_client", - "algokit_transact_ffi", "base64 0.22.1", "serde", "serde_bytes", @@ -1966,7 +1977,6 @@ dependencies = [ "snafu", "tokio", "tokio-test", - "uniffi", "url", "uuid", ] @@ -2122,7 +2132,7 @@ dependencies = [ "shlex", "tempfile", "tokio", - "toml", + "toml 0.5.11", "topological-sort", "walkdir", "warp", @@ -3082,6 +3092,15 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_spanned" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3650,12 +3669,36 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" +dependencies = [ + "indexmap 2.7.0", + "serde", + "serde_spanned", + "toml_datetime 0.7.0", + "toml_parser", + "toml_writer", + "winnow 0.7.12", +] + [[package]] name = "toml_datetime" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +[[package]] +name = "toml_datetime" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +dependencies = [ + "serde", +] + [[package]] name = "toml_edit" version = "0.19.15" @@ -3663,7 +3706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.7.0", - "toml_datetime", + "toml_datetime 0.6.11", "winnow 0.5.40", ] @@ -3674,10 +3717,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap 2.7.0", - "toml_datetime", + "toml_datetime 0.6.11", "winnow 0.7.12", ] +[[package]] +name = "toml_parser" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +dependencies = [ + "winnow 0.7.12", +] + +[[package]] +name = "toml_writer" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d163a63c116ce562a22cda521fcc4d79152e7aba014456fb5eb442f6d6a10109" + [[package]] name = "topological-sort" version = "0.2.2" @@ -3834,9 +3892,9 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "uniffi" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d968cb62160c11f2573e6be724ef8b1b18a277aededd17033f8a912d73e2b4" +checksum = "c866f627c3f04c3df068b68bb2d725492caaa539dd313e2a9d26bb85b1a32f4e" dependencies = [ "anyhow", "camino", @@ -3857,9 +3915,9 @@ dependencies = [ [[package]] name = "uniffi_bindgen" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b39ef1acbe1467d5d210f274fae344cb6f8766339330cb4c9688752899bf6b" +checksum = "7c8ca600167641ebe7c8ba9254af40492dda3397c528cc3b2f511bd23e8541a5" dependencies = [ "anyhow", "askama", @@ -3874,7 +3932,7 @@ dependencies = [ "serde", "tempfile", "textwrap", - "toml", + "toml 0.9.5", "uniffi_internal_macros", "uniffi_meta", "uniffi_pipeline", @@ -3884,9 +3942,9 @@ dependencies = [ [[package]] name = "uniffi_core" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d990b553d6b9a7ee9c3ae71134674739913d52350b56152b0e613595bb5a6f" +checksum = "7e7a5a038ebffe8f4cf91416b154ef3c2468b18e828b7009e01b1b99938089f9" dependencies = [ "anyhow", "bytes", @@ -3896,9 +3954,9 @@ dependencies = [ [[package]] name = "uniffi_internal_macros" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f4f224becf14885c10e6e400b95cc4d1985738140cb194ccc2044563f8a56b" +checksum = "e3c2a6f93e7b73726e2015696ece25ca0ac5a5f1cf8d6a7ab5214dd0a01d2edf" dependencies = [ "anyhow", "indexmap 2.7.0", @@ -3909,9 +3967,9 @@ dependencies = [ [[package]] name = "uniffi_macros" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b481d385af334871d70904e6a5f129be7cd38c18fcf8dd8fd1f646b426a56d58" +checksum = "64c6309fc36c7992afc03bc0c5b059c656bccbef3f2a4bc362980017f8936141" dependencies = [ "camino", "fs-err", @@ -3920,15 +3978,15 @@ dependencies = [ "quote", "serde", "syn", - "toml", + "toml 0.9.5", "uniffi_meta", ] [[package]] name = "uniffi_meta" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f817868a3b171bb7bf259e882138d104deafde65684689b4694c846d322491" +checksum = "0a138823392dba19b0aa494872689f97d0ee157de5852e2bec157ce6de9cdc22" dependencies = [ "anyhow", "siphasher 0.3.11", @@ -3938,9 +3996,9 @@ dependencies = [ [[package]] name = "uniffi_pipeline" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b147e133ad7824e32426b90bc41fda584363563f2ba747f590eca1fd6fd14e6" +checksum = "8c27c4b515d25f8e53cc918e238c39a79c3144a40eaf2e51c4a7958973422c29" dependencies = [ "anyhow", "heck", @@ -3951,9 +4009,9 @@ dependencies = [ [[package]] name = "uniffi_testing" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5e9befada8a7069066191beb8865cdb8287f66e9041fb0bbffc8dfc5bea6b7" +checksum = "a4adb08eb5589849231dc0626ba0f9a1297925fd751f0740fc630ae934dd9c5e" dependencies = [ "anyhow", "camino", @@ -3964,9 +4022,9 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caed654fb73da5abbc7a7e9c741532284532ba4762d6fe5071372df22a41730a" +checksum = "d0adacdd848aeed7af4f5af7d2f621d5e82531325d405e29463482becfdeafca" dependencies = [ "anyhow", "textwrap", diff --git a/Cargo.toml b/Cargo.toml index 6dc87803c..9986e5757 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "crates/algokit_test_artifacts", "crates/ffi_macros", "crates/algod_client", + "crates/algod_client_ffi", "crates/indexer_client", "crates/kmd_client", "tools/build_pkgs", @@ -20,7 +21,7 @@ members = [ ] [workspace.dependencies] -uniffi = { version = "0.29.4" } +uniffi = { version = "0.30.0" } snafu = { version = "0.8" } base32 = { version = "0.5.1" } sha2 = { version = "0.10.8" } diff --git a/api/oas_generator/rust_oas_generator/generator/filters.py b/api/oas_generator/rust_oas_generator/generator/filters.py index 7cc52f2f3..d19beeda8 100644 --- a/api/oas_generator/rust_oas_generator/generator/filters.py +++ b/api/oas_generator/rust_oas_generator/generator/filters.py @@ -44,7 +44,7 @@ def rust_doc_comment(text: str, indent: int = 0) -> str: if not text: return "" - lines = text.strip().split("\n") + lines = text.strip().replace("\\[", "[").replace("\\]", "]").split("\n") indent_str = " " * indent if len(lines) == 1: diff --git a/api/oas_generator/rust_oas_generator/generator/template_engine.py b/api/oas_generator/rust_oas_generator/generator/template_engine.py index e0771e209..781de4676 100644 --- a/api/oas_generator/rust_oas_generator/generator/template_engine.py +++ b/api/oas_generator/rust_oas_generator/generator/template_engine.py @@ -206,6 +206,13 @@ def get_error_types(operation: Operation) -> list[str]: return error_types + @staticmethod + def parse_error_type(error_type: str) -> dict[str, str | None]: + variant = error_type.split("(")[0] + inner_type = error_type.split("(")[1].rstrip(")") if "(" in error_type else None + + return {"variant": variant, "inner_type": inner_type} + @staticmethod def get_response_types_by_filter( operations: list[Operation], @@ -341,6 +348,7 @@ def _register_globals(self) -> None: "group_operations_by_tag": op_analyzer.group_operations_by_tag, # Response analysis "get_error_types": resp_analyzer.get_error_types, + "parse_error_type": resp_analyzer.parse_error_type, "get_success_response_type": resp_analyzer.get_success_response_type, "get_all_response_types": resp_analyzer.get_all_response_types, "get_endpoint_response_types": lambda op: resp_analyzer.get_all_response_types([op]), @@ -463,6 +471,7 @@ def generate_client( "schemas": spec.schemas, "content_types": spec.content_types, "custom_description": custom_description, + "ffi": "ffi" in package_name.lower(), } files = {} @@ -485,7 +494,7 @@ def _generate_base_files(self, context: dict[str, Any], output_dir: Path) -> dic # Detect client type client_type_fn = self.template_engine.env.globals.get("get_client_type") client_type = client_type_fn(context["spec"]) if callable(client_type_fn) else "Api" - if client_type == "Algod": + if client_type == "Algod" and not context.get("ffi", False): # Provide msgpack helper to encode/decode arbitrary msgpack values as bytes files[src_dir / "msgpack_value_bytes.rs"] = self.template_engine.render_template( "base/msgpack_value_bytes.rs.j2", context diff --git a/api/oas_generator/rust_oas_generator/templates/apis/api.rs.j2 b/api/oas_generator/rust_oas_generator/templates/apis/api.rs.j2 index 22f14385b..35ef6ddf2 100644 --- a/api/oas_generator/rust_oas_generator/templates/apis/api.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/apis/api.rs.j2 @@ -9,7 +9,7 @@ */ use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; +{% if not ffi %} use serde::{Deserialize, Serialize, de::Error as _}; {% endif %} use crate::{apis::ResponseContent, models}; use super::{Error, configuration, ContentType}; @@ -25,9 +25,13 @@ use crate::models::{ {% for operation in operations %} /// struct for typed errors of method [`{{ operation.rust_function_name }}`] -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone)] +{% if ffi %} +#[derive(uniffi::Error)] +{% else %} +#[derive(Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] +{% endif %} pub enum {{ operation.rust_error_enum }} { {% for error_type in get_error_types(operation) %} {{ error_type }}, @@ -36,6 +40,7 @@ pub enum {{ operation.rust_error_enum }} { {% endfor %} +{% if not ffi %} {% for operation in operations %} {% if operation.description %} {{ operation.description | rust_doc_comment }} @@ -117,4 +122,4 @@ pub async fn {{ operation.rust_function_name }}( } {% endfor %} - +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/apis/client.rs.j2 b/api/oas_generator/rust_oas_generator/templates/apis/client.rs.j2 index 9140235ee..bca4a31dd 100644 --- a/api/oas_generator/rust_oas_generator/templates/apis/client.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/apis/client.rs.j2 @@ -37,11 +37,15 @@ use super::parameter_enums::*; {% if used_types %} use crate::models::{ {% for used_type in used_types %} - {{ used_type }}, + {# We don't want to import Box because async_trait uses ::Box #} + {% if used_type != "Box" %}{{ used_type }},{% endif %} {% endfor %} }; {% endif %} {% endif %} +{% if ffi %} +use algod_client::AlgodClient as RustAlgodClient; +{% endif %} /// The main {{ client_type }} API client. /// @@ -49,32 +53,40 @@ use crate::models::{ /// It wraps the lower-level endpoint functions with a more ergonomic interface. /// All methods return a unified `Error` type that can represent any endpoint error. #[derive(Clone)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Object))] +{% if ffi %} +#[derive(uniffi::Object)] +{% endif %} pub struct {{ client_type }}Client { + {% if ffi %} + pub inner_algod_client: Arc, + {% else %} http_client: Arc, + {% endif %} } -{% for impl_block in ["common", "rust", "ffi"] %} -{% if impl_block in ["common", "ffi"] %} -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] -{% endif %} -{% if impl_block == "rust" %} -#[cfg(not(feature = "ffi_uniffi"))] -{% endif %} -{% if impl_block == "ffi" %} -#[cfg(feature = "ffi_uniffi")] +{% if ffi %} +{% set render_passes = ["impl", "trait"] %} +{% set str_type = "String" %} +#[uniffi::export] +{% else %} +{% set str_type = "&str" %} +{% set render_passes = ["impl"] %} {% endif %} impl {{ client_type }}Client { -{% if impl_block == "common" %} /// Create a new {{ client_type }}Client with a custom http client. - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] + {% if ffi %}#[uniffi::constructor]{% endif %} pub fn new(http_client: Arc) -> Self { + {% if ffi %} + let inner_algod_client = Arc::new(RustAlgodClient::new(http_client.clone())); + Self { inner_algod_client } + {% else %} Self { http_client } + {% endif %} } + {% if not ffi %} /// Create a new {{ client_type }}Client for Algorand TestNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn testnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new( {% if client_type == "Indexer" %}"https://testnet-idx.4160.nodely.dev"{% elif client_type == "Kmd" %}"http://localhost:7833"{% else %}"https://testnet-api.4160.nodely.dev"{% endif %} @@ -84,7 +96,6 @@ impl {{ client_type }}Client { /// Create a new {{ client_type }}Client for Algorand MainNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn mainnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new( {% if client_type == "Indexer" %}"https://mainnet-idx.4160.nodely.dev"{% elif client_type == "Kmd" %}"http://localhost:7833"{% else %}"https://mainnet-api.4160.nodely.dev"{% endif %} @@ -94,7 +105,6 @@ impl {{ client_type }}Client { /// Create a new {{ client_type }}Client for a local localnet environment. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn localnet() -> Self { let http_client = Arc::new(DefaultHttpClient::with_header( {% if client_type == "Indexer" %}"http://localhost:8980"{% elif client_type == "Kmd" %}"http://localhost:4002"{% else %}"http://localhost:4001"{% endif %}, @@ -103,9 +113,21 @@ impl {{ client_type }}Client { ).expect("Failed to create HTTP client with API token header")); Self::new(http_client) } + {% endif %} +} +{% for pass in render_passes %} +{% if pass == "impl" and ffi %} +#[uniffi::export] +#[async_trait::async_trait] +impl {{ client_type }}ClientTrait for {{ client_type }}Client { +{% elif pass == "impl" %} +impl {{ client_type }}Client { +{% elif pass == "trait" %} +#[uniffi::export(with_foreign)] +#[async_trait::async_trait] +pub trait {{ client_type }}ClientTrait: Send + Sync { {% endif %} {% for operation in operations %} -{% if (impl_block == "common" and not operation.has_optional_string) or (impl_block != "common" and operation.has_optional_string) %} {% if operation.summary %} /// {{ operation.summary }} {% elif operation.description %} @@ -114,7 +136,7 @@ impl {{ client_type }}Client { {% if operation.deprecated %} #[deprecated] {% endif %} - pub async fn {{ operation.rust_function_name }}( + {% if not ffi %}pub{% endif %} async fn {{ operation.rust_function_name }}( &self, {% if has_request_body(operation) and operation.method.upper() not in ['GET', 'HEAD', 'DELETE'] %} {% set request_body_name = get_request_body_name(operation) %} @@ -129,49 +151,65 @@ impl {{ client_type }}Client { {% else %}{{ param.rust_name }}: Option<{{ param.rust_enum_type }}>, {% endif %} {% else %} - {% if param.required %}{{ param.rust_name }}: {% if param.rust_type == "String" %}&str{% else %}{{ param.rust_type }}{% endif %}, - {% else %}{{ param.rust_name }}: Option<{% if param.rust_type == "String" %}{% if impl_block == "ffi" %}String{% else %}&str{% endif %}{% else %}{{ param.rust_type }}{% endif %}>, + {% if param.required %}{{ param.rust_name }}: {% if param.rust_type == "String" %}{{ str_type }}{% else %}{{ param.rust_type }}{% endif %}, + {% else %}{{ param.rust_name }}: Option<{% if param.rust_type == "String" %}{{ str_type }}{% else %}{{ param.rust_type }}{% endif %}>, {% endif %} {% endif %} {% endfor %} ) -> Result<{% if get_success_response_type(operation) %}{% if get_success_response_type(operation) == "UnknownJsonValue" %}UnknownJsonValue{% else %}{{ - get_success_response_type(operation) }}{% endif %}{% else %}(){% endif %}, Error> { - let result = super::{{ operation.rust_function_name }}::{{ operation.rust_function_name }}( + get_success_response_type(operation) }}{% endif %}{% else %}(){% endif %}, Error> {% if pass == "trait"%};{%else%}{ + {% if not ffi %} + super::{{ operation.rust_function_name }}::{{ operation.rust_function_name }}( self.http_client.as_ref(), {% if has_request_body(operation) and operation.method.upper() not in ['GET', 'HEAD', 'DELETE'] %} {{ get_request_body_name(operation) }}, {% endif %} {% for param in operation.parameters %} - {% if impl_block == "ffi" and (not param.required) and (not param.is_enum_parameter) and (param.rust_type == "String") %} - {{ param.rust_name }}.as_deref(), - {% else %} {{ param.rust_name }}, + {% endfor %} + ).await + {% else %} + self.inner_algod_client.{{ operation.rust_function_name }}( + {% if has_request_body(operation) %} + {% if is_request_body_required(operation) %} + {% if operation.rust_function_name == "simulate_transaction" %} + {{ get_request_body_name(operation) }}.try_into()?, + {%else%} + {{ get_request_body_name(operation) }}.into(), + {% endif %} + {% else %} + {% if operation.rust_function_name == "teal_dryrun" %} + {{ get_request_body_name(operation) }}.map(|v| v.try_into()).transpose()?, + {%else%} + {{ get_request_body_name(operation) }}.map(|v| v.into()), + {% endif %} + {% endif %} + {% endif %} + {% for param in operation.parameters %} + {% if param.required and param.rust_type == "String"%} + &{{ param.rust_name }}, + {% elif param.required %} + {{ param.rust_name }}.into(), + {% elif param.rust_type == "String" and not param.is_enum_parameter %} + {{ param.rust_name }}.as_deref().map(|v| v.into()), + {% else %} + {{ param.rust_name }}.map(|v| v.into()), {% endif %} {% endfor %} - ).await; - - {% if get_success_response_type(operation) == "UnknownJsonValue" %} - #[cfg(feature = "ffi_uniffi")] - { - result.map(|v| { - serde_json::to_string(&v).map_err(|e| Error::Serde { - message: e.to_string(), - }) - })? - } - - #[cfg(not(feature = "ffi_uniffi"))] - { - result - } + ).await + {% if get_success_response_type(operation) and "Vec<" in get_success_response_type(operation) %} + .map(|v| v.into_iter() + .map(|item| item.into()) + .collect()) {% else %} - result + .map(|v| v.into()) + {% endif %} + .map_err(|e| e.into()) {% endif %} } {% endif %} {% endfor %} } - {% endfor %} diff --git a/api/oas_generator/rust_oas_generator/templates/apis/endpoint.rs.j2 b/api/oas_generator/rust_oas_generator/templates/apis/endpoint.rs.j2 index 7869180b5..6ff3315ce 100644 --- a/api/oas_generator/rust_oas_generator/templates/apis/endpoint.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/apis/endpoint.rs.j2 @@ -9,18 +9,21 @@ {% endif %} * Generated by: Rust OpenAPI Generator */ -use serde::{Deserialize, Serialize}; +{% if not ffi %} use serde::{Deserialize, Serialize}; {% endif %} use algokit_http_client::{HttpClient, HttpMethod}; use std::collections::HashMap; use super::{Error, {{ client_type }}ApiError, ContentType}; -{% if operation.supports_msgpack %} +{% if not ffi and operation.supports_msgpack %} use algokit_transact::AlgorandMsgpack; {% endif %} {% set param_enums = collect_parameter_enums([operation]) %} {% if param_enums %} use super::parameter_enums::*; {% endif %} +{% if ffi %} +use algod_client::apis{{ operation.module_name }}::{{ operation.rust_error_enum }} as Rust{{ operation.rust_error_enum }}; +{% endif %} // Import all custom types used by this endpoint {% set used_types = get_operation_used_types(operation) %} @@ -41,9 +44,12 @@ use crate::models::{{ request_body_type }}; {% endif %} /// struct for typed errors of method [`{{ operation.rust_function_name }}`] -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone)] +{% if not ffi %} +#[derive(Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] +{% endif %} +{% if ffi %} #[derive(uniffi::Error)] {% endif %} pub enum {{ operation.rust_error_enum }} { {% set error_types = get_error_types(operation) %} {% for error_type in error_types %} @@ -51,6 +57,20 @@ pub enum {{ operation.rust_error_enum }} { {% endfor %} } +{% if ffi %} +impl From for {{ operation.rust_error_enum }} { + fn from(e: Rust{{ operation.rust_error_enum }}) -> Self { + match e { + {% for error_type in error_types %} + {% set error = parse_error_type(error_type) %} + Rust{{ operation.rust_error_enum }}::{{ error.variant }}({% if error.inner_type %}v{% endif %}) => {{ operation.rust_error_enum }}::{{ error.variant }}({% if error.inner_type %}v.into(){% endif %}), + {% endfor %} + } + } +} + +{% endif %} +{% if not ffi %} {% if operation.description %} {{ operation.description | rust_doc_comment }} {% elif operation.summary %} @@ -225,3 +245,4 @@ pub async fn {{ operation.rust_function_name }}( Ok(()) {% endif %} } +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/apis/mod.rs.j2 b/api/oas_generator/rust_oas_generator/templates/apis/mod.rs.j2 index bd42a6a8c..e46574d23 100644 --- a/api/oas_generator/rust_oas_generator/templates/apis/mod.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/apis/mod.rs.j2 @@ -22,12 +22,16 @@ pub mod parameter_enums; {% for operation in operations %} pub mod {{ operation.rust_function_name }}; {% endfor %} +{% if ffi %} +use algod_client::apis::Error as RustError; +use algod_client::apis::{{ client_type }}ApiError as RustApiError; +{% endif %} use snafu::Snafu; /// Unified error type that can represent any API error from any endpoint #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] +{% if ffi %} #[derive(uniffi::Error)] {% endif %} pub enum {{ client_type }}ApiError { {% for operation in operations %} #[snafu(display("{{ operation.rust_function_name | title }} error: {error:?}"))] @@ -37,6 +41,21 @@ pub enum {{ client_type }}ApiError { Unknown { message: String }, } +{% if ffi %} +impl From for {{ client_type }}ApiError { + fn from(err: RustApiError) -> Self { + match err { + {% for operation in operations %} + RustApiError::{{ operation.rust_function_name | pascal_case }} { error } => {{ client_type }}ApiError::{{ operation.rust_function_name | pascal_case }} { error: error.into() }, + {% endfor %} + RustApiError::Unknown { message } => {{ client_type }}ApiError::Unknown { message }, + } + } +} + + +{% endif %} + {% for operation in operations %} impl From<{{ operation.rust_function_name }}::{{ operation.rust_error_enum }}> for {{ client_type }}ApiError { fn from(err: {{ operation.rust_function_name }}::{{ operation.rust_error_enum }}) -> Self { @@ -48,7 +67,7 @@ impl From<{{ operation.rust_function_name }}::{{ operation.rust_error_enum }}> f /// The main error type for all {{ client_type | lower }} client operations #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] +{% if ffi %} #[derive(uniffi::Error)] {% endif %} pub enum Error { #[snafu(display("HTTP error: {source}"))] Http { source: algokit_http_client::HttpError }, @@ -58,6 +77,19 @@ pub enum Error { Api { source: {{ client_type }}ApiError }, } +{% if ffi %} +impl From for Error { + fn from(err: RustError) -> Self { + match err { + RustError::Http { source } => Error::Http { source }, + RustError::Serde { message } => Error::Serde { message }, + RustError::Api { source } => Error::Api { source: source.into() }, + } + } +} + +{% endif %} + #[derive(Debug, PartialEq, Eq)] pub enum ContentType { Json, @@ -80,13 +112,14 @@ impl From<&str> for ContentType { } } +// Re-export the consolidated client +pub use client::{{ client_type }}Client; + +{% if not ffi %} pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } -// Re-export the consolidated client -pub use client::{{ client_type }}Client; - {% if param_enums %} // Re-export parameter enums pub use parameter_enums::*; @@ -99,3 +132,4 @@ pub use {{ operation.rust_function_name }}::{ {{ operation.rust_error_enum }}, }; {% endfor %} +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/apis/parameter_enums.rs.j2 b/api/oas_generator/rust_oas_generator/templates/apis/parameter_enums.rs.j2 index 6c948e37d..f1cbd9b15 100644 --- a/api/oas_generator/rust_oas_generator/templates/apis/parameter_enums.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/apis/parameter_enums.rs.j2 @@ -6,16 +6,18 @@ * Generated by: Rust OpenAPI Generator */ +{% if not ffi %} use serde::{Deserialize, Serialize}; use std::fmt; use std::str::FromStr; +{% endif %} {% for enum_name, enum_data in parameter_enums.items() %} {% if enum_data.enum_values %} {{ (enum_data.description or "Parameter enum for " + enum_name.lower()) | rust_doc_comment }} -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] -#[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +{% if not ffi %} #[derive(Serialize, Deserialize)] {% endif %} +{% if ffi %} #[derive(uniffi::Enum)] {% else %} #[serde(rename_all = "lowercase")] {% endif %} pub enum {{ enum_name }} { {% for value in enum_data.enum_values %} /// {{ value }} @@ -23,6 +25,41 @@ pub enum {{ enum_name }} { {% endfor %} } +{% if ffi %} +impl From<{{ enum_name }}> for algod_client::apis::{{ enum_name }} { + fn from(value: {{ enum_name }}) -> Self { + match value { +{% for value in enum_data.enum_values %} + {% if value == "json" %} + {{ enum_name }}::Json => algod_client::apis::{{ enum_name }}::Json + {% elif value == "msgpack" %} + {{ enum_name }}::Msgpack => algod_client::apis::{{ enum_name }}::Msgpack + {% else %} + {{ enum_name }}::{{ value | pascal_case }} => algod_client::apis::{{ enum_name }}::{{ value | pascal_case }} + {% endif %}, +{% endfor %} + } + } +} + +impl From for {{ enum_name }} { + fn from(value: algod_client::apis::{{ enum_name }}) -> Self { + match value { +{% for value in enum_data.enum_values %} + {% if value == "json" %} + algod_client::apis::{{ enum_name }}::Json => {{ enum_name }}::Json + {% elif value == "msgpack" %} + algod_client::apis::{{ enum_name }}::Msgpack => {{ enum_name }}::Msgpack + {% else %} + algod_client::apis::{{ enum_name }}::{{ value | pascal_case }} => {{ enum_name }}::{{ value | pascal_case }} + {% endif %}, +{% endfor %} + } + } +} +{% endif %} + +{% if not ffi %} impl fmt::Display for {{ enum_name }} { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let value = match self { @@ -47,5 +84,6 @@ impl FromStr for {{ enum_name }} { } } +{% endif %} {% endif %} {% endfor %} diff --git a/api/oas_generator/rust_oas_generator/templates/base/Cargo.toml.j2 b/api/oas_generator/rust_oas_generator/templates/base/Cargo.toml.j2 index 6c56dbf5d..d4a8fc409 100644 --- a/api/oas_generator/rust_oas_generator/templates/base/Cargo.toml.j2 +++ b/api/oas_generator/rust_oas_generator/templates/base/Cargo.toml.j2 @@ -6,12 +6,19 @@ description = "{{ custom_description or spec.info.description or spec.info.title license = "MIT" edition = "2024" +{% if not "ffi" in package_name %} [features] default = ["default_client"] default_client = ["algokit_http_client/default_client"] -ffi_uniffi = ["dep:uniffi", "algokit_http_client/ffi_uniffi", "dep:algokit_transact_ffi"] +{% endif %} [dependencies] +serde_json = "^1.0" + +# Error handling +snafu = { workspace = true } + +{% if not "ffi" in package_name %} # Core serialization serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = [ @@ -19,18 +26,13 @@ serde_with = { version = "^3.8", default-features = false, features = [ "std", "macros", ] } -serde_json = "^1.0" serde_repr = "^0.1" serde_bytes = "^0.11" # HTTP client -algokit_http_client = { path = "../algokit_http_client", features = ["ffi_uniffi"] } +algokit_http_client = { path = "../algokit_http_client" } url = "^2.5" -# Uniffi for FFI bindings -uniffi = { workspace = true, optional = true } -algokit_transact_ffi = { optional = true, version = "0.1.0", path = "../algokit_transact_ffi" } - {% if spec.has_msgpack_operations %} # AlgoKit dependencies for msgpack and signed transactions algokit_transact = { path = "../algokit_transact" } @@ -39,13 +41,18 @@ rmp-serde = "^1.1" rmpv = { version = "1.3.0", features = ["with-serde"] } {% endif %} -# Error handling -snafu = { workspace = true } - # Utilities base64 = "^0.22" uuid = { version = "^1.0", features = ["v4"] } - +{% else %} +async-trait = "0.1.89" +{% if spec.has_msgpack_operations %} +algokit_transact_ffi = { path = "../algokit_transact_ffi" } +{% endif %} +uniffi = { workspace = true } +algokit_http_client = { path = "../algokit_http_client", default-features = false, features = ["ffi_uniffi"] } +{{ package_name | snake_case | replace("_ffi", "") }} = { path = "../{{ package_name | snake_case | replace("_ffi", "") }}" } +{% endif %} [dev-dependencies] tokio = { version = "1.0", features = ["full"] } tokio-test = "^0.4" diff --git a/api/oas_generator/rust_oas_generator/templates/base/lib.rs.j2 b/api/oas_generator/rust_oas_generator/templates/base/lib.rs.j2 index 486e93502..e7bd30ee6 100644 --- a/api/oas_generator/rust_oas_generator/templates/base/lib.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/base/lib.rs.j2 @@ -2,12 +2,11 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] -#[cfg(feature = "ffi_uniffi")] -uniffi::setup_scaffolding!(); +{% if ffi %} uniffi::setup_scaffolding!(); {% endif %} pub mod apis; pub mod models; -{% if client_type == "Algod" %} +{% if client_type == "Algod" and not ffi %} pub mod msgpack_value_bytes; {% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/macros/enum_macros.j2 b/api/oas_generator/rust_oas_generator/templates/macros/enum_macros.j2 index 193df558e..fb264550e 100644 --- a/api/oas_generator/rust_oas_generator/templates/macros/enum_macros.j2 +++ b/api/oas_generator/rust_oas_generator/templates/macros/enum_macros.j2 @@ -4,7 +4,7 @@ {{ description | rust_doc_comment }} {% endif %} #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] +{% if ffi %} #[derive(uniffi::Enum)] {% endif %} pub enum {{ enum_name }} { {% for value in enum_values %} /// {{ value }} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block.rs.j2 index b910dadf0..41b063282 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block.rs.j2 @@ -9,139 +9,250 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +{% if not ffi %} use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; - -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +use algod_client::models::Block as RustBlock; +{% endif %} use crate::models::SignedTxnInBlock; use crate::models::BlockStateProofTracking; /// Block contains the BlockHeader and the list of transactions (Payset). +#[derive(Clone, Debug, PartialEq)] +{% if not ffi %} #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize)] +{% else %} +#[derive(uniffi::Record)] +{% endif %} pub struct Block { /// [rnd] Round number. + {% if not ffi %} #[serde(rename = "rnd", skip_serializing_if = "Option::is_none")] + {% endif %} pub round: Option, /// [prev] Previous block hash. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "prev", skip_serializing_if = "Option::is_none")] + {% endif %} pub previous_block_hash: Option>, /// [prev512] Previous block hash using SHA-512. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "prev512", skip_serializing_if = "Option::is_none")] + {% endif %} pub previous_block_hash_512: Option>, /// [seed] Sortition seed. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "seed", skip_serializing_if = "Option::is_none")] + {% endif %} pub seed: Option>, /// [txn] Root of transaction merkle tree using SHA512_256. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "txn", skip_serializing_if = "Option::is_none")] + {% endif %} pub transactions_root: Option>, /// [txn256] Root of transaction vector commitment using SHA256. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "txn256", skip_serializing_if = "Option::is_none")] + {% endif %} pub transactions_root_sha256: Option>, /// [txn512] Root of transaction vector commitment using SHA512. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "txn512", skip_serializing_if = "Option::is_none")] + {% endif %} pub transactions_root_sha512: Option>, /// [ts] Block timestamp in seconds since epoch. + {% if not ffi %} #[serde(rename = "ts", skip_serializing_if = "Option::is_none")] + {% endif %} pub timestamp: Option, /// [gen] Genesis ID. + {% if not ffi %} #[serde(rename = "gen", skip_serializing_if = "Option::is_none")] + {% endif %} pub genesis_id: Option, /// [gh] Genesis hash. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "gh", skip_serializing_if = "Option::is_none")] + {% endif %} pub genesis_hash: Option>, /// [prp] Proposer address. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "prp", skip_serializing_if = "Option::is_none")] + {% endif %} pub proposer: Option>, /// [fc] Fees collected in this block. + {% if not ffi %} #[serde(rename = "fc", skip_serializing_if = "Option::is_none")] + {% endif %} pub fees_collected: Option, /// [bi] Bonus incentive for block proposal. + {% if not ffi %} #[serde(rename = "bi", skip_serializing_if = "Option::is_none")] + {% endif %} pub bonus: Option, /// [pp] Proposer payout. + {% if not ffi %} #[serde(rename = "pp", skip_serializing_if = "Option::is_none")] + {% endif %} pub proposer_payout: Option, /// [fees] FeeSink address. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "fees", skip_serializing_if = "Option::is_none")] + {% endif %} pub fee_sink: Option>, /// [rwd] RewardsPool address. + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "rwd", skip_serializing_if = "Option::is_none")] + {% endif %} pub rewards_pool: Option>, /// [earn] Rewards level. + {% if not ffi %} #[serde(rename = "earn", skip_serializing_if = "Option::is_none")] + {% endif %} pub rewards_level: Option, /// [rate] Rewards rate. + {% if not ffi %} #[serde(rename = "rate", skip_serializing_if = "Option::is_none")] + {% endif %} pub rewards_rate: Option, /// [frac] Rewards residue. + {% if not ffi %} #[serde(rename = "frac", skip_serializing_if = "Option::is_none")] + {% endif %} pub rewards_residue: Option, /// [rwcalr] Rewards recalculation round. + {% if not ffi %} #[serde(rename = "rwcalr", skip_serializing_if = "Option::is_none")] + {% endif %} pub rewards_recalculation_round: Option, /// [proto] Current consensus protocol. + {% if not ffi %} #[serde(rename = "proto", skip_serializing_if = "Option::is_none")] + {% endif %} pub current_protocol: Option, /// [nextproto] Next proposed protocol. + {% if not ffi %} #[serde(rename = "nextproto", skip_serializing_if = "Option::is_none")] + {% endif %} pub next_protocol: Option, /// [nextyes] Next protocol approvals. + {% if not ffi %} #[serde(rename = "nextyes", skip_serializing_if = "Option::is_none")] + {% endif %} pub next_protocol_approvals: Option, /// [nextbefore] Next protocol vote deadline. + {% if not ffi %} #[serde(rename = "nextbefore", skip_serializing_if = "Option::is_none")] + {% endif %} pub next_protocol_vote_before: Option, /// [nextswitch] Next protocol switch round. + {% if not ffi %} #[serde(rename = "nextswitch", skip_serializing_if = "Option::is_none")] + {% endif %} pub next_protocol_switch_on: Option, /// [upgradeprop] Upgrade proposal. + {% if not ffi %} #[serde(rename = "upgradeprop", skip_serializing_if = "Option::is_none")] + {% endif %} pub upgrade_propose: Option, /// [upgradedelay] Upgrade delay in rounds. + {% if not ffi %} #[serde(rename = "upgradedelay", skip_serializing_if = "Option::is_none")] + {% endif %} pub upgrade_delay: Option, /// [upgradeyes] Upgrade approval flag. + {% if not ffi %} #[serde(rename = "upgradeyes", skip_serializing_if = "Option::is_none")] + {% endif %} pub upgrade_approve: Option, /// [tc] Transaction counter. + {% if not ffi %} #[serde(rename = "tc", skip_serializing_if = "Option::is_none")] + {% endif %} pub txn_counter: Option, /// [spt] State proof tracking data keyed by state proof type. + {% if not ffi %} #[serde(rename = "spt", skip_serializing_if = "Option::is_none", default)] + {% endif %} pub state_proof_tracking: Option, /// [partupdrmv] Expired participation accounts. + {% if not ffi %} #[serde_as(as = "Option>")] #[serde(rename = "partupdrmv", skip_serializing_if = "Option::is_none")] + {% endif %} pub expired_participation_accounts: Option>>, /// [partupdabs] Absent participation accounts. + {% if not ffi %} #[serde_as(as = "Option>")] #[serde(rename = "partupdabs", skip_serializing_if = "Option::is_none")] + {% endif %} pub absent_participation_accounts: Option>>, /// [txns] Block transactions (Payset). + {% if not ffi %} #[serde(rename = "txns", skip_serializing_if = "Option::is_none")] + {% endif %} pub transactions: Option>, } +{% if not ffi %} +impl Default for Block { + fn default() -> Self { + Self { + round: None, + previous_block_hash: None, + previous_block_hash_512: None, + seed: None, + transactions_root: None, + transactions_root_sha256: None, + transactions_root_sha512: None, + timestamp: None, + genesis_id: None, + genesis_hash: None, + proposer: None, + fees_collected: None, + bonus: None, + proposer_payout: None, + fee_sink: None, + rewards_pool: None, + rewards_level: None, + rewards_rate: None, + rewards_residue: None, + rewards_recalculation_round: None, + current_protocol: None, + next_protocol: None, + next_protocol_approvals: None, + next_protocol_vote_before: None, + next_protocol_switch_on: None, + upgrade_propose: None, + upgrade_delay: None, + upgrade_approve: None, + txn_counter: None, + state_proof_tracking: None, + expired_participation_accounts: None, + absent_participation_accounts: None, + transactions: None, + } + } +} + impl AlgorandMsgpack for Block { - const PREFIX: &'static [u8] = b""; // Adjust prefix as needed for your specific type + const PREFIX: &'static [u8] = b""; } impl Block { @@ -160,3 +271,88 @@ impl Block { Ok(Self::decode(bytes)?) } } +{% endif %} + +{% if ffi %} +impl From for Block { + fn from(rust_struct: RustBlock) -> Self { + Self { + round: rust_struct.round, + previous_block_hash: rust_struct.previous_block_hash, + previous_block_hash_512: rust_struct.previous_block_hash_512, + seed: rust_struct.seed, + transactions_root: rust_struct.transactions_root, + transactions_root_sha256: rust_struct.transactions_root_sha256, + transactions_root_sha512: rust_struct.transactions_root_sha512, + timestamp: rust_struct.timestamp, + genesis_id: rust_struct.genesis_id, + genesis_hash: rust_struct.genesis_hash, + proposer: rust_struct.proposer, + fees_collected: rust_struct.fees_collected, + bonus: rust_struct.bonus, + proposer_payout: rust_struct.proposer_payout, + fee_sink: rust_struct.fee_sink, + rewards_pool: rust_struct.rewards_pool, + rewards_level: rust_struct.rewards_level, + rewards_rate: rust_struct.rewards_rate, + rewards_residue: rust_struct.rewards_residue, + rewards_recalculation_round: rust_struct.rewards_recalculation_round, + current_protocol: rust_struct.current_protocol, + next_protocol: rust_struct.next_protocol, + next_protocol_approvals: rust_struct.next_protocol_approvals, + next_protocol_vote_before: rust_struct.next_protocol_vote_before, + next_protocol_switch_on: rust_struct.next_protocol_switch_on, + upgrade_propose: rust_struct.upgrade_propose, + upgrade_delay: rust_struct.upgrade_delay, + upgrade_approve: rust_struct.upgrade_approve, + txn_counter: rust_struct.txn_counter, + state_proof_tracking: rust_struct.state_proof_tracking.map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + expired_participation_accounts: rust_struct.expired_participation_accounts, + absent_participation_accounts: rust_struct.absent_participation_accounts, + transactions: rust_struct.transactions.map(|v| v.into_iter().map(|tx| tx.into()).collect()), + } + } +} + +impl TryFrom for RustBlock { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: Block) -> Result { + Ok(Self { + round: ffi_struct.round, + previous_block_hash: ffi_struct.previous_block_hash, + previous_block_hash_512: ffi_struct.previous_block_hash_512, + seed: ffi_struct.seed, + transactions_root: ffi_struct.transactions_root, + transactions_root_sha256: ffi_struct.transactions_root_sha256, + transactions_root_sha512: ffi_struct.transactions_root_sha512, + timestamp: ffi_struct.timestamp, + genesis_id: ffi_struct.genesis_id, + genesis_hash: ffi_struct.genesis_hash, + proposer: ffi_struct.proposer, + fees_collected: ffi_struct.fees_collected, + bonus: ffi_struct.bonus, + proposer_payout: ffi_struct.proposer_payout, + fee_sink: ffi_struct.fee_sink, + rewards_pool: ffi_struct.rewards_pool, + rewards_level: ffi_struct.rewards_level, + rewards_rate: ffi_struct.rewards_rate, + rewards_residue: ffi_struct.rewards_residue, + rewards_recalculation_round: ffi_struct.rewards_recalculation_round, + current_protocol: ffi_struct.current_protocol, + next_protocol: ffi_struct.next_protocol, + next_protocol_approvals: ffi_struct.next_protocol_approvals, + next_protocol_vote_before: ffi_struct.next_protocol_vote_before, + next_protocol_switch_on: ffi_struct.next_protocol_switch_on, + upgrade_propose: ffi_struct.upgrade_propose, + upgrade_delay: ffi_struct.upgrade_delay, + upgrade_approve: ffi_struct.upgrade_approve, + txn_counter: ffi_struct.txn_counter, + state_proof_tracking: ffi_struct.state_proof_tracking.map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + expired_participation_accounts: ffi_struct.expired_participation_accounts, + absent_participation_accounts: ffi_struct.absent_participation_accounts, + transactions: ffi_struct.transactions.map(|v| v.into_iter().map(|tx| tx.try_into()).collect::, _>>()).transpose()?, + }) + } +} +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_account_state_delta.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_account_state_delta.rs.j2 index cb14f7730..f16b3ed0a 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_account_state_delta.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_account_state_delta.rs.j2 @@ -1,29 +1,95 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; +{% if not ffi %} use serde::{Deserialize, Serialize}; +use algokit_transact::AlgorandMsgpack; +{% else %} +use algod_client::models::BlockAccountStateDelta as RustBlockAccountStateDelta; +{% endif %} use crate::models::BlockStateDelta; /// BlockAccountStateDelta pairs an address with a BlockStateDelta map. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq)] +{% if ffi %} +#[derive(uniffi::Record)] +{% else %} +#[derive(Serialize, Deserialize)] +{% endif %} pub struct BlockAccountStateDelta { + {% if not ffi %} #[serde(rename = "address")] + {% endif %} pub address: String, + {% if not ffi %} #[serde(rename = "delta")] + {% endif %} pub delta: BlockStateDelta, } +{% if not ffi %} +impl Default for BlockAccountStateDelta { + fn default() -> Self { + Self { + address: String::new(), + delta: Default::default(), + } + } +} + +impl AlgorandMsgpack for BlockAccountStateDelta { + const PREFIX: &'static [u8] = b""; +} + impl BlockAccountStateDelta { - pub fn new(address: String, delta: BlockStateDelta) -> Self { Self { address, delta } } + /// Default constructor for BlockAccountStateDelta + pub fn new() -> BlockAccountStateDelta { + BlockAccountStateDelta::default() + } + + /// Constructor with parameters + pub fn with_params(address: String, delta: BlockStateDelta) -> Self { + Self { address, delta } + } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } +} +{% endif %} + +{% if ffi %} +impl From for BlockAccountStateDelta { + fn from(rust_struct: RustBlockAccountStateDelta) -> Self { + Self { + address: rust_struct.address, + delta: rust_struct.delta.into_iter().map(|(k, v)| (k, v.into())).collect(), + } + } +} + +impl From for RustBlockAccountStateDelta { + fn from(ffi_struct: BlockAccountStateDelta) -> Self { + Self { + address: ffi_struct.address, + delta: ffi_struct.delta.into_iter().map(|(k, v)| (k, v.into())).collect(), + } + } } +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_app_eval_delta.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_app_eval_delta.rs.j2 index 8fb08890f..dcb8f1f3e 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_app_eval_delta.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_app_eval_delta.rs.j2 @@ -1,57 +1,126 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +{% if not ffi %} use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -use std::collections::HashMap; - -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +use algod_client::models::BlockAppEvalDelta as RustBlockAppEvalDelta; +{% endif %} +use std::collections::HashMap; use crate::models::SignedTxnInBlock; use crate::models::BlockStateDelta; /// BlockAppEvalDelta matches msgpack wire for blocks; uses BlockStateDelta maps. +#[derive(Clone, Debug, PartialEq)] +{% if not ffi %} #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize)] +{% else %} +#[derive(uniffi::Record)] +{% endif %} pub struct BlockAppEvalDelta { /// [gd] Global state delta for the application. + {% if not ffi %} #[serde(rename = "gd", skip_serializing_if = "Option::is_none")] + {% endif %} pub global_delta: Option, /// [ld] Local state deltas keyed by integer account index. + {% if not ffi %} #[serde(rename = "ld", skip_serializing_if = "Option::is_none")] + {% endif %} pub local_deltas: Option>, /// [itx] Inner transactions produced by this application execution. + {% if not ffi %} #[serde(rename = "itx", skip_serializing_if = "Option::is_none")] + {% endif %} pub inner_txns: Option>, /// [sa] Shared accounts referenced by local deltas. + {% if not ffi %} #[serde_as(as = "Option>")] #[serde(rename = "sa", skip_serializing_if = "Option::is_none")] + {% endif %} pub shared_accounts: Option>>, /// [lg] Application log outputs as strings (msgpack strings). + {% if not ffi %} #[serde(rename = "lg", skip_serializing_if = "Option::is_none")] + {% endif %} pub logs: Option>, } +{% if not ffi %} +impl Default for BlockAppEvalDelta { + fn default() -> Self { + Self { + global_delta: None, + local_deltas: None, + inner_txns: None, + shared_accounts: None, + logs: None, + } + } +} + impl AlgorandMsgpack for BlockAppEvalDelta { const PREFIX: &'static [u8] = b""; } impl BlockAppEvalDelta { - pub fn new() -> BlockAppEvalDelta { BlockAppEvalDelta::default() } + /// Default constructor for BlockAppEvalDelta + pub fn new() -> BlockAppEvalDelta { + BlockAppEvalDelta::default() + } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } +} +{% endif %} + +{% if ffi %} +impl From for BlockAppEvalDelta { + fn from(rust_struct: RustBlockAppEvalDelta) -> Self { + Self { + global_delta: rust_struct.global_delta.map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + local_deltas: rust_struct.local_deltas.map(|v| v.into_iter().map(|(k, v)| (k, v.into_iter().map(|(k2, v2)| (k2, v2.into())).collect())).collect()), + inner_txns: rust_struct.inner_txns.map(|v| v.into_iter().map(|tx| tx.into()).collect()), + shared_accounts: rust_struct.shared_accounts, + logs: rust_struct.logs, + } + } +} + +impl TryFrom for RustBlockAppEvalDelta { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: BlockAppEvalDelta) -> Result { + Ok(Self { + global_delta: ffi_struct.global_delta.map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + local_deltas: ffi_struct.local_deltas.map(|v| v.into_iter().map(|(k, v)| (k, v.into_iter().map(|(k2, v2)| (k2, v2.into())).collect())).collect()), + inner_txns: ffi_struct.inner_txns.map(|v| v.into_iter().map(|tx| tx.try_into()).collect::, _>>()).transpose()?, + shared_accounts: ffi_struct.shared_accounts, + logs: ffi_struct.logs, + }) + } } +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_application_eval_delta.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_application_eval_delta.rs.j2 index ae175315a..1a0abca4b 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_application_eval_delta.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_application_eval_delta.rs.j2 @@ -1,57 +1,126 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +{% if not ffi %} use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -use std::collections::HashMap; - -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +use algod_client::models::BlockApplicationEvalDelta as RustBlockApplicationEvalDelta; +{% endif %} +use std::collections::HashMap; use crate::models::SignedTxnInBlock; use crate::models::BlockStateDelta; /// BlockApplicationEvalDelta matches msgpack wire for blocks; uses BlockStateDelta maps. +#[derive(Clone, Debug, PartialEq)] +{% if not ffi %} #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize)] +{% else %} +#[derive(uniffi::Record)] +{% endif %} pub struct BlockApplicationEvalDelta { /// [gd] Global state delta for the application. + {% if not ffi %} #[serde(rename = "gd", skip_serializing_if = "Option::is_none")] + {% endif %} pub global_delta: Option, /// [ld] Local state deltas keyed by integer account index. + {% if not ffi %} #[serde(rename = "ld", skip_serializing_if = "Option::is_none")] + {% endif %} pub local_deltas: Option>, /// [itx] Inner transactions produced by this application execution. + {% if not ffi %} #[serde(rename = "itx", skip_serializing_if = "Option::is_none")] + {% endif %} pub inner_txns: Option>, /// [sa] Shared accounts referenced by local deltas. + {% if not ffi %} #[serde_as(as = "Option>")] #[serde(rename = "sa", skip_serializing_if = "Option::is_none")] + {% endif %} pub shared_accounts: Option>>, /// [lg] Application log outputs as strings (msgpack strings). + {% if not ffi %} #[serde(rename = "lg", skip_serializing_if = "Option::is_none")] + {% endif %} pub logs: Option>, } +{% if not ffi %} +impl Default for BlockApplicationEvalDelta { + fn default() -> Self { + Self { + global_delta: None, + local_deltas: None, + inner_txns: None, + shared_accounts: None, + logs: None, + } + } +} + impl AlgorandMsgpack for BlockApplicationEvalDelta { const PREFIX: &'static [u8] = b""; } impl BlockApplicationEvalDelta { - pub fn new() -> BlockApplicationEvalDelta { BlockApplicationEvalDelta::default() } + /// Default constructor for BlockApplicationEvalDelta + pub fn new() -> BlockApplicationEvalDelta { + BlockApplicationEvalDelta::default() + } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } +} +{% endif %} + +{% if ffi %} +impl From for BlockApplicationEvalDelta { + fn from(rust_struct: RustBlockApplicationEvalDelta) -> Self { + Self { + global_delta: rust_struct.global_delta.map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + local_deltas: rust_struct.local_deltas.map(|v| v.into_iter().map(|(k, v)| (k, v.into_iter().map(|(k2, v2)| (k2, v2.into())).collect())).collect()), + inner_txns: rust_struct.inner_txns.map(|v| v.into_iter().map(|tx| tx.into()).collect()), + shared_accounts: rust_struct.shared_accounts, + logs: rust_struct.logs, + } + } +} + +impl TryFrom for RustBlockApplicationEvalDelta { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: BlockApplicationEvalDelta) -> Result { + Ok(Self { + global_delta: ffi_struct.global_delta.map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + local_deltas: ffi_struct.local_deltas.map(|v| v.into_iter().map(|(k, v)| (k, v.into_iter().map(|(k2, v2)| (k2, v2.into())).collect())).collect()), + inner_txns: ffi_struct.inner_txns.map(|v| v.into_iter().map(|tx| tx.try_into()).collect::, _>>()).transpose()?, + shared_accounts: ffi_struct.shared_accounts, + logs: ffi_struct.logs, + }) + } } +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_eval_delta.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_eval_delta.rs.j2 index 64049ae23..67ac83bc8 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_eval_delta.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_eval_delta.rs.j2 @@ -1,40 +1,69 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; +{% if not ffi %} use serde::{Deserialize, Serialize}; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algod_client::models::BlockEvalDelta as RustBlockEvalDelta; +{% endif %} /// BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq)] +{% if ffi %} +#[derive(uniffi::Record)] +{% else %} +#[derive(Serialize, Deserialize)] +{% endif %} pub struct BlockEvalDelta { /// [at] delta action. + {% if not ffi %} #[serde(rename = "at")] + {% endif %} pub action: u32, /// [bs] bytes value. + {% if not ffi %} #[serde(rename = "bs", skip_serializing_if = "Option::is_none")] + {% endif %} pub bytes: Option, /// [ui] uint value. + {% if not ffi %} #[serde(rename = "ui", skip_serializing_if = "Option::is_none")] + {% endif %} pub uint: Option, } +{% if not ffi %} +impl Default for BlockEvalDelta { + fn default() -> Self { + Self { + action: 0, + bytes: None, + uint: None, + } + } +} + impl AlgorandMsgpack for BlockEvalDelta { const PREFIX: &'static [u8] = b""; } impl BlockEvalDelta { - /// Constructor for BlockEvalDelta - pub fn new(action: u32) -> BlockEvalDelta { + /// Default constructor for BlockEvalDelta + pub fn new() -> BlockEvalDelta { + BlockEvalDelta::default() + } + + /// Constructor with action parameter + pub fn with_action(action: u32) -> BlockEvalDelta { BlockEvalDelta { action, bytes: None, @@ -52,5 +81,28 @@ impl BlockEvalDelta { Ok(Self::decode(bytes)?) } } +{% endif %} + +{% if ffi %} +impl From for BlockEvalDelta { + fn from(rust_struct: RustBlockEvalDelta) -> Self { + Self { + action: rust_struct.action, + bytes: rust_struct.bytes, + uint: rust_struct.uint, + } + } +} + +impl From for RustBlockEvalDelta { + fn from(ffi_struct: BlockEvalDelta) -> Self { + Self { + action: ffi_struct.action, + bytes: ffi_struct.bytes, + uint: ffi_struct.uint, + } + } +} +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_state_delta.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_state_delta.rs.j2 index a7af21e30..36a7079c6 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_state_delta.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_state_delta.rs.j2 @@ -1,11 +1,11 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking.rs.j2 index 791b72b3f..9f93d3736 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking.rs.j2 @@ -1,15 +1,17 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; +{% if not ffi %} use serde::{Deserialize, Serialize}; +{% endif %} use std::collections::HashMap; use crate::models::BlockStateProofTrackingData; diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking_data.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking_data.rs.j2 index a8e3aeeed..d962f08f5 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking_data.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/block_state_proof_tracking_data.rs.j2 @@ -1,44 +1,102 @@ /* - * {{ spec.info.title }} + * Algod REST API. * - * {{ spec.info.description or "API client generated from OpenAPI specification" }} + * API endpoint for algod operations. * - * The version of the OpenAPI document: {{ spec.info.version }} - {% if spec.info.contact and spec.info.contact.email %} * Contact: {{ spec.info.contact.email }} - {% endif %} * Generated by: Rust OpenAPI Generator + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator */ use crate::models; +{% if not ffi %} use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Bytes}; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algod_client::models::BlockStateProofTrackingData as RustBlockStateProofTrackingData; +{% endif %} /// Tracking metadata for a specific StateProofType. +#[derive(Clone, Debug, PartialEq)] +{% if not ffi %} #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize)] +{% else %} +#[derive(uniffi::Record)] +{% endif %} pub struct BlockStateProofTrackingData { /// [v] Vector commitment root of state proof voters (may be absent when not applicable). + {% if not ffi %} #[serde_as(as = "Option")] #[serde(rename = "v", skip_serializing_if = "Option::is_none", default)] + {% endif %} pub state_proof_voters_commitment: Option>, /// [t] Online total weight during state proof round. + {% if not ffi %} #[serde(rename = "t", skip_serializing_if = "Option::is_none", default)] + {% endif %} pub state_proof_online_total_weight: Option, /// [n] Next round for which state proofs are accepted. + {% if not ffi %} #[serde(rename = "n", skip_serializing_if = "Option::is_none", default)] + {% endif %} pub state_proof_next_round: Option, } +{% if not ffi %} +impl Default for BlockStateProofTrackingData { + fn default() -> Self { + Self { + state_proof_voters_commitment: None, + state_proof_online_total_weight: None, + state_proof_next_round: None, + } + } +} + impl AlgorandMsgpack for BlockStateProofTrackingData { const PREFIX: &'static [u8] = b""; } impl BlockStateProofTrackingData { + /// Default constructor for BlockStateProofTrackingData pub fn new() -> BlockStateProofTrackingData { BlockStateProofTrackingData::default() } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } +} +{% endif %} + +{% if ffi %} +impl From for BlockStateProofTrackingData { + fn from(rust_struct: RustBlockStateProofTrackingData) -> Self { + Self { + state_proof_voters_commitment: rust_struct.state_proof_voters_commitment, + state_proof_online_total_weight: rust_struct.state_proof_online_total_weight, + state_proof_next_round: rust_struct.state_proof_next_round, + } + } +} + +impl From for RustBlockStateProofTrackingData { + fn from(ffi_struct: BlockStateProofTrackingData) -> Self { + Self { + state_proof_voters_commitment: ffi_struct.state_proof_voters_commitment, + state_proof_online_total_weight: ffi_struct.state_proof_online_total_weight, + state_proof_next_round: ffi_struct.state_proof_next_round, + } + } } +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/get_block.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/get_block.rs.j2 index aee113d70..d9b99b3ac 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/get_block.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/get_block.rs.j2 @@ -9,41 +9,64 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +{% if not ffi %} use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; - -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +use algod_client::models::GetBlock as RustGetBlock; +{% endif %} use crate::models::Block; /// Encoded block object. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq)] +{% if ffi %} +#[derive(uniffi::Record)] +{% else %} +#[derive(Serialize, Deserialize)] +{% endif %} pub struct GetBlock { /// Block data including header and transactions. + {% if not ffi %} #[serde(rename = "block")] + {% endif %} pub block: Block, /// Block certificate (msgpack only). + {% if not ffi %} #[serde( with = "crate::msgpack_value_bytes", default, rename = "cert", skip_serializing_if = "Option::is_none" )] + {% endif %} pub cert: Option>, } +{% if not ffi %} +impl Default for GetBlock { + fn default() -> Self { + Self { + block: Block::default(), + cert: None, + } + } +} + impl AlgorandMsgpack for GetBlock { - const PREFIX: &'static [u8] = b""; // Adjust prefix as needed for your specific type + const PREFIX: &'static [u8] = b""; } impl GetBlock { - /// Constructor for GetBlock - pub fn new(block: Block) -> GetBlock { + /// Default constructor for GetBlock + pub fn new() -> GetBlock { + GetBlock::default() + } + + /// Constructor with block parameter + pub fn with_block(block: Block) -> GetBlock { GetBlock { block, cert: None } } @@ -57,3 +80,26 @@ impl GetBlock { Ok(Self::decode(bytes)?) } } +{% endif %} + +{% if ffi %} +impl From for GetBlock { + fn from(rust_struct: RustGetBlock) -> Self { + Self { + block: rust_struct.block.into(), + cert: rust_struct.cert, + } + } +} + +impl TryFrom for RustGetBlock { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: GetBlock) -> Result { + Ok(Self { + block: ffi_struct.block.try_into()?, + cert: ffi_struct.cert, + }) + } +} +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/block/signed_txn_in_block.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/block/signed_txn_in_block.rs.j2 index 24b03ef00..92a4fa06c 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/block/signed_txn_in_block.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/block/signed_txn_in_block.rs.j2 @@ -9,64 +9,92 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +{% if not ffi %} use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; - -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +{% else %} +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +use algod_client::models::SignedTxnInBlock as RustSignedTxnInBlock; +{% endif %} use crate::models::BlockAppEvalDelta; /// SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq)] +{% if ffi %} +#[derive(uniffi::Record)] +{% else %} +#[derive(Serialize, Deserialize)] +{% endif %} pub struct SignedTxnInBlock { /// SignedTransaction fields (flattened from algokit_transact) + {% if not ffi %} #[serde(flatten)] + {% endif %} pub signed_transaction: AlgokitSignedTransaction, /// [lsig] Logic signature (program signature). + {% if not ffi %} #[serde( with = "crate::msgpack_value_bytes", default, rename = "lsig", skip_serializing_if = "Option::is_none" )] + {% endif %} pub logic_signature: Option>, /// [ca] Rewards applied to close-remainder-to account. + {% if not ffi %} #[serde(rename = "ca", skip_serializing_if = "Option::is_none")] + {% endif %} pub closing_amount: Option, /// [aca] Asset closing amount. + {% if not ffi %} #[serde(rename = "aca", skip_serializing_if = "Option::is_none")] + {% endif %} pub asset_closing_amount: Option, /// [rs] Sender rewards. + {% if not ffi %} #[serde(rename = "rs", skip_serializing_if = "Option::is_none")] + {% endif %} pub sender_rewards: Option, /// [rr] Receiver rewards. + {% if not ffi %} #[serde(rename = "rr", skip_serializing_if = "Option::is_none")] + {% endif %} pub receiver_rewards: Option, /// [rc] Close rewards. + {% if not ffi %} #[serde(rename = "rc", skip_serializing_if = "Option::is_none")] + {% endif %} pub close_rewards: Option, /// [dt] State changes from app execution. + {% if not ffi %} #[serde(rename = "dt", skip_serializing_if = "Option::is_none")] + {% endif %} pub eval_delta: Option, /// [caid] Asset ID if created. + {% if not ffi %} #[serde(rename = "caid", skip_serializing_if = "Option::is_none")] + {% endif %} pub config_asset: Option, /// [apid] App ID if created. + {% if not ffi %} #[serde(rename = "apid", skip_serializing_if = "Option::is_none")] + {% endif %} pub application_id: Option, /// [hgi] Has genesis ID flag. + {% if not ffi %} #[serde(rename = "hgi", skip_serializing_if = "Option::is_none")] + {% endif %} pub has_genesis_id: Option, /// [hgh] Has genesis hash flag. + {% if not ffi %} #[serde(rename = "hgh", skip_serializing_if = "Option::is_none")] + {% endif %} pub has_genesis_hash: Option, } - +{% if not ffi %} impl Default for SignedTxnInBlock { fn default() -> Self { Self { @@ -131,3 +159,46 @@ impl SignedTxnInBlock { Ok(Self::decode(bytes)?) } } +{% endif %} + +{% if ffi %} +impl From for SignedTxnInBlock { + fn from(rust_struct: RustSignedTxnInBlock) -> Self { + Self { + signed_transaction: rust_struct.signed_transaction.into(), + logic_signature: rust_struct.logic_signature, + closing_amount: rust_struct.closing_amount, + asset_closing_amount: rust_struct.asset_closing_amount, + sender_rewards: rust_struct.sender_rewards, + receiver_rewards: rust_struct.receiver_rewards, + close_rewards: rust_struct.close_rewards, + eval_delta: rust_struct.eval_delta.map(|v| v.into()), + config_asset: rust_struct.config_asset, + application_id: rust_struct.application_id, + has_genesis_id: rust_struct.has_genesis_id, + has_genesis_hash: rust_struct.has_genesis_hash, + } + } +} + +impl TryFrom for RustSignedTxnInBlock { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: SignedTxnInBlock) -> Result { + Ok(Self { + signed_transaction: ffi_struct.signed_transaction.try_into()?, + logic_signature: ffi_struct.logic_signature, + closing_amount: ffi_struct.closing_amount, + asset_closing_amount: ffi_struct.asset_closing_amount, + sender_rewards: ffi_struct.sender_rewards, + receiver_rewards: ffi_struct.receiver_rewards, + close_rewards: ffi_struct.close_rewards, + eval_delta: ffi_struct.eval_delta.map(|v| v.try_into()).transpose()?, + config_asset: ffi_struct.config_asset, + application_id: ffi_struct.application_id, + has_genesis_id: ffi_struct.has_genesis_id, + has_genesis_hash: ffi_struct.has_genesis_hash, + }) + } +} +{% endif %} diff --git a/api/oas_generator/rust_oas_generator/templates/models/mod.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/mod.rs.j2 index a0338c124..8c54da41e 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/mod.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/mod.rs.j2 @@ -8,11 +8,30 @@ {% endif %} * Generated by: Rust OpenAPI Generator */ -#[cfg(feature = "ffi_uniffi")] -pub type UnknownJsonValue = String; +{% if ffi %} +#[derive(Clone, Default, Debug, PartialEq)] +pub struct UnknownJsonValue(serde_json::Value); -#[cfg(not(feature = "ffi_uniffi"))] +uniffi::custom_type!(UnknownJsonValue, String, { + lower: |s| s.0.to_string(), + try_lift: |s| serde_json::from_str(&s).map_err(|e| uniffi::deps::anyhow::Error::msg(e.to_string())).map(UnknownJsonValue), +}); + +impl From for serde_json::Value { + fn from(ffi_struct: UnknownJsonValue) -> Self { + ffi_struct.0 + } +} + +impl From for UnknownJsonValue { + fn from(rust_struct: serde_json::Value) -> Self { + UnknownJsonValue(rust_struct) + } +} + +{% else %} pub type UnknownJsonValue = serde_json::Value; +{% endif %} {% for schema_name, schema in schemas.items() %} pub mod {{ schema.rust_file_name }}; diff --git a/api/oas_generator/rust_oas_generator/templates/models/model.rs.j2 b/api/oas_generator/rust_oas_generator/templates/models/model.rs.j2 index e06747876..f80ff7417 100644 --- a/api/oas_generator/rust_oas_generator/templates/models/model.rs.j2 +++ b/api/oas_generator/rust_oas_generator/templates/models/model.rs.j2 @@ -12,22 +12,23 @@ {% from 'macros/enum_macros.j2' import generate_string_enum %} use crate::models; -use serde::{Deserialize, Serialize}; +{% if not ffi %} use serde::{Deserialize, Serialize}; {% endif %} +{% if ffi %} use algod_client::models::{{ schema.rust_struct_name }} as Rust{{ schema.rust_struct_name }}; {% endif %} {% if schema.is_string_enum %} use std::fmt; use std::str::FromStr; {% endif %} -{% if schema.has_msgpack_fields %} +{% if not ffi and schema.has_msgpack_fields %} use serde_with::{Bytes, serde_as}; {% endif %} {% if schema.has_signed_transaction_fields or schema.implements_algokit_msgpack %} -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; - -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +{% if not ffi %} +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use algokit_transact::AlgorandMsgpack; +{% else %} +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +{% endif %} {% endif %} {# Generate imports for custom types used in this schema #} @@ -74,7 +75,14 @@ use crate::models::{{ schema.underlying_rust_type }}; {% if schema.description %} {{ schema.description | rust_doc_comment }} {% endif %} +{% if ffi %} +#[derive(Clone, Debug, PartialEq)] +pub struct {{ schema.rust_struct_name }}({{ schema.underlying_rust_type }}); + +uniffi::custom_newtype!({{ schema.rust_struct_name }}, {{ schema.underlying_rust_type }}); +{% else %} pub type {{ schema.rust_struct_name }} = {{ schema.underlying_rust_type }}; +{% endif %} {# Handle string enum schemas as Rust enums #} {% elif schema.is_string_enum %} {{ generate_string_enum(schema.rust_struct_name, schema.enum_values, schema.description) }} @@ -82,7 +90,7 @@ pub type {{ schema.rust_struct_name }} = {{ schema.underlying_rust_type }}; {% if schema.description %} {{ schema.description | rust_doc_comment }} {% endif %} -{% if schema.has_msgpack_fields %} +{% if not ffi and schema.has_msgpack_fields %} #[serde_as] {% endif %} {% set has_signed_tx = schema.has_signed_transaction_fields %} @@ -93,8 +101,12 @@ pub type {{ schema.rust_struct_name }} = {{ schema.underlying_rust_type }}; {% endif %} {% endfor %} {% set needs_manual_default = complex_signed_tx_fields|length > 0 %} -#[derive(Clone, {% if not needs_manual_default %}Default, {% endif %}Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, {% if not needs_manual_default and not ffi %}Default, {% endif %}Debug, PartialEq)] +{% if ffi %} +#[derive(uniffi::Record)] +{% else %} +#[derive(Serialize, Deserialize)] +{% endif %} {% if schema.vendor_extensions.get('x-algokit-signed-txn') %} // This struct represents a SignedTransaction and can be converted to/from AlgoKit's SignedTransaction {% endif %} @@ -104,6 +116,7 @@ pub struct {{ schema.rust_struct_name }} { {{ property.description | rust_doc_comment(4) }} {% endif %} {% set is_account_related = schema.name in ['Account', 'AccountParticipation', 'AssetHolding', 'ApplicationLocalState', 'Application', 'Asset', 'AssetParams', 'ApplicationParams'] %} + {% if not ffi %} {% if schema.implements_algokit_msgpack and not is_account_related %} {% if property.is_base64_encoded %} {% if property.required %} @@ -134,6 +147,7 @@ pub struct {{ schema.rust_struct_name }} { {% endif %} {% endif %} #[serde(rename = "{{ property.name }}"{% if not property.required %}, skip_serializing_if = "Option::is_none"{% endif %})] + {% endif %} {% if property.is_signed_transaction %} pub {{ property.rust_field_name }}: {% if property.required %}{% if property.rust_type.startswith('Vec<') %}Vec{% else %}AlgokitSignedTransaction{% endif %}{% else %}Option<{% if property.rust_type.startswith('Vec<') %}Vec{% else %}AlgokitSignedTransaction{% endif %}>{% endif %}, {% else %} @@ -143,7 +157,7 @@ pub struct {{ schema.rust_struct_name }} { } {% endif %} -{% if needs_manual_default %} +{% if not ffi and needs_manual_default %} impl Default for {{ schema.rust_struct_name }} { fn default() -> Self { Self { @@ -208,7 +222,7 @@ impl TryFrom<{{ schema.rust_struct_name }}> for AlgokitSignedTransaction { } {% endif %} -{% if schema.implements_algokit_msgpack and not schema.underlying_rust_type and not schema.is_string_enum %} +{% if not ffi and schema.implements_algokit_msgpack and not schema.underlying_rust_type and not schema.is_string_enum %} impl AlgorandMsgpack for {{ schema.rust_struct_name }} { {% if schema.vendor_extensions.get('x-algokit-signed-txn') %} const PREFIX: &'static [u8] = b""; // No prefix for SignedTransaction @@ -218,7 +232,7 @@ impl AlgorandMsgpack for {{ schema.rust_struct_name }} { } {% endif %} -{% if not schema.underlying_rust_type and not schema.is_string_enum %} +{% if not ffi and not schema.underlying_rust_type and not schema.is_string_enum %} impl {{ schema.rust_struct_name }} { {% if schema.has_required_fields %} /// Constructor for {{ schema.rust_struct_name }} @@ -252,3 +266,135 @@ impl {{ schema.rust_struct_name }} { {% endif %} } {% endif %} + +{% set empty_struct = not (schema.schema_type == 'array' and schema.underlying_rust_type) and (schema.properties | length) == 0 %} + +{% if ffi %} +impl From for {{ schema.rust_struct_name }} { + fn from({% if empty_struct %}_{% endif %}rust_struct: Rust{{ schema.rust_struct_name }}) -> Self { + {% if schema.schema_type == 'array' and schema.underlying_rust_type %} + Self(rust_struct.into_iter().map(|v| v.into()).collect()) + {% else %} + Self { +{% for property in schema.properties %} + {% if property.required %} + {% if "Vec<" in property.rust_type %} + {{ property.rust_field_name }}: rust_struct.{{ property.rust_field_name }}.into_iter().map(|v| v.into()).collect(), + {% else %} + {{ property.rust_field_name }}: rust_struct.{{ property.rust_field_name }}.into(), + {% endif %} + {% else %} + {% if "Vec<" in property.rust_type %} + {{ property.rust_field_name }}: rust_struct.{{ property.rust_field_name }}.map(|v| v.into_iter().map(|v| v.into()).collect()), + {% else %} + {{ property.rust_field_name }}: rust_struct.{{ property.rust_field_name }}.map(|v| v.into()), + {% endif %} + {% endif %} +{% endfor %} + } +{%endif%} + } +} + +{# These types would require a TyFrom impl, most are return values only so there is no need to go from Ffi to Rust #} +{% set skip_from_types = ["GetPendingTransactions", "GetPendingTransactionsByAddress", "SimulateRequestTransactionGroup", "PendingTransactionResponse", "SimulateTransactionResult", "SimulateTransactionGroupResult", "SimulateTransaction", "SimulateRequest", "DryrunRequest", "DryrunTxnResult", "TealDryrun", "AccountApplicationInformation"] %} +{% if schema.rust_struct_name not in skip_from_types %} + +impl From<{{ schema.rust_struct_name }}> for Rust{{ schema.rust_struct_name }} { + fn from({% if empty_struct %}_{% endif %}ffi_struct: {{ schema.rust_struct_name }}) -> Self { + {% if schema.schema_type == 'array' and schema.underlying_rust_type %} + ffi_struct.0.into_iter().map(|v| v.into()).collect() + {% else %} + Self { +{% for property in schema.properties %} + {% if property.required %} + {% if "Vec<" in property.rust_type %} + {{ property.rust_field_name }}: ffi_struct.{{ property.rust_field_name }}.into_iter().map(|v| v.into()).collect(), + {% else %} + {{ property.rust_field_name }}: ffi_struct.{{ property.rust_field_name }}.into(), + {% endif %} + {% else %} + {% if "Vec<" in property.rust_type %} + {{ property.rust_field_name }}: ffi_struct.{{ property.rust_field_name }}.map(|v| v.into_iter().map(|v| v.into()).collect()), + {% else %} + {{ property.rust_field_name }}: ffi_struct.{{ property.rust_field_name }}.map(|v| v.into()), + {% endif %} + {% endif %} +{% endfor %} + } + {% endif %} + } +} +{% elif schema.rust_struct_name == "SimulateRequestTransactionGroup"%} +impl TryFrom for RustSimulateRequestTransactionGroup { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: SimulateRequestTransactionGroup) -> Result { + Ok(Self { + txns: ffi_struct + .txns + .into_iter() + .map(|v| { + v.try_into() + }) + .collect::>()?, + }) + } +} +{% elif schema.rust_struct_name == "SimulateRequest"%} +impl TryFrom for RustSimulateRequest { + type Error = crate::apis::Error; + + fn try_from(ffi_struct: SimulateRequest) -> Result { + Ok(Self { + txn_groups: ffi_struct + .txn_groups + .into_iter() + .map(|v| { + v.try_into() + .map_err(|e: algokit_transact_ffi::AlgoKitTransactError| { + crate::apis::Error::Serde { + message: e.to_string(), + } + }) + }) + .collect::>()?, + round: ffi_struct.round.map(|v| v.into()), + allow_empty_signatures: ffi_struct.allow_empty_signatures.map(|v| v.into()), + allow_more_logging: ffi_struct.allow_more_logging.map(|v| v.into()), + allow_unnamed_resources: ffi_struct.allow_unnamed_resources.map(|v| v.into()), + extra_opcode_budget: ffi_struct.extra_opcode_budget.map(|v| v.into()), + exec_trace_config: ffi_struct.exec_trace_config.map(|v| v.into()), + fix_signers: ffi_struct.fix_signers.map(|v| v.into()), + }) + } +} +{% elif schema.rust_struct_name == "DryrunRequest" %} +impl TryFrom for RustDryrunRequest { + type Error = crate::apis::Error; + + fn try_from(ffi_struct: DryrunRequest) -> Result { + Ok(Self { + txns: ffi_struct + .txns + .into_iter() + .map(|v| { + v.try_into() + .map_err(|e: algokit_transact_ffi::AlgoKitTransactError| { + crate::apis::Error::Serde { + message: e.to_string(), + } + }) + }) + .collect::>()?, + accounts: ffi_struct.accounts.into_iter().map(|v| v.into()).collect(), + apps: ffi_struct.apps.into_iter().map(|v| v.into()).collect(), + protocol_version: ffi_struct.protocol_version.into(), + round: ffi_struct.round.into(), + latest_timestamp: ffi_struct.latest_timestamp.into(), + sources: ffi_struct.sources.into_iter().map(|v| v.into()).collect(), + }) + } +} +{% endif %} +{% endif %} diff --git a/crates/algod_client/Cargo.toml b/crates/algod_client/Cargo.toml index 7e95b2b31..03b8beea6 100644 --- a/crates/algod_client/Cargo.toml +++ b/crates/algod_client/Cargo.toml @@ -9,9 +9,13 @@ edition = "2024" [features] default = ["default_client"] default_client = ["algokit_http_client/default_client"] -ffi_uniffi = ["dep:uniffi", "algokit_http_client/ffi_uniffi", "dep:algokit_transact_ffi"] [dependencies] +serde_json = "^1.0" + +# Error handling +snafu = { workspace = true } + # Core serialization serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = [ @@ -19,31 +23,22 @@ serde_with = { version = "^3.8", default-features = false, features = [ "std", "macros", ] } -serde_json = "^1.0" serde_repr = "^0.1" serde_bytes = "^0.11" # HTTP client -algokit_http_client = { path = "../algokit_http_client", features = ["ffi_uniffi"] } +algokit_http_client = { path = "../algokit_http_client" } url = "^2.5" -# Uniffi for FFI bindings -uniffi = { workspace = true, optional = true } -algokit_transact_ffi = { optional = true, version = "0.1.0", path = "../algokit_transact_ffi" } - # AlgoKit dependencies for msgpack and signed transactions algokit_transact = { path = "../algokit_transact" } # MessagePack serialization rmp-serde = "^1.1" rmpv = { version = "1.3.0", features = ["with-serde"] } -# Error handling -snafu = { workspace = true } - # Utilities base64 = "^0.22" uuid = { version = "^1.0", features = ["v4"] } - [dev-dependencies] tokio = { version = "1.0", features = ["full"] } tokio-test = "^0.4" \ No newline at end of file diff --git a/crates/algod_client/src/apis/abort_catchup.rs b/crates/algod_client/src/apis/abort_catchup.rs index a1933b235..7d1710d7a 100644 --- a/crates/algod_client/src/apis/abort_catchup.rs +++ b/crates/algod_client/src/apis/abort_catchup.rs @@ -22,7 +22,6 @@ use crate::models::{AbortCatchup, ErrorResponse}; /// struct for typed errors of method [`abort_catchup`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AbortCatchupError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/account_application_information.rs b/crates/algod_client/src/apis/account_application_information.rs index b0ddea68a..f2cee67bc 100644 --- a/crates/algod_client/src/apis/account_application_information.rs +++ b/crates/algod_client/src/apis/account_application_information.rs @@ -24,7 +24,6 @@ use crate::models::{AccountApplicationInformation, ErrorResponse}; /// struct for typed errors of method [`account_application_information`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AccountApplicationInformationError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/account_asset_information.rs b/crates/algod_client/src/apis/account_asset_information.rs index e2f5b6b2e..c388639ce 100644 --- a/crates/algod_client/src/apis/account_asset_information.rs +++ b/crates/algod_client/src/apis/account_asset_information.rs @@ -24,7 +24,6 @@ use crate::models::{AccountAssetInformation, ErrorResponse}; /// struct for typed errors of method [`account_asset_information`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AccountAssetInformationError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/account_assets_information.rs b/crates/algod_client/src/apis/account_assets_information.rs index 3b8544cbc..81bc9c123 100644 --- a/crates/algod_client/src/apis/account_assets_information.rs +++ b/crates/algod_client/src/apis/account_assets_information.rs @@ -22,7 +22,6 @@ use crate::models::{AccountAssetsInformation, ErrorResponse}; /// struct for typed errors of method [`account_assets_information`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AccountAssetsInformationError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/account_information.rs b/crates/algod_client/src/apis/account_information.rs index db101b61c..d7817b299 100644 --- a/crates/algod_client/src/apis/account_information.rs +++ b/crates/algod_client/src/apis/account_information.rs @@ -24,7 +24,6 @@ use crate::models::{Account, ErrorResponse}; /// struct for typed errors of method [`account_information`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AccountInformationError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/add_participation_key.rs b/crates/algod_client/src/apis/add_participation_key.rs index 945bf0a4a..46d3c4b54 100644 --- a/crates/algod_client/src/apis/add_participation_key.rs +++ b/crates/algod_client/src/apis/add_participation_key.rs @@ -23,7 +23,6 @@ use crate::models::{AddParticipationKey, ErrorResponse}; /// struct for typed errors of method [`add_participation_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AddParticipationKeyError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/append_keys.rs b/crates/algod_client/src/apis/append_keys.rs index 599b1b99a..e29e8c768 100644 --- a/crates/algod_client/src/apis/append_keys.rs +++ b/crates/algod_client/src/apis/append_keys.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, ParticipationKey}; /// struct for typed errors of method [`append_keys`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AppendKeysError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/client.rs b/crates/algod_client/src/apis/client.rs index e4c08d1a2..8606665ef 100644 --- a/crates/algod_client/src/apis/client.rs +++ b/crates/algod_client/src/apis/client.rs @@ -14,7 +14,7 @@ use super::Error; use super::parameter_enums::*; use crate::models::{ AbortCatchup, Account, AccountApplicationInformation, AccountAssetInformation, - AccountAssetsInformation, AddParticipationKey, Application, Asset, Box, DebugSettingsProf, + AccountAssetsInformation, AddParticipationKey, Application, Asset, DebugSettingsProf, DryrunRequest, ErrorResponse, Genesis, GetApplicationBoxes, GetBlock, GetBlockHash, GetBlockLogs, GetBlockTimeStampOffset, GetBlockTxids, GetPendingTransactions, GetPendingTransactionsByAddress, GetStatus, GetSupply, GetSyncRound, @@ -32,22 +32,18 @@ use std::sync::Arc; /// It wraps the lower-level endpoint functions with a more ergonomic interface. /// All methods return a unified `Error` type that can represent any endpoint error. #[derive(Clone)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Object))] pub struct AlgodClient { http_client: Arc, } -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] impl AlgodClient { /// Create a new AlgodClient with a custom http client. - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn new(http_client: Arc) -> Self { Self { http_client } } /// Create a new AlgodClient for Algorand TestNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn testnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new( "https://testnet-api.4160.nodely.dev", @@ -57,7 +53,6 @@ impl AlgodClient { /// Create a new AlgodClient for Algorand MainNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn mainnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new( "https://mainnet-api.4160.nodely.dev", @@ -67,7 +62,6 @@ impl AlgodClient { /// Create a new AlgodClient for a local localnet environment. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn localnet() -> Self { let http_client = Arc::new( DefaultHttpClient::with_header( @@ -79,71 +73,51 @@ impl AlgodClient { ); Self::new(http_client) } +} +impl AlgodClient { /// Returns OK if healthy. pub async fn health_check(&self) -> Result<(), Error> { - let result = super::health_check::health_check(self.http_client.as_ref()).await; - - result + super::health_check::health_check(self.http_client.as_ref()).await } /// Returns OK if healthy and fully caught up. pub async fn get_ready(&self) -> Result<(), Error> { - let result = super::get_ready::get_ready(self.http_client.as_ref()).await; - - result + super::get_ready::get_ready(self.http_client.as_ref()).await } /// Return metrics about algod functioning. pub async fn metrics(&self) -> Result<(), Error> { - let result = super::metrics::metrics(self.http_client.as_ref()).await; - - result + super::metrics::metrics(self.http_client.as_ref()).await } /// Gets the genesis information. pub async fn get_genesis(&self) -> Result { - let result = super::get_genesis::get_genesis(self.http_client.as_ref()).await; - - result + super::get_genesis::get_genesis(self.http_client.as_ref()).await } /// Gets the current swagger spec. pub async fn swagger_json(&self) -> Result { - let result = super::swagger_json::swagger_json(self.http_client.as_ref()).await; - - result + super::swagger_json::swagger_json(self.http_client.as_ref()).await } /// Retrieves the supported API versions, binary build versions, and genesis information. pub async fn get_version(&self) -> Result { - let result = super::get_version::get_version(self.http_client.as_ref()).await; - - result + super::get_version::get_version(self.http_client.as_ref()).await } /// Retrieves the current settings for blocking and mutex profiles pub async fn get_debug_settings_prof(&self) -> Result { - let result = - super::get_debug_settings_prof::get_debug_settings_prof(self.http_client.as_ref()) - .await; - - result + super::get_debug_settings_prof::get_debug_settings_prof(self.http_client.as_ref()).await } /// Enables blocking and mutex profiles, and returns the old settings pub async fn put_debug_settings_prof(&self) -> Result { - let result = - super::put_debug_settings_prof::put_debug_settings_prof(self.http_client.as_ref()) - .await; - - result + super::put_debug_settings_prof::put_debug_settings_prof(self.http_client.as_ref()).await } /// Gets the merged config file. pub async fn get_config(&self) -> Result { - let result = super::get_config::get_config(self.http_client.as_ref()).await; - - result + super::get_config::get_config(self.http_client.as_ref()).await } /// Get account information. @@ -153,15 +127,13 @@ impl AlgodClient { exclude: Option, format: Option, ) -> Result { - let result = super::account_information::account_information( + super::account_information::account_information( self.http_client.as_ref(), address, exclude, format, ) - .await; - - result + .await } /// Get account information about a given asset. @@ -171,15 +143,29 @@ impl AlgodClient { asset_id: u64, format: Option, ) -> Result { - let result = super::account_asset_information::account_asset_information( + super::account_asset_information::account_asset_information( self.http_client.as_ref(), address, asset_id, format, ) - .await; + .await + } - result + /// Get a list of assets held by an account, inclusive of asset params. + pub async fn account_assets_information( + &self, + address: &str, + limit: Option, + next: Option<&str>, + ) -> Result { + super::account_assets_information::account_assets_information( + self.http_client.as_ref(), + address, + limit, + next, + ) + .await } /// Get account information about a given app. @@ -189,15 +175,13 @@ impl AlgodClient { application_id: u64, format: Option, ) -> Result { - let result = super::account_application_information::account_application_information( + super::account_application_information::account_application_information( self.http_client.as_ref(), address, application_id, format, ) - .await; - - result + .await } /// Get a list of unconfirmed transactions currently in the transaction pool by address. @@ -206,15 +190,12 @@ impl AlgodClient { address: &str, max: Option, ) -> Result { - let result = - super::get_pending_transactions_by_address::get_pending_transactions_by_address( - self.http_client.as_ref(), - address, - max, - ) - .await; - - result + super::get_pending_transactions_by_address::get_pending_transactions_by_address( + self.http_client.as_ref(), + address, + max, + ) + .await } /// Get the block for the given round. @@ -223,25 +204,17 @@ impl AlgodClient { round: u64, header_only: Option, ) -> Result { - let result = - super::get_block::get_block(self.http_client.as_ref(), round, header_only).await; - - result + super::get_block::get_block(self.http_client.as_ref(), round, header_only).await } /// Get the top level transaction IDs for the block on the given round. pub async fn get_block_txids(&self, round: u64) -> Result { - let result = - super::get_block_txids::get_block_txids(self.http_client.as_ref(), round).await; - - result + super::get_block_txids::get_block_txids(self.http_client.as_ref(), round).await } /// Get the block hash for the block on the given round. pub async fn get_block_hash(&self, round: u64) -> Result { - let result = super::get_block_hash::get_block_hash(self.http_client.as_ref(), round).await; - - result + super::get_block_hash::get_block_hash(self.http_client.as_ref(), round).await } /// Get a proof for a transaction in a block. @@ -252,38 +225,29 @@ impl AlgodClient { hashtype: Option, format: Option, ) -> Result { - let result = super::get_transaction_proof::get_transaction_proof( + super::get_transaction_proof::get_transaction_proof( self.http_client.as_ref(), round, txid, hashtype, format, ) - .await; - - result + .await } /// Get all of the logs from outer and inner app calls in the given round pub async fn get_block_logs(&self, round: u64) -> Result { - let result = super::get_block_logs::get_block_logs(self.http_client.as_ref(), round).await; - - result + super::get_block_logs::get_block_logs(self.http_client.as_ref(), round).await } /// Get the current supply reported by the ledger. pub async fn get_supply(&self) -> Result { - let result = super::get_supply::get_supply(self.http_client.as_ref()).await; - - result + super::get_supply::get_supply(self.http_client.as_ref()).await } /// Return a list of participation keys pub async fn get_participation_keys(&self) -> Result, Error> { - let result = - super::get_participation_keys::get_participation_keys(self.http_client.as_ref()).await; - - result + super::get_participation_keys::get_participation_keys(self.http_client.as_ref()).await } /// Add a participation key to the node @@ -291,11 +255,8 @@ impl AlgodClient { &self, request: Vec, ) -> Result { - let result = - super::add_participation_key::add_participation_key(self.http_client.as_ref(), request) - .await; - - result + super::add_participation_key::add_participation_key(self.http_client.as_ref(), request) + .await } /// Generate and install participation keys to the node. @@ -306,16 +267,14 @@ impl AlgodClient { first: u64, last: u64, ) -> Result { - let result = super::generate_participation_keys::generate_participation_keys( + super::generate_participation_keys::generate_participation_keys( self.http_client.as_ref(), address, dilution, first, last, ) - .await; - - result + .await } /// Get participation key info given a participation ID @@ -323,13 +282,11 @@ impl AlgodClient { &self, participation_id: &str, ) -> Result { - let result = super::get_participation_key_by_id::get_participation_key_by_id( + super::get_participation_key_by_id::get_participation_key_by_id( self.http_client.as_ref(), participation_id, ) - .await; - - result + .await } /// Append state proof keys to a participation key @@ -338,11 +295,7 @@ impl AlgodClient { request: Vec, participation_id: &str, ) -> Result { - let result = - super::append_keys::append_keys(self.http_client.as_ref(), request, participation_id) - .await; - - result + super::append_keys::append_keys(self.http_client.as_ref(), request, participation_id).await } /// Delete a given participation key by ID @@ -350,63 +303,37 @@ impl AlgodClient { &self, participation_id: &str, ) -> Result<(), Error> { - let result = super::delete_participation_key_by_id::delete_participation_key_by_id( + super::delete_participation_key_by_id::delete_participation_key_by_id( self.http_client.as_ref(), participation_id, ) - .await; - - result + .await } /// Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. pub async fn shutdown_node(&self, timeout: Option) -> Result { - let result = super::shutdown_node::shutdown_node(self.http_client.as_ref(), timeout).await; - - #[cfg(feature = "ffi_uniffi")] - { - result.map(|v| { - serde_json::to_string(&v).map_err(|e| Error::Serde { - message: e.to_string(), - }) - })? - } - - #[cfg(not(feature = "ffi_uniffi"))] - { - result - } + super::shutdown_node::shutdown_node(self.http_client.as_ref(), timeout).await } /// Gets the current node status. pub async fn get_status(&self) -> Result { - let result = super::get_status::get_status(self.http_client.as_ref()).await; - - result + super::get_status::get_status(self.http_client.as_ref()).await } /// Gets the node status after waiting for a round after the given round. pub async fn wait_for_block(&self, round: u64) -> Result { - let result = super::wait_for_block::wait_for_block(self.http_client.as_ref(), round).await; - - result + super::wait_for_block::wait_for_block(self.http_client.as_ref(), round).await } /// Broadcasts a raw transaction or transaction group to the network. pub async fn raw_transaction(&self, request: Vec) -> Result { - let result = - super::raw_transaction::raw_transaction(self.http_client.as_ref(), request).await; - - result + super::raw_transaction::raw_transaction(self.http_client.as_ref(), request).await } /// Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. pub async fn raw_transaction_async(&self, request: Vec) -> Result<(), Error> { - let result = - super::raw_transaction_async::raw_transaction_async(self.http_client.as_ref(), request) - .await; - - result + super::raw_transaction_async::raw_transaction_async(self.http_client.as_ref(), request) + .await } /// Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. @@ -415,21 +342,17 @@ impl AlgodClient { request: SimulateRequest, format: Option, ) -> Result { - let result = super::simulate_transaction::simulate_transaction( + super::simulate_transaction::simulate_transaction( self.http_client.as_ref(), request, format, ) - .await; - - result + .await } /// Get parameters for constructing a new transaction pub async fn transaction_params(&self) -> Result { - let result = super::transaction_params::transaction_params(self.http_client.as_ref()).await; - - result + super::transaction_params::transaction_params(self.http_client.as_ref()).await } /// Get a list of unconfirmed transactions currently in the transaction pool. @@ -437,13 +360,8 @@ impl AlgodClient { &self, max: Option, ) -> Result { - let result = super::get_pending_transactions::get_pending_transactions( - self.http_client.as_ref(), - max, - ) - .await; - - result + super::get_pending_transactions::get_pending_transactions(self.http_client.as_ref(), max) + .await } /// Get a specific pending transaction. @@ -451,22 +369,17 @@ impl AlgodClient { &self, txid: &str, ) -> Result { - let result = super::pending_transaction_information::pending_transaction_information( + super::pending_transaction_information::pending_transaction_information( self.http_client.as_ref(), txid, ) - .await; - - result + .await } /// Get a LedgerStateDelta object for a given round pub async fn get_ledger_state_delta(&self, round: u64) -> Result { - let result = - super::get_ledger_state_delta::get_ledger_state_delta(self.http_client.as_ref(), round) - .await; - - result + super::get_ledger_state_delta::get_ledger_state_delta(self.http_client.as_ref(), round) + .await } /// Get LedgerStateDelta objects for all transaction groups in a given round @@ -474,12 +387,10 @@ impl AlgodClient { &self, round: u64, ) -> Result { - let result = super::get_transaction_group_ledger_state_deltas_for_round::get_transaction_group_ledger_state_deltas_for_round( + super::get_transaction_group_ledger_state_deltas_for_round::get_transaction_group_ledger_state_deltas_for_round( self.http_client.as_ref(), round, - ).await; - - result + ).await } /// Get a LedgerStateDelta object for a given transaction group @@ -487,20 +398,15 @@ impl AlgodClient { &self, id: &str, ) -> Result { - let result = super::get_ledger_state_delta_for_transaction_group::get_ledger_state_delta_for_transaction_group( + super::get_ledger_state_delta_for_transaction_group::get_ledger_state_delta_for_transaction_group( self.http_client.as_ref(), id, - ).await; - - result + ).await } /// Get a state proof that covers a given round pub async fn get_state_proof(&self, round: u64) -> Result { - let result = - super::get_state_proof::get_state_proof(self.http_client.as_ref(), round).await; - - result + super::get_state_proof::get_state_proof(self.http_client.as_ref(), round).await } /// Gets a proof for a given light block header inside a state proof commitment @@ -508,24 +414,20 @@ impl AlgodClient { &self, round: u64, ) -> Result { - let result = super::get_light_block_header_proof::get_light_block_header_proof( + super::get_light_block_header_proof::get_light_block_header_proof( self.http_client.as_ref(), round, ) - .await; - - result + .await } /// Get application information. pub async fn get_application_by_id(&self, application_id: u64) -> Result { - let result = super::get_application_by_id::get_application_by_id( + super::get_application_by_id::get_application_by_id( self.http_client.as_ref(), application_id, ) - .await; - - result + .await } /// Get all box names for a given application. @@ -534,14 +436,12 @@ impl AlgodClient { application_id: u64, max: Option, ) -> Result { - let result = super::get_application_boxes::get_application_boxes( + super::get_application_boxes::get_application_boxes( self.http_client.as_ref(), application_id, max, ) - .await; - - result + .await } /// Get box information for a given application. @@ -550,43 +450,32 @@ impl AlgodClient { application_id: u64, name: &str, ) -> Result { - let result = super::get_application_box_by_name::get_application_box_by_name( + super::get_application_box_by_name::get_application_box_by_name( self.http_client.as_ref(), application_id, name, ) - .await; - - result + .await } /// Get asset information. pub async fn get_asset_by_id(&self, asset_id: u64) -> Result { - let result = - super::get_asset_by_id::get_asset_by_id(self.http_client.as_ref(), asset_id).await; - - result + super::get_asset_by_id::get_asset_by_id(self.http_client.as_ref(), asset_id).await } /// Returns the minimum sync round the ledger is keeping in cache. pub async fn get_sync_round(&self) -> Result { - let result = super::get_sync_round::get_sync_round(self.http_client.as_ref()).await; - - result + super::get_sync_round::get_sync_round(self.http_client.as_ref()).await } /// Removes minimum sync round restriction from the ledger. pub async fn unset_sync_round(&self) -> Result<(), Error> { - let result = super::unset_sync_round::unset_sync_round(self.http_client.as_ref()).await; - - result + super::unset_sync_round::unset_sync_round(self.http_client.as_ref()).await } /// Given a round, tells the ledger to keep that round in its cache. pub async fn set_sync_round(&self, round: u64) -> Result<(), Error> { - let result = super::set_sync_round::set_sync_round(self.http_client.as_ref(), round).await; - - result + super::set_sync_round::set_sync_round(self.http_client.as_ref(), round).await } /// Compile TEAL source code to binary, produce its hash @@ -595,18 +484,12 @@ impl AlgodClient { request: Vec, sourcemap: Option, ) -> Result { - let result = - super::teal_compile::teal_compile(self.http_client.as_ref(), request, sourcemap).await; - - result + super::teal_compile::teal_compile(self.http_client.as_ref(), request, sourcemap).await } /// Disassemble program bytes into the TEAL source code. pub async fn teal_disassemble(&self, request: String) -> Result { - let result = - super::teal_disassemble::teal_disassemble(self.http_client.as_ref(), request).await; - - result + super::teal_disassemble::teal_disassemble(self.http_client.as_ref(), request).await } /// Starts a catchpoint catchup. @@ -615,95 +498,36 @@ impl AlgodClient { catchpoint: &str, min: Option, ) -> Result { - let result = - super::start_catchup::start_catchup(self.http_client.as_ref(), catchpoint, min).await; - - result + super::start_catchup::start_catchup(self.http_client.as_ref(), catchpoint, min).await } /// Aborts a catchpoint catchup. pub async fn abort_catchup(&self, catchpoint: &str) -> Result { - let result = - super::abort_catchup::abort_catchup(self.http_client.as_ref(), catchpoint).await; - - result + super::abort_catchup::abort_catchup(self.http_client.as_ref(), catchpoint).await } /// Provide debugging information for a transaction (or group). pub async fn teal_dryrun(&self, request: Option) -> Result { - let result = super::teal_dryrun::teal_dryrun(self.http_client.as_ref(), request).await; - - result + super::teal_dryrun::teal_dryrun(self.http_client.as_ref(), request).await } /// Returns OK if experimental API is enabled. pub async fn experimental_check(&self) -> Result<(), Error> { - let result = super::experimental_check::experimental_check(self.http_client.as_ref()).await; - - result + super::experimental_check::experimental_check(self.http_client.as_ref()).await } /// Returns the timestamp offset. Timestamp offsets can only be set in dev mode. pub async fn get_block_time_stamp_offset(&self) -> Result { - let result = super::get_block_time_stamp_offset::get_block_time_stamp_offset( - self.http_client.as_ref(), - ) - .await; - - result + super::get_block_time_stamp_offset::get_block_time_stamp_offset(self.http_client.as_ref()) + .await } /// Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. pub async fn set_block_time_stamp_offset(&self, offset: u64) -> Result<(), Error> { - let result = super::set_block_time_stamp_offset::set_block_time_stamp_offset( + super::set_block_time_stamp_offset::set_block_time_stamp_offset( self.http_client.as_ref(), offset, ) - .await; - - result - } -} - -#[cfg(not(feature = "ffi_uniffi"))] -impl AlgodClient { - /// Get a list of assets held by an account, inclusive of asset params. - pub async fn account_assets_information( - &self, - address: &str, - limit: Option, - next: Option<&str>, - ) -> Result { - let result = super::account_assets_information::account_assets_information( - self.http_client.as_ref(), - address, - limit, - next, - ) - .await; - - result - } -} - -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] -#[cfg(feature = "ffi_uniffi")] -impl AlgodClient { - /// Get a list of assets held by an account, inclusive of asset params. - pub async fn account_assets_information( - &self, - address: &str, - limit: Option, - next: Option, - ) -> Result { - let result = super::account_assets_information::account_assets_information( - self.http_client.as_ref(), - address, - limit, - next.as_deref(), - ) - .await; - - result + .await } } diff --git a/crates/algod_client/src/apis/delete_participation_key_by_id.rs b/crates/algod_client/src/apis/delete_participation_key_by_id.rs index 5f363e175..78ff32820 100644 --- a/crates/algod_client/src/apis/delete_participation_key_by_id.rs +++ b/crates/algod_client/src/apis/delete_participation_key_by_id.rs @@ -22,7 +22,6 @@ use crate::models::ErrorResponse; /// struct for typed errors of method [`delete_participation_key_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum DeleteParticipationKeyByIdError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/experimental_check.rs b/crates/algod_client/src/apis/experimental_check.rs index fd606a55e..8e17e8b20 100644 --- a/crates/algod_client/src/apis/experimental_check.rs +++ b/crates/algod_client/src/apis/experimental_check.rs @@ -21,7 +21,6 @@ use super::{AlgodApiError, ContentType, Error}; /// struct for typed errors of method [`experimental_check`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ExperimentalCheckError { Status404(), Statusdefault(), diff --git a/crates/algod_client/src/apis/generate_participation_keys.rs b/crates/algod_client/src/apis/generate_participation_keys.rs index 315b23579..6eb597ba3 100644 --- a/crates/algod_client/src/apis/generate_participation_keys.rs +++ b/crates/algod_client/src/apis/generate_participation_keys.rs @@ -22,7 +22,6 @@ use crate::models::ErrorResponse; /// struct for typed errors of method [`generate_participation_keys`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GenerateParticipationKeysError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_application_box_by_name.rs b/crates/algod_client/src/apis/get_application_box_by_name.rs index b33772550..4c1ec575a 100644 --- a/crates/algod_client/src/apis/get_application_box_by_name.rs +++ b/crates/algod_client/src/apis/get_application_box_by_name.rs @@ -22,7 +22,6 @@ use crate::models::{Box, ErrorResponse}; /// struct for typed errors of method [`get_application_box_by_name`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetApplicationBoxByNameError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_application_boxes.rs b/crates/algod_client/src/apis/get_application_boxes.rs index 3360a499b..2fae8e524 100644 --- a/crates/algod_client/src/apis/get_application_boxes.rs +++ b/crates/algod_client/src/apis/get_application_boxes.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetApplicationBoxes}; /// struct for typed errors of method [`get_application_boxes`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetApplicationBoxesError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_application_by_id.rs b/crates/algod_client/src/apis/get_application_by_id.rs index 887ce7862..7a35c1f14 100644 --- a/crates/algod_client/src/apis/get_application_by_id.rs +++ b/crates/algod_client/src/apis/get_application_by_id.rs @@ -22,7 +22,6 @@ use crate::models::{Application, ErrorResponse}; /// struct for typed errors of method [`get_application_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetApplicationByIdError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_asset_by_id.rs b/crates/algod_client/src/apis/get_asset_by_id.rs index 09eb94a4d..2fb769320 100644 --- a/crates/algod_client/src/apis/get_asset_by_id.rs +++ b/crates/algod_client/src/apis/get_asset_by_id.rs @@ -22,7 +22,6 @@ use crate::models::{Asset, ErrorResponse}; /// struct for typed errors of method [`get_asset_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetAssetByIdError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_block.rs b/crates/algod_client/src/apis/get_block.rs index 2c8bc54d0..97c8f5641 100644 --- a/crates/algod_client/src/apis/get_block.rs +++ b/crates/algod_client/src/apis/get_block.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, GetBlock}; /// struct for typed errors of method [`get_block`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetBlockError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_block_hash.rs b/crates/algod_client/src/apis/get_block_hash.rs index d460be64e..70076df72 100644 --- a/crates/algod_client/src/apis/get_block_hash.rs +++ b/crates/algod_client/src/apis/get_block_hash.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetBlockHash}; /// struct for typed errors of method [`get_block_hash`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetBlockHashError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_block_logs.rs b/crates/algod_client/src/apis/get_block_logs.rs index ba7bd6053..d48341575 100644 --- a/crates/algod_client/src/apis/get_block_logs.rs +++ b/crates/algod_client/src/apis/get_block_logs.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetBlockLogs}; /// struct for typed errors of method [`get_block_logs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetBlockLogsError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_block_time_stamp_offset.rs b/crates/algod_client/src/apis/get_block_time_stamp_offset.rs index 00e8d50ac..3ee305b91 100644 --- a/crates/algod_client/src/apis/get_block_time_stamp_offset.rs +++ b/crates/algod_client/src/apis/get_block_time_stamp_offset.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetBlockTimeStampOffset}; /// struct for typed errors of method [`get_block_time_stamp_offset`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetBlockTimeStampOffsetError { Status400(ErrorResponse), Statusdefault(), diff --git a/crates/algod_client/src/apis/get_block_txids.rs b/crates/algod_client/src/apis/get_block_txids.rs index fa76e97ee..53cceed9d 100644 --- a/crates/algod_client/src/apis/get_block_txids.rs +++ b/crates/algod_client/src/apis/get_block_txids.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetBlockTxids}; /// struct for typed errors of method [`get_block_txids`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetBlockTxidsError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_config.rs b/crates/algod_client/src/apis/get_config.rs index 0faf901e5..48aad6b4f 100644 --- a/crates/algod_client/src/apis/get_config.rs +++ b/crates/algod_client/src/apis/get_config.rs @@ -21,7 +21,6 @@ use super::{AlgodApiError, ContentType, Error}; /// struct for typed errors of method [`get_config`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetConfigError { Statusdefault(), DefaultResponse(), diff --git a/crates/algod_client/src/apis/get_debug_settings_prof.rs b/crates/algod_client/src/apis/get_debug_settings_prof.rs index 4472f5d6f..b5f6d5952 100644 --- a/crates/algod_client/src/apis/get_debug_settings_prof.rs +++ b/crates/algod_client/src/apis/get_debug_settings_prof.rs @@ -22,7 +22,6 @@ use crate::models::DebugSettingsProf; /// struct for typed errors of method [`get_debug_settings_prof`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetDebugSettingsProfError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/algod_client/src/apis/get_genesis.rs b/crates/algod_client/src/apis/get_genesis.rs index 8806f71c0..937986bef 100644 --- a/crates/algod_client/src/apis/get_genesis.rs +++ b/crates/algod_client/src/apis/get_genesis.rs @@ -22,7 +22,6 @@ use crate::models::Genesis; /// struct for typed errors of method [`get_genesis`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetGenesisError { Statusdefault(), DefaultResponse(), diff --git a/crates/algod_client/src/apis/get_ledger_state_delta.rs b/crates/algod_client/src/apis/get_ledger_state_delta.rs index ff4afeb31..8587f6b43 100644 --- a/crates/algod_client/src/apis/get_ledger_state_delta.rs +++ b/crates/algod_client/src/apis/get_ledger_state_delta.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, LedgerStateDelta}; /// struct for typed errors of method [`get_ledger_state_delta`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetLedgerStateDeltaError { Status401(ErrorResponse), Status404(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_ledger_state_delta_for_transaction_group.rs b/crates/algod_client/src/apis/get_ledger_state_delta_for_transaction_group.rs index cf2a5ba01..1a9ffdb15 100644 --- a/crates/algod_client/src/apis/get_ledger_state_delta_for_transaction_group.rs +++ b/crates/algod_client/src/apis/get_ledger_state_delta_for_transaction_group.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, LedgerStateDelta}; /// struct for typed errors of method [`get_ledger_state_delta_for_transaction_group`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetLedgerStateDeltaForTransactionGroupError { Status401(ErrorResponse), Status404(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_light_block_header_proof.rs b/crates/algod_client/src/apis/get_light_block_header_proof.rs index 518464bb2..3509a332b 100644 --- a/crates/algod_client/src/apis/get_light_block_header_proof.rs +++ b/crates/algod_client/src/apis/get_light_block_header_proof.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, LightBlockHeaderProof}; /// struct for typed errors of method [`get_light_block_header_proof`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetLightBlockHeaderProofError { Status401(ErrorResponse), Status404(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_participation_key_by_id.rs b/crates/algod_client/src/apis/get_participation_key_by_id.rs index 6deb16caa..d956ee99c 100644 --- a/crates/algod_client/src/apis/get_participation_key_by_id.rs +++ b/crates/algod_client/src/apis/get_participation_key_by_id.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, ParticipationKey}; /// struct for typed errors of method [`get_participation_key_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetParticipationKeyByIdError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_participation_keys.rs b/crates/algod_client/src/apis/get_participation_keys.rs index 07578a587..3d4b1c96d 100644 --- a/crates/algod_client/src/apis/get_participation_keys.rs +++ b/crates/algod_client/src/apis/get_participation_keys.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, ParticipationKey}; /// struct for typed errors of method [`get_participation_keys`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetParticipationKeysError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_pending_transactions.rs b/crates/algod_client/src/apis/get_pending_transactions.rs index c1118f8b0..509c6062e 100644 --- a/crates/algod_client/src/apis/get_pending_transactions.rs +++ b/crates/algod_client/src/apis/get_pending_transactions.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, GetPendingTransactions}; /// struct for typed errors of method [`get_pending_transactions`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetPendingTransactionsError { Status401(ErrorResponse), Status500(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_pending_transactions_by_address.rs b/crates/algod_client/src/apis/get_pending_transactions_by_address.rs index 0deb96514..2ef0841c2 100644 --- a/crates/algod_client/src/apis/get_pending_transactions_by_address.rs +++ b/crates/algod_client/src/apis/get_pending_transactions_by_address.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, GetPendingTransactionsByAddress}; /// struct for typed errors of method [`get_pending_transactions_by_address`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetPendingTransactionsByAddressError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_ready.rs b/crates/algod_client/src/apis/get_ready.rs index cafa1cdea..22891a864 100644 --- a/crates/algod_client/src/apis/get_ready.rs +++ b/crates/algod_client/src/apis/get_ready.rs @@ -21,7 +21,6 @@ use super::{AlgodApiError, ContentType, Error}; /// struct for typed errors of method [`get_ready`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetReadyError { Status500(), Status503(), diff --git a/crates/algod_client/src/apis/get_state_proof.rs b/crates/algod_client/src/apis/get_state_proof.rs index 7c19ca433..894cb3fd0 100644 --- a/crates/algod_client/src/apis/get_state_proof.rs +++ b/crates/algod_client/src/apis/get_state_proof.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, StateProof}; /// struct for typed errors of method [`get_state_proof`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetStateProofError { Status401(ErrorResponse), Status404(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_status.rs b/crates/algod_client/src/apis/get_status.rs index 5e2107486..e646aa477 100644 --- a/crates/algod_client/src/apis/get_status.rs +++ b/crates/algod_client/src/apis/get_status.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetStatus}; /// struct for typed errors of method [`get_status`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetStatusError { Status401(ErrorResponse), Status500(String), diff --git a/crates/algod_client/src/apis/get_supply.rs b/crates/algod_client/src/apis/get_supply.rs index 5f046f9bd..06bb4d808 100644 --- a/crates/algod_client/src/apis/get_supply.rs +++ b/crates/algod_client/src/apis/get_supply.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetSupply}; /// struct for typed errors of method [`get_supply`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetSupplyError { Status401(ErrorResponse), Statusdefault(), diff --git a/crates/algod_client/src/apis/get_sync_round.rs b/crates/algod_client/src/apis/get_sync_round.rs index ef55e11ab..4cce19d63 100644 --- a/crates/algod_client/src/apis/get_sync_round.rs +++ b/crates/algod_client/src/apis/get_sync_round.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, GetSyncRound}; /// struct for typed errors of method [`get_sync_round`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetSyncRoundError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs b/crates/algod_client/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs index 5c3247eb7..03b34a96e 100644 --- a/crates/algod_client/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs +++ b/crates/algod_client/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, GetTransactionGroupLedgerStateDeltasForRound} /// struct for typed errors of method [`get_transaction_group_ledger_state_deltas_for_round`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetTransactionGroupLedgerStateDeltasForRoundError { Status401(ErrorResponse), Status404(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_transaction_proof.rs b/crates/algod_client/src/apis/get_transaction_proof.rs index 9e7558e55..7908632f5 100644 --- a/crates/algod_client/src/apis/get_transaction_proof.rs +++ b/crates/algod_client/src/apis/get_transaction_proof.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, TransactionProof}; /// struct for typed errors of method [`get_transaction_proof`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetTransactionProofError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/get_version.rs b/crates/algod_client/src/apis/get_version.rs index 5dcae6e3a..412ed5dd2 100644 --- a/crates/algod_client/src/apis/get_version.rs +++ b/crates/algod_client/src/apis/get_version.rs @@ -22,7 +22,6 @@ use crate::models::Version; /// struct for typed errors of method [`get_version`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetVersionError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/algod_client/src/apis/health_check.rs b/crates/algod_client/src/apis/health_check.rs index fb1b02986..14ba454e8 100644 --- a/crates/algod_client/src/apis/health_check.rs +++ b/crates/algod_client/src/apis/health_check.rs @@ -21,7 +21,6 @@ use super::{AlgodApiError, ContentType, Error}; /// struct for typed errors of method [`health_check`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum HealthCheckError { Statusdefault(), DefaultResponse(), diff --git a/crates/algod_client/src/apis/metrics.rs b/crates/algod_client/src/apis/metrics.rs index 4753b03d0..d61cf1d7d 100644 --- a/crates/algod_client/src/apis/metrics.rs +++ b/crates/algod_client/src/apis/metrics.rs @@ -21,7 +21,6 @@ use super::{AlgodApiError, ContentType, Error}; /// struct for typed errors of method [`metrics`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum MetricsError { Status404(), DefaultResponse(), diff --git a/crates/algod_client/src/apis/mod.rs b/crates/algod_client/src/apis/mod.rs index 320f6e7ef..163e199c7 100644 --- a/crates/algod_client/src/apis/mod.rs +++ b/crates/algod_client/src/apis/mod.rs @@ -75,7 +75,6 @@ use snafu::Snafu; /// Unified error type that can represent any API error from any endpoint #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum AlgodApiError { #[snafu(display("Health_check error: {error:?}"))] HealthCheck { error: health_check::HealthCheckError }, @@ -531,7 +530,6 @@ impl From for AlgodAp /// The main error type for all algod client operations #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum Error { #[snafu(display("HTTP error: {source}"))] Http { @@ -565,13 +563,13 @@ impl From<&str> for ContentType { } } +// Re-export the consolidated client +pub use client::AlgodClient; + pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } -// Re-export the consolidated client -pub use client::AlgodClient; - // Re-export parameter enums pub use parameter_enums::*; diff --git a/crates/algod_client/src/apis/parameter_enums.rs b/crates/algod_client/src/apis/parameter_enums.rs index d3ee23246..307e94526 100644 --- a/crates/algod_client/src/apis/parameter_enums.rs +++ b/crates/algod_client/src/apis/parameter_enums.rs @@ -13,7 +13,6 @@ use std::str::FromStr; /// When set to `all` will exclude asset holdings, application local state, created asset parameters, any created application parameters. Defaults to `none`. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum Exclude { /// all All, @@ -46,7 +45,6 @@ impl FromStr for Exclude { /// Configures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum Format { /// json Json, @@ -81,7 +79,6 @@ impl FromStr for Format { /// * sha256 #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum Hashtype { /// sha512_256 Sha512256, diff --git a/crates/algod_client/src/apis/pending_transaction_information.rs b/crates/algod_client/src/apis/pending_transaction_information.rs index 9daba2cbc..46eca91e8 100644 --- a/crates/algod_client/src/apis/pending_transaction_information.rs +++ b/crates/algod_client/src/apis/pending_transaction_information.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, PendingTransactionResponse}; /// struct for typed errors of method [`pending_transaction_information`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum PendingTransactionInformationError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/put_debug_settings_prof.rs b/crates/algod_client/src/apis/put_debug_settings_prof.rs index 5865a137a..8228093a2 100644 --- a/crates/algod_client/src/apis/put_debug_settings_prof.rs +++ b/crates/algod_client/src/apis/put_debug_settings_prof.rs @@ -22,7 +22,6 @@ use crate::models::DebugSettingsProf; /// struct for typed errors of method [`put_debug_settings_prof`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum PutDebugSettingsProfError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/algod_client/src/apis/raw_transaction.rs b/crates/algod_client/src/apis/raw_transaction.rs index d6db67f9e..f66853d88 100644 --- a/crates/algod_client/src/apis/raw_transaction.rs +++ b/crates/algod_client/src/apis/raw_transaction.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, RawTransaction}; /// struct for typed errors of method [`raw_transaction`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum RawTransactionError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/raw_transaction_async.rs b/crates/algod_client/src/apis/raw_transaction_async.rs index 1597dc865..69adec090 100644 --- a/crates/algod_client/src/apis/raw_transaction_async.rs +++ b/crates/algod_client/src/apis/raw_transaction_async.rs @@ -23,7 +23,6 @@ use crate::models::ErrorResponse; /// struct for typed errors of method [`raw_transaction_async`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum RawTransactionAsyncError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/set_block_time_stamp_offset.rs b/crates/algod_client/src/apis/set_block_time_stamp_offset.rs index b355db5cf..89ca82d6f 100644 --- a/crates/algod_client/src/apis/set_block_time_stamp_offset.rs +++ b/crates/algod_client/src/apis/set_block_time_stamp_offset.rs @@ -22,7 +22,6 @@ use crate::models::ErrorResponse; /// struct for typed errors of method [`set_block_time_stamp_offset`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SetBlockTimeStampOffsetError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/set_sync_round.rs b/crates/algod_client/src/apis/set_sync_round.rs index fe1107891..b4b5d227d 100644 --- a/crates/algod_client/src/apis/set_sync_round.rs +++ b/crates/algod_client/src/apis/set_sync_round.rs @@ -22,7 +22,6 @@ use crate::models::ErrorResponse; /// struct for typed errors of method [`set_sync_round`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SetSyncRoundError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/shutdown_node.rs b/crates/algod_client/src/apis/shutdown_node.rs index 5daa64a2f..17738a776 100644 --- a/crates/algod_client/src/apis/shutdown_node.rs +++ b/crates/algod_client/src/apis/shutdown_node.rs @@ -22,7 +22,6 @@ use crate::models::UnknownJsonValue; /// struct for typed errors of method [`shutdown_node`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ShutdownNodeError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/algod_client/src/apis/simulate_transaction.rs b/crates/algod_client/src/apis/simulate_transaction.rs index 1098ee697..e1efe3a5b 100644 --- a/crates/algod_client/src/apis/simulate_transaction.rs +++ b/crates/algod_client/src/apis/simulate_transaction.rs @@ -25,7 +25,6 @@ use crate::models::SimulateRequest; /// struct for typed errors of method [`simulate_transaction`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SimulateTransactionError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/start_catchup.rs b/crates/algod_client/src/apis/start_catchup.rs index 2e2410a75..935a4c5b9 100644 --- a/crates/algod_client/src/apis/start_catchup.rs +++ b/crates/algod_client/src/apis/start_catchup.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, StartCatchup}; /// struct for typed errors of method [`start_catchup`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum StartCatchupError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/swagger_json.rs b/crates/algod_client/src/apis/swagger_json.rs index 0f3575ec7..13cf44047 100644 --- a/crates/algod_client/src/apis/swagger_json.rs +++ b/crates/algod_client/src/apis/swagger_json.rs @@ -21,7 +21,6 @@ use super::{AlgodApiError, ContentType, Error}; /// struct for typed errors of method [`swagger_json`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SwaggerJsonError { Statusdefault(), DefaultResponse(), diff --git a/crates/algod_client/src/apis/teal_compile.rs b/crates/algod_client/src/apis/teal_compile.rs index ae301ad96..cd1ad0c00 100644 --- a/crates/algod_client/src/apis/teal_compile.rs +++ b/crates/algod_client/src/apis/teal_compile.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, TealCompile}; /// struct for typed errors of method [`teal_compile`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum TealCompileError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/teal_disassemble.rs b/crates/algod_client/src/apis/teal_disassemble.rs index 444206591..3e99685d7 100644 --- a/crates/algod_client/src/apis/teal_disassemble.rs +++ b/crates/algod_client/src/apis/teal_disassemble.rs @@ -23,7 +23,6 @@ use crate::models::{ErrorResponse, TealDisassemble}; /// struct for typed errors of method [`teal_disassemble`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum TealDisassembleError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/teal_dryrun.rs b/crates/algod_client/src/apis/teal_dryrun.rs index 15f043893..de6d285a4 100644 --- a/crates/algod_client/src/apis/teal_dryrun.rs +++ b/crates/algod_client/src/apis/teal_dryrun.rs @@ -24,7 +24,6 @@ use crate::models::DryrunRequest; /// struct for typed errors of method [`teal_dryrun`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum TealDryrunError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/transaction_params.rs b/crates/algod_client/src/apis/transaction_params.rs index bac816555..40ef6b24d 100644 --- a/crates/algod_client/src/apis/transaction_params.rs +++ b/crates/algod_client/src/apis/transaction_params.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, TransactionParams}; /// struct for typed errors of method [`transaction_params`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum TransactionParamsError { Status401(ErrorResponse), Status500(ErrorResponse), diff --git a/crates/algod_client/src/apis/unset_sync_round.rs b/crates/algod_client/src/apis/unset_sync_round.rs index a1a112c2d..9d8b7cf7e 100644 --- a/crates/algod_client/src/apis/unset_sync_round.rs +++ b/crates/algod_client/src/apis/unset_sync_round.rs @@ -22,7 +22,6 @@ use crate::models::ErrorResponse; /// struct for typed errors of method [`unset_sync_round`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum UnsetSyncRoundError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/apis/wait_for_block.rs b/crates/algod_client/src/apis/wait_for_block.rs index 99a77a3bd..1b5febffe 100644 --- a/crates/algod_client/src/apis/wait_for_block.rs +++ b/crates/algod_client/src/apis/wait_for_block.rs @@ -22,7 +22,6 @@ use crate::models::{ErrorResponse, WaitForBlock}; /// struct for typed errors of method [`wait_for_block`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum WaitForBlockError { Status400(ErrorResponse), Status401(ErrorResponse), diff --git a/crates/algod_client/src/lib.rs b/crates/algod_client/src/lib.rs index 89b21599a..a8c5d822f 100644 --- a/crates/algod_client/src/lib.rs +++ b/crates/algod_client/src/lib.rs @@ -1,9 +1,6 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] -#[cfg(feature = "ffi_uniffi")] -uniffi::setup_scaffolding!(); - pub mod apis; pub mod models; pub mod msgpack_value_bytes; diff --git a/crates/algod_client/src/models/abort_catchup.rs b/crates/algod_client/src/models/abort_catchup.rs index d05911f55..d2bf9beb5 100644 --- a/crates/algod_client/src/models/abort_catchup.rs +++ b/crates/algod_client/src/models/abort_catchup.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// An catchpoint abort response. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AbortCatchup { /// Catchup abort response string #[serde(rename = "catchup-message")] diff --git a/crates/algod_client/src/models/account.rs b/crates/algod_client/src/models/account.rs index 8e466bb71..6799a6b9b 100644 --- a/crates/algod_client/src/models/account.rs +++ b/crates/algod_client/src/models/account.rs @@ -9,15 +9,10 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::AccountParticipation; use crate::models::Application; use crate::models::ApplicationLocalState; @@ -30,12 +25,11 @@ use crate::models::AssetHolding; /// Definition: /// data/basics/userBalance.go : AccountData #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Account { /// the account public key #[serde(rename = "address")] pub address: String, - /// \[algo\] total number of MicroAlgos in the account + /// [algo] total number of MicroAlgos in the account #[serde(rename = "amount")] pub amount: u64, /// MicroAlgo balance required by the account. @@ -46,7 +40,7 @@ pub struct Account { /// specifies the amount of MicroAlgos in the account, without the pending rewards. #[serde(rename = "amount-without-pending-rewards")] pub amount_without_pending_rewards: u64, - /// \[appl\] applications local data stored in this account. + /// [appl] applications local data stored in this account. /// /// Note the raw object uses `map[int] -> AppLocalState` for this type. #[serde(rename = "apps-local-state", skip_serializing_if = "Option::is_none")] @@ -56,13 +50,13 @@ pub struct Account { pub total_apps_opted_in: u64, #[serde(rename = "apps-total-schema", skip_serializing_if = "Option::is_none")] pub apps_total_schema: Option, - /// \[teap\] the sum of all extra application program pages for this account. + /// [teap] the sum of all extra application program pages for this account. #[serde( rename = "apps-total-extra-pages", skip_serializing_if = "Option::is_none" )] pub apps_total_extra_pages: Option, - /// \[asset\] assets held by this account. + /// [asset] assets held by this account. /// /// Note the raw object uses `map[int] -> AssetHolding` for this type. #[serde(rename = "assets", skip_serializing_if = "Option::is_none")] @@ -70,7 +64,7 @@ pub struct Account { /// The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. #[serde(rename = "total-assets-opted-in")] pub total_assets_opted_in: u64, - /// \[appp\] parameters of applications created by this account including app global data. + /// [appp] parameters of applications created by this account including app global data. /// /// Note: the raw account uses `map[int] -> AppParams` for this type. #[serde(rename = "created-apps", skip_serializing_if = "Option::is_none")] @@ -78,7 +72,7 @@ pub struct Account { /// The count of all apps (AppParams objects) created by this account. #[serde(rename = "total-created-apps")] pub total_created_apps: u64, - /// \[apar\] parameters of assets created by this account. + /// [apar] parameters of assets created by this account. /// /// Note: the raw account uses `map[int] -> Asset` for this type. #[serde(rename = "created-assets", skip_serializing_if = "Option::is_none")] @@ -86,10 +80,10 @@ pub struct Account { /// The count of all assets (AssetParams objects) created by this account. #[serde(rename = "total-created-assets")] pub total_created_assets: u64, - /// \[tbx\] The number of existing boxes created by this account's app. + /// [tbx] The number of existing boxes created by this account's app. #[serde(rename = "total-boxes", skip_serializing_if = "Option::is_none")] pub total_boxes: Option, - /// \[tbxb\] The total number of bytes used by this account's app's box keys and values. + /// [tbxb] The total number of bytes used by this account's app's box keys and values. #[serde(rename = "total-box-bytes", skip_serializing_if = "Option::is_none")] pub total_box_bytes: Option, #[serde(rename = "participation", skip_serializing_if = "Option::is_none")] @@ -100,16 +94,16 @@ pub struct Account { /// amount of MicroAlgos of pending rewards in this account. #[serde(rename = "pending-rewards")] pub pending_rewards: u64, - /// \[ebase\] used as part of the rewards computation. Only applicable to accounts which are participating. + /// [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. #[serde(rename = "reward-base", skip_serializing_if = "Option::is_none")] pub reward_base: Option, - /// \[ern\] total rewards of MicroAlgos the account has received, including pending rewards. + /// [ern] total rewards of MicroAlgos the account has received, including pending rewards. #[serde(rename = "rewards")] pub rewards: u64, /// The round for which this information is relevant. #[serde(rename = "round")] pub round: u64, - /// \[onl\] delegation status of the account's MicroAlgos + /// [onl] delegation status of the account's MicroAlgos /// * Offline - indicates that the associated account is delegated. /// * Online - indicates that the associated account used as part of the delegation pool. /// * NotParticipating - indicates that the associated account is neither a delegator nor a delegate. @@ -121,7 +115,7 @@ pub struct Account { /// * lsig #[serde(rename = "sig-type", skip_serializing_if = "Option::is_none")] pub sig_type: Option, - /// \[spend\] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. + /// [spend] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. #[serde(rename = "auth-addr", skip_serializing_if = "Option::is_none")] pub auth_addr: Option, /// The round in which this account last proposed the block. diff --git a/crates/algod_client/src/models/account_application_information.rs b/crates/algod_client/src/models/account_application_information.rs index f02a69776..0c58d12ad 100644 --- a/crates/algod_client/src/models/account_application_information.rs +++ b/crates/algod_client/src/models/account_application_information.rs @@ -9,21 +9,15 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationLocalState; use crate::models::ApplicationParams; /// AccountApplicationResponse describes the account's application local state and global state (AppLocalState and AppParams, if either exists) for a specific application ID. Global state will only be returned if the provided address is the application's creator. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountApplicationInformation { /// The round for which this information is relevant. #[serde(rename = "round")] diff --git a/crates/algod_client/src/models/account_asset_holding.rs b/crates/algod_client/src/models/account_asset_holding.rs index 0c52ab256..1bf1b6432 100644 --- a/crates/algod_client/src/models/account_asset_holding.rs +++ b/crates/algod_client/src/models/account_asset_holding.rs @@ -16,7 +16,6 @@ use crate::models::AssetParams; /// AccountAssetHolding describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountAssetHolding { #[serde(rename = "asset-holding")] pub asset_holding: AssetHolding, diff --git a/crates/algod_client/src/models/account_asset_information.rs b/crates/algod_client/src/models/account_asset_information.rs index 98c9eac06..b01767408 100644 --- a/crates/algod_client/src/models/account_asset_information.rs +++ b/crates/algod_client/src/models/account_asset_information.rs @@ -9,21 +9,15 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::AssetHolding; use crate::models::AssetParams; /// AccountAssetResponse describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. Asset parameters will only be returned if the provided address is the asset's creator. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountAssetInformation { /// The round for which this information is relevant. #[serde(rename = "round")] diff --git a/crates/algod_client/src/models/account_assets_information.rs b/crates/algod_client/src/models/account_assets_information.rs index 97fd72f27..c583c9499 100644 --- a/crates/algod_client/src/models/account_assets_information.rs +++ b/crates/algod_client/src/models/account_assets_information.rs @@ -15,7 +15,6 @@ use crate::models::AccountAssetHolding; /// AccountAssetsInformationResponse contains a list of assets held by an account. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountAssetsInformation { /// The round for which this information is relevant. #[serde(rename = "round")] diff --git a/crates/algod_client/src/models/account_participation.rs b/crates/algod_client/src/models/account_participation.rs index 8cd39bda9..423e1be86 100644 --- a/crates/algod_client/src/models/account_participation.rs +++ b/crates/algod_client/src/models/account_participation.rs @@ -9,39 +9,34 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; /// AccountParticipation describes the parameters used by this account in consensus protocol. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountParticipation { - /// \[sel\] Selection public key (if any) currently registered for this round. + /// [sel] Selection public key (if any) currently registered for this round. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "selection-participation-key")] pub selection_participation_key: Vec, - /// \[voteFst\] First round for which this participation is valid. + /// [voteFst] First round for which this participation is valid. #[serde(rename = "vote-first-valid")] pub vote_first_valid: u64, - /// \[voteKD\] Number of subkeys in each batch of participation keys. + /// [voteKD] Number of subkeys in each batch of participation keys. #[serde(rename = "vote-key-dilution")] pub vote_key_dilution: u64, - /// \[voteLst\] Last round for which this participation is valid. + /// [voteLst] Last round for which this participation is valid. #[serde(rename = "vote-last-valid")] pub vote_last_valid: u64, - /// \[vote\] root participation public key (if any) currently registered for this round. + /// [vote] root participation public key (if any) currently registered for this round. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "vote-participation-key")] pub vote_participation_key: Vec, - /// \[stprf\] Root of the state proof key (if any) + /// [stprf] Root of the state proof key (if any) #[serde_as(as = "Option")] #[serde(rename = "state-proof-key", skip_serializing_if = "Option::is_none")] pub state_proof_key: Option>, diff --git a/crates/algod_client/src/models/account_state_delta.rs b/crates/algod_client/src/models/account_state_delta.rs index b79583384..7774d662b 100644 --- a/crates/algod_client/src/models/account_state_delta.rs +++ b/crates/algod_client/src/models/account_state_delta.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::StateDelta; /// Application state delta. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountStateDelta { #[serde(rename = "address")] pub address: String, diff --git a/crates/algod_client/src/models/add_participation_key.rs b/crates/algod_client/src/models/add_participation_key.rs index 5d16abfbf..8928abbda 100644 --- a/crates/algod_client/src/models/add_participation_key.rs +++ b/crates/algod_client/src/models/add_participation_key.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Participation ID of the submission #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AddParticipationKey { /// encoding of the participation ID. #[serde(rename = "partId")] diff --git a/crates/algod_client/src/models/app_call_logs.rs b/crates/algod_client/src/models/app_call_logs.rs index 894a9ad53..73aff49a6 100644 --- a/crates/algod_client/src/models/app_call_logs.rs +++ b/crates/algod_client/src/models/app_call_logs.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// The logged messages from an app call along with the app ID and outer transaction ID. Logs appear in the same order that they were emitted. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AppCallLogs { /// An array of logs #[serde_as(as = "Vec")] diff --git a/crates/algod_client/src/models/application.rs b/crates/algod_client/src/models/application.rs index 340456406..3d13cd236 100644 --- a/crates/algod_client/src/models/application.rs +++ b/crates/algod_client/src/models/application.rs @@ -9,22 +9,16 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationParams; /// Application index and its parameters #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Application { - /// \[appidx\] application index. + /// [appidx] application index. #[serde(rename = "id")] pub id: u64, #[serde(rename = "params")] diff --git a/crates/algod_client/src/models/application_initial_states.rs b/crates/algod_client/src/models/application_initial_states.rs index aa3ffc1c2..b4db25756 100644 --- a/crates/algod_client/src/models/application_initial_states.rs +++ b/crates/algod_client/src/models/application_initial_states.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationKvStorage; /// An application's initial global/local/box states that were accessed during simulation. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationInitialStates { /// Application index. #[serde(rename = "id")] diff --git a/crates/algod_client/src/models/application_kv_storage.rs b/crates/algod_client/src/models/application_kv_storage.rs index 7f6b47514..6563ee17e 100644 --- a/crates/algod_client/src/models/application_kv_storage.rs +++ b/crates/algod_client/src/models/application_kv_storage.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::AvmKeyValue; /// An application's global/local/box state. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationKvStorage { /// Key-Value pairs representing application states. #[serde(rename = "kvs")] diff --git a/crates/algod_client/src/models/application_local_reference.rs b/crates/algod_client/src/models/application_local_reference.rs index e4bbe485f..8e8f34c86 100644 --- a/crates/algod_client/src/models/application_local_reference.rs +++ b/crates/algod_client/src/models/application_local_reference.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// References an account's local state for an application. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationLocalReference { /// Address of the account with the local state. #[serde(rename = "account")] diff --git a/crates/algod_client/src/models/application_local_state.rs b/crates/algod_client/src/models/application_local_state.rs index fb536e568..7c3368490 100644 --- a/crates/algod_client/src/models/application_local_state.rs +++ b/crates/algod_client/src/models/application_local_state.rs @@ -9,21 +9,15 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationStateSchema; use crate::models::TealKeyValueStore; /// Stores local state associated with an application. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationLocalState { /// The application which this local state is for. #[serde(rename = "id")] diff --git a/crates/algod_client/src/models/application_params.rs b/crates/algod_client/src/models/application_params.rs index fe18cb0f2..71d7cbb12 100644 --- a/crates/algod_client/src/models/application_params.rs +++ b/crates/algod_client/src/models/application_params.rs @@ -9,15 +9,11 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use crate::models::ApplicationStateSchema; use crate::models::TealKeyValueStore; @@ -25,20 +21,19 @@ use crate::models::TealKeyValueStore; /// Stores the global information associated with an application. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationParams { /// The address that created this application. This is the address where the parameters and global state for this application can be found. #[serde(rename = "creator")] pub creator: String, - /// \[approv\] approval program. + /// [approv] approval program. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "approval-program")] pub approval_program: Vec, - /// \[clearp\] approval program. + /// [clearp] approval program. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "clear-state-program")] pub clear_state_program: Vec, - /// \[epp\] the amount of extra program pages available to this app. + /// [epp] the amount of extra program pages available to this app. #[serde( rename = "extra-program-pages", skip_serializing_if = "Option::is_none" @@ -53,7 +48,7 @@ pub struct ApplicationParams { pub global_state_schema: Option, #[serde(rename = "global-state", skip_serializing_if = "Option::is_none")] pub global_state: Option, - /// \[v\] the number of updates to the application programs + /// [v] the number of updates to the application programs #[serde(rename = "version", skip_serializing_if = "Option::is_none")] pub version: Option, } diff --git a/crates/algod_client/src/models/application_state_operation.rs b/crates/algod_client/src/models/application_state_operation.rs index a931c646a..fd4e13a48 100644 --- a/crates/algod_client/src/models/application_state_operation.rs +++ b/crates/algod_client/src/models/application_state_operation.rs @@ -9,22 +9,17 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use crate::models::AvmValue; /// An operation against an application's global/local/box state. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationStateOperation { /// Operation type. Value `w` is **write**, `d` is **delete**. #[serde(rename = "operation")] diff --git a/crates/algod_client/src/models/application_state_schema.rs b/crates/algod_client/src/models/application_state_schema.rs index 0196910c9..10bc0a45c 100644 --- a/crates/algod_client/src/models/application_state_schema.rs +++ b/crates/algod_client/src/models/application_state_schema.rs @@ -9,23 +9,17 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// Specifies maximums on the number of each type that may be stored. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationStateSchema { - /// \[nui\] num of uints. + /// [nui] num of uints. #[serde(rename = "num-uint")] pub num_uint: u32, - /// \[nbs\] num of byte slices. + /// [nbs] num of byte slices. #[serde(rename = "num-byte-slice")] pub num_byte_slice: u32, } diff --git a/crates/algod_client/src/models/asset.rs b/crates/algod_client/src/models/asset.rs index 49c688e91..7af4cb9a6 100644 --- a/crates/algod_client/src/models/asset.rs +++ b/crates/algod_client/src/models/asset.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::AssetParams; /// Specifies both the unique identifier and the parameters for an asset #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Asset { /// unique asset identifier #[serde(rename = "index")] diff --git a/crates/algod_client/src/models/asset_holding.rs b/crates/algod_client/src/models/asset_holding.rs index dda49f78d..a710e8971 100644 --- a/crates/algod_client/src/models/asset_holding.rs +++ b/crates/algod_client/src/models/asset_holding.rs @@ -9,29 +9,23 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// Describes an asset held by an account. /// /// Definition: /// data/basics/userBalance.go : AssetHolding #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AssetHolding { - /// \[a\] number of units held. + /// [a] number of units held. #[serde(rename = "amount")] pub amount: u64, /// Asset ID of the holding. #[serde(rename = "asset-id")] pub asset_id: u64, - /// \[f\] whether or not the holding is frozen. + /// [f] whether or not the holding is frozen. #[serde(rename = "is-frozen")] pub is_frozen: bool, } diff --git a/crates/algod_client/src/models/asset_holding_reference.rs b/crates/algod_client/src/models/asset_holding_reference.rs index 61e9221f1..348a214ba 100644 --- a/crates/algod_client/src/models/asset_holding_reference.rs +++ b/crates/algod_client/src/models/asset_holding_reference.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// References an asset held by an account. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AssetHoldingReference { /// Address of the account holding the asset. #[serde(rename = "account")] diff --git a/crates/algod_client/src/models/asset_params.rs b/crates/algod_client/src/models/asset_params.rs index 0d3a668ea..23beae0d7 100644 --- a/crates/algod_client/src/models/asset_params.rs +++ b/crates/algod_client/src/models/asset_params.rs @@ -9,69 +9,64 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; /// AssetParams specifies the parameters for an asset. /// -/// \[apar\] when part of an AssetConfig transaction. +/// [apar] when part of an AssetConfig transaction. /// /// Definition: /// data/transactions/asset.go : AssetParams #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AssetParams { - /// \[c\] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted. + /// [c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted. #[serde(rename = "clawback", skip_serializing_if = "Option::is_none")] pub clawback: Option, /// The address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case. #[serde(rename = "creator")] pub creator: String, - /// \[dc\] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive). + /// [dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive). #[serde(rename = "decimals")] pub decimals: u64, - /// \[df\] Whether holdings of this asset are frozen by default. + /// [df] Whether holdings of this asset are frozen by default. #[serde(rename = "default-frozen", skip_serializing_if = "Option::is_none")] pub default_frozen: Option, - /// \[f\] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted. + /// [f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted. #[serde(rename = "freeze", skip_serializing_if = "Option::is_none")] pub freeze: Option, - /// \[m\] Address of account used to manage the keys of this asset and to destroy it. + /// [m] Address of account used to manage the keys of this asset and to destroy it. #[serde(rename = "manager", skip_serializing_if = "Option::is_none")] pub manager: Option, - /// \[am\] A commitment to some unspecified asset metadata. The format of this metadata is up to the application. + /// [am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application. #[serde_as(as = "Option")] #[serde(rename = "metadata-hash", skip_serializing_if = "Option::is_none")] pub metadata_hash: Option>, - /// \[an\] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters. + /// [an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, /// Base64 encoded name of this asset, as supplied by the creator. #[serde_as(as = "Option")] #[serde(rename = "name-b64", skip_serializing_if = "Option::is_none")] pub name_b64: Option>, - /// \[r\] Address of account holding reserve (non-minted) units of this asset. + /// [r] Address of account holding reserve (non-minted) units of this asset. #[serde(rename = "reserve", skip_serializing_if = "Option::is_none")] pub reserve: Option, - /// \[t\] The total number of units of this asset. + /// [t] The total number of units of this asset. #[serde(rename = "total")] pub total: u64, - /// \[un\] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters. + /// [un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters. #[serde(rename = "unit-name", skip_serializing_if = "Option::is_none")] pub unit_name: Option, /// Base64 encoded name of a unit of this asset, as supplied by the creator. #[serde_as(as = "Option")] #[serde(rename = "unit-name-b64", skip_serializing_if = "Option::is_none")] pub unit_name_b64: Option>, - /// \[au\] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters. + /// [au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters. #[serde(rename = "url", skip_serializing_if = "Option::is_none")] pub url: Option, /// Base64 encoded URL where more information about the asset can be retrieved. diff --git a/crates/algod_client/src/models/avm_key_value.rs b/crates/algod_client/src/models/avm_key_value.rs index 6252625b2..c3c320e06 100644 --- a/crates/algod_client/src/models/avm_key_value.rs +++ b/crates/algod_client/src/models/avm_key_value.rs @@ -9,22 +9,17 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use crate::models::AvmValue; /// Represents an AVM key-value pair in an application store. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AvmKeyValue { #[serde_as(as = "Bytes")] #[serde(rename = "key")] diff --git a/crates/algod_client/src/models/avm_value.rs b/crates/algod_client/src/models/avm_value.rs index afb51df54..7b04341f3 100644 --- a/crates/algod_client/src/models/avm_value.rs +++ b/crates/algod_client/src/models/avm_value.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// Represents an AVM value. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AvmValue { /// value type. Value `1` refers to **bytes**, value `2` refers to **uint64** #[serde(rename = "type")] diff --git a/crates/algod_client/src/models/block.rs b/crates/algod_client/src/models/block.rs index b265ad405..27551d076 100644 --- a/crates/algod_client/src/models/block.rs +++ b/crates/algod_client/src/models/block.rs @@ -9,23 +9,18 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::BlockStateProofTracking; use crate::models::SignedTxnInBlock; /// Block contains the BlockHeader and the list of transactions (Payset). +#[derive(Clone, Debug, PartialEq)] #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize, Default)] pub struct Block { /// [rnd] Round number. #[serde(rename = "rnd", skip_serializing_if = "Option::is_none")] @@ -141,7 +136,7 @@ pub struct Block { } impl AlgorandMsgpack for Block { - const PREFIX: &'static [u8] = b""; // Adjust prefix as needed for your specific type + const PREFIX: &'static [u8] = b""; } impl Block { diff --git a/crates/algod_client/src/models/block_account_state_delta.rs b/crates/algod_client/src/models/block_account_state_delta.rs index 32f350e11..7a7940a7a 100644 --- a/crates/algod_client/src/models/block_account_state_delta.rs +++ b/crates/algod_client/src/models/block_account_state_delta.rs @@ -10,11 +10,11 @@ use crate::models; use crate::models::BlockStateDelta; +use algokit_transact::AlgorandMsgpack; use serde::{Deserialize, Serialize}; /// BlockAccountStateDelta pairs an address with a BlockStateDelta map. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BlockAccountStateDelta { #[serde(rename = "address")] pub address: String, @@ -22,8 +22,28 @@ pub struct BlockAccountStateDelta { pub delta: BlockStateDelta, } +impl AlgorandMsgpack for BlockAccountStateDelta { + const PREFIX: &'static [u8] = b""; +} + impl BlockAccountStateDelta { - pub fn new(address: String, delta: BlockStateDelta) -> Self { + /// Default constructor for BlockAccountStateDelta + pub fn new() -> BlockAccountStateDelta { + BlockAccountStateDelta::default() + } + + /// Constructor with parameters + pub fn with_params(address: String, delta: BlockStateDelta) -> Self { Self { address, delta } } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } } diff --git a/crates/algod_client/src/models/block_app_eval_delta.rs b/crates/algod_client/src/models/block_app_eval_delta.rs index 5243d53d2..3018364f7 100644 --- a/crates/algod_client/src/models/block_app_eval_delta.rs +++ b/crates/algod_client/src/models/block_app_eval_delta.rs @@ -9,24 +9,19 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; use std::collections::HashMap; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::BlockStateDelta; use crate::models::SignedTxnInBlock; /// BlockAppEvalDelta matches msgpack wire for blocks; uses BlockStateDelta maps. +#[derive(Clone, Debug, PartialEq)] #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize, Default)] pub struct BlockAppEvalDelta { /// [gd] Global state delta for the application. #[serde(rename = "gd", skip_serializing_if = "Option::is_none")] @@ -51,7 +46,18 @@ impl AlgorandMsgpack for BlockAppEvalDelta { } impl BlockAppEvalDelta { + /// Default constructor for BlockAppEvalDelta pub fn new() -> BlockAppEvalDelta { BlockAppEvalDelta::default() } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } } diff --git a/crates/algod_client/src/models/block_eval_delta.rs b/crates/algod_client/src/models/block_eval_delta.rs index 3dc01a80f..96c0dce5f 100644 --- a/crates/algod_client/src/models/block_eval_delta.rs +++ b/crates/algod_client/src/models/block_eval_delta.rs @@ -9,13 +9,11 @@ */ use crate::models; -use serde::{Deserialize, Serialize}; - use algokit_transact::AlgorandMsgpack; +use serde::{Deserialize, Serialize}; /// BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BlockEvalDelta { /// [at] delta action. #[serde(rename = "at")] @@ -33,8 +31,13 @@ impl AlgorandMsgpack for BlockEvalDelta { } impl BlockEvalDelta { - /// Constructor for BlockEvalDelta - pub fn new(action: u32) -> BlockEvalDelta { + /// Default constructor for BlockEvalDelta + pub fn new() -> BlockEvalDelta { + BlockEvalDelta::default() + } + + /// Constructor with action parameter + pub fn with_action(action: u32) -> BlockEvalDelta { BlockEvalDelta { action, bytes: None, diff --git a/crates/algod_client/src/models/block_state_proof_tracking_data.rs b/crates/algod_client/src/models/block_state_proof_tracking_data.rs index 276c6539d..8a5498d95 100644 --- a/crates/algod_client/src/models/block_state_proof_tracking_data.rs +++ b/crates/algod_client/src/models/block_state_proof_tracking_data.rs @@ -9,15 +9,14 @@ */ use crate::models; +use algokit_transact::AlgorandMsgpack; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -use algokit_transact::AlgorandMsgpack; - /// Tracking metadata for a specific StateProofType. +#[derive(Clone, Debug, PartialEq)] #[serde_as] -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Serialize, Deserialize, Default)] pub struct BlockStateProofTrackingData { /// [v] Vector commitment root of state proof voters (may be absent when not applicable). #[serde_as(as = "Option")] @@ -36,7 +35,18 @@ impl AlgorandMsgpack for BlockStateProofTrackingData { } impl BlockStateProofTrackingData { + /// Default constructor for BlockStateProofTrackingData pub fn new() -> BlockStateProofTrackingData { BlockStateProofTrackingData::default() } + + /// Encode this struct to msgpack bytes using AlgorandMsgpack trait + pub fn to_msgpack(&self) -> Result, Box> { + Ok(self.encode()?) + } + + /// Decode msgpack bytes to this struct using AlgorandMsgpack trait + pub fn from_msgpack(bytes: &[u8]) -> Result> { + Ok(Self::decode(bytes)?) + } } diff --git a/crates/algod_client/src/models/box_descriptor.rs b/crates/algod_client/src/models/box_descriptor.rs index 2bc18c5c4..b7100ee60 100644 --- a/crates/algod_client/src/models/box_descriptor.rs +++ b/crates/algod_client/src/models/box_descriptor.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// Box descriptor describes a Box. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BoxDescriptor { /// Base64 encoded box name #[serde_as(as = "serde_with::base64::Base64")] diff --git a/crates/algod_client/src/models/box_model.rs b/crates/algod_client/src/models/box_model.rs index cc4cad714..1b3a3b653 100644 --- a/crates/algod_client/src/models/box_model.rs +++ b/crates/algod_client/src/models/box_model.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// Box name and its content. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Box { /// The round for which this information is relevant #[serde(rename = "round")] diff --git a/crates/algod_client/src/models/box_reference.rs b/crates/algod_client/src/models/box_reference.rs index 8f3a24179..4f9229a26 100644 --- a/crates/algod_client/src/models/box_reference.rs +++ b/crates/algod_client/src/models/box_reference.rs @@ -9,20 +9,15 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; /// References a box of an application. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BoxReference { /// Application ID which this box belongs to #[serde(rename = "app")] diff --git a/crates/algod_client/src/models/build_version.rs b/crates/algod_client/src/models/build_version.rs index 85a1eefc2..84c3eebdb 100644 --- a/crates/algod_client/src/models/build_version.rs +++ b/crates/algod_client/src/models/build_version.rs @@ -12,7 +12,6 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BuildVersion { #[serde(rename = "branch")] pub branch: String, diff --git a/crates/algod_client/src/models/debug_settings_prof.rs b/crates/algod_client/src/models/debug_settings_prof.rs index 30ff2c140..a2c387cf3 100644 --- a/crates/algod_client/src/models/debug_settings_prof.rs +++ b/crates/algod_client/src/models/debug_settings_prof.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// algod mutex and blocking profiling state. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DebugSettingsProf { /// The rate of blocking events. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To turn off profiling entirely, pass rate 0. #[serde(rename = "block-rate", skip_serializing_if = "Option::is_none")] diff --git a/crates/algod_client/src/models/dryrun_request.rs b/crates/algod_client/src/models/dryrun_request.rs index b35a88c60..72731d628 100644 --- a/crates/algod_client/src/models/dryrun_request.rs +++ b/crates/algod_client/src/models/dryrun_request.rs @@ -9,22 +9,16 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::Account; use crate::models::Application; use crate::models::DryrunSource; /// Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DryrunRequest { #[serde(rename = "txns")] pub txns: Vec, diff --git a/crates/algod_client/src/models/dryrun_source.rs b/crates/algod_client/src/models/dryrun_source.rs index 568f0e7b6..8c5722edf 100644 --- a/crates/algod_client/src/models/dryrun_source.rs +++ b/crates/algod_client/src/models/dryrun_source.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into transactions or application state. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DryrunSource { /// FieldName is what kind of sources this is. If lsig then it goes into the transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the Approval Program or Clear State Program of application[this.AppIndex]. #[serde(rename = "field-name")] diff --git a/crates/algod_client/src/models/dryrun_state.rs b/crates/algod_client/src/models/dryrun_state.rs index 928a64b2e..e8c7e0e61 100644 --- a/crates/algod_client/src/models/dryrun_state.rs +++ b/crates/algod_client/src/models/dryrun_state.rs @@ -15,7 +15,6 @@ use crate::models::TealValue; /// Stores the TEAL eval step data #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DryrunState { /// Line number #[serde(rename = "line")] diff --git a/crates/algod_client/src/models/dryrun_txn_result.rs b/crates/algod_client/src/models/dryrun_txn_result.rs index dbd199e0e..934f918ad 100644 --- a/crates/algod_client/src/models/dryrun_txn_result.rs +++ b/crates/algod_client/src/models/dryrun_txn_result.rs @@ -19,7 +19,6 @@ use crate::models::StateDelta; /// DryrunTxnResult contains any LogicSig or ApplicationCall program debug information and state updates from a dryrun. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DryrunTxnResult { /// Disassembled program line by line. #[serde(rename = "disassembly")] diff --git a/crates/algod_client/src/models/error_response.rs b/crates/algod_client/src/models/error_response.rs index 2456ae167..5260d905b 100644 --- a/crates/algod_client/src/models/error_response.rs +++ b/crates/algod_client/src/models/error_response.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::UnknownJsonValue; /// An error response with optional data field. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ErrorResponse { #[serde(rename = "data", skip_serializing_if = "Option::is_none")] pub data: Option, diff --git a/crates/algod_client/src/models/eval_delta.rs b/crates/algod_client/src/models/eval_delta.rs index acd946818..e33c98cd0 100644 --- a/crates/algod_client/src/models/eval_delta.rs +++ b/crates/algod_client/src/models/eval_delta.rs @@ -9,26 +9,20 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// Represents a TEAL value delta. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct EvalDelta { - /// \[at\] delta action. + /// [at] delta action. #[serde(rename = "action")] pub action: u32, - /// \[bs\] bytes value. + /// [bs] bytes value. #[serde(rename = "bytes", skip_serializing_if = "Option::is_none")] pub bytes: Option, - /// \[ui\] uint value. + /// [ui] uint value. #[serde(rename = "uint", skip_serializing_if = "Option::is_none")] pub uint: Option, } diff --git a/crates/algod_client/src/models/eval_delta_key_value.rs b/crates/algod_client/src/models/eval_delta_key_value.rs index b9854f5e9..9996a1887 100644 --- a/crates/algod_client/src/models/eval_delta_key_value.rs +++ b/crates/algod_client/src/models/eval_delta_key_value.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::EvalDelta; /// Key-value pairs for StateDelta. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct EvalDeltaKeyValue { #[serde(rename = "key")] pub key: String, diff --git a/crates/algod_client/src/models/genesis.rs b/crates/algod_client/src/models/genesis.rs index b17446192..ba0be69bd 100644 --- a/crates/algod_client/src/models/genesis.rs +++ b/crates/algod_client/src/models/genesis.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; use crate::models::GenesisAllocation; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Genesis { #[serde(rename = "alloc")] pub alloc: Vec, diff --git a/crates/algod_client/src/models/genesis_allocation.rs b/crates/algod_client/src/models/genesis_allocation.rs index 1dd482e5a..47b724ff6 100644 --- a/crates/algod_client/src/models/genesis_allocation.rs +++ b/crates/algod_client/src/models/genesis_allocation.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; use crate::models::UnknownJsonValue; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GenesisAllocation { #[serde(rename = "addr")] pub addr: String, diff --git a/crates/algod_client/src/models/get_application_boxes.rs b/crates/algod_client/src/models/get_application_boxes.rs index 00889a53f..416631132 100644 --- a/crates/algod_client/src/models/get_application_boxes.rs +++ b/crates/algod_client/src/models/get_application_boxes.rs @@ -15,7 +15,6 @@ use crate::models::BoxDescriptor; /// Box names of an application #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetApplicationBoxes { #[serde(rename = "boxes")] pub boxes: Vec, diff --git a/crates/algod_client/src/models/get_block.rs b/crates/algod_client/src/models/get_block.rs index aee113d70..aea5b275d 100644 --- a/crates/algod_client/src/models/get_block.rs +++ b/crates/algod_client/src/models/get_block.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::Block; /// Encoded block object. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GetBlock { /// Block data including header and transactions. #[serde(rename = "block")] @@ -38,12 +32,17 @@ pub struct GetBlock { } impl AlgorandMsgpack for GetBlock { - const PREFIX: &'static [u8] = b""; // Adjust prefix as needed for your specific type + const PREFIX: &'static [u8] = b""; } impl GetBlock { - /// Constructor for GetBlock - pub fn new(block: Block) -> GetBlock { + /// Default constructor for GetBlock + pub fn new() -> GetBlock { + GetBlock::default() + } + + /// Constructor with block parameter + pub fn with_block(block: Block) -> GetBlock { GetBlock { block, cert: None } } diff --git a/crates/algod_client/src/models/get_block_hash.rs b/crates/algod_client/src/models/get_block_hash.rs index b3c7236d8..2c42e65d7 100644 --- a/crates/algod_client/src/models/get_block_hash.rs +++ b/crates/algod_client/src/models/get_block_hash.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Hash of a block header. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetBlockHash { /// Block header hash. #[serde(rename = "blockHash")] diff --git a/crates/algod_client/src/models/get_block_logs.rs b/crates/algod_client/src/models/get_block_logs.rs index de2cf2b70..68ec3ad58 100644 --- a/crates/algod_client/src/models/get_block_logs.rs +++ b/crates/algod_client/src/models/get_block_logs.rs @@ -15,7 +15,6 @@ use crate::models::AppCallLogs; /// All logs emitted in the given round. Each app call, whether top-level or inner, that contains logs results in a separate AppCallLogs object. Therefore there may be multiple AppCallLogs with the same application ID and outer transaction ID in the event of multiple inner app calls to the same app. App calls with no logs are not included in the response. AppCallLogs are returned in the same order that their corresponding app call appeared in the block (pre-order traversal of inner app calls) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetBlockLogs { #[serde(rename = "logs")] pub logs: Vec, diff --git a/crates/algod_client/src/models/get_block_time_stamp_offset.rs b/crates/algod_client/src/models/get_block_time_stamp_offset.rs index 9185ab535..467563000 100644 --- a/crates/algod_client/src/models/get_block_time_stamp_offset.rs +++ b/crates/algod_client/src/models/get_block_time_stamp_offset.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Response containing the timestamp offset in seconds #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetBlockTimeStampOffset { /// Timestamp offset in seconds. #[serde(rename = "offset")] diff --git a/crates/algod_client/src/models/get_block_txids.rs b/crates/algod_client/src/models/get_block_txids.rs index 652112337..efa1a66d7 100644 --- a/crates/algod_client/src/models/get_block_txids.rs +++ b/crates/algod_client/src/models/get_block_txids.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Top level transaction IDs in a block. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetBlockTxids { /// Block transaction IDs. #[serde(rename = "blockTxids")] diff --git a/crates/algod_client/src/models/get_pending_transactions.rs b/crates/algod_client/src/models/get_pending_transactions.rs index 817ffd8a6..0742ab935 100644 --- a/crates/algod_client/src/models/get_pending_transactions.rs +++ b/crates/algod_client/src/models/get_pending_transactions.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::UnknownJsonValue; /// PendingTransactions is an array of signed transactions exactly as they were submitted. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetPendingTransactions { /// An array of signed transaction objects. #[serde(rename = "top-transactions")] diff --git a/crates/algod_client/src/models/get_pending_transactions_by_address.rs b/crates/algod_client/src/models/get_pending_transactions_by_address.rs index 29153b455..6cd2ddb8e 100644 --- a/crates/algod_client/src/models/get_pending_transactions_by_address.rs +++ b/crates/algod_client/src/models/get_pending_transactions_by_address.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::UnknownJsonValue; /// PendingTransactions is an array of signed transactions exactly as they were submitted. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetPendingTransactionsByAddress { /// An array of signed transaction objects. #[serde(rename = "top-transactions")] diff --git a/crates/algod_client/src/models/get_status.rs b/crates/algod_client/src/models/get_status.rs index 31988b5fa..81afcd35a 100644 --- a/crates/algod_client/src/models/get_status.rs +++ b/crates/algod_client/src/models/get_status.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// NodeStatus contains the information about a node status #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetStatus { /// CatchupTime in nanoseconds #[serde(rename = "catchup-time")] diff --git a/crates/algod_client/src/models/get_supply.rs b/crates/algod_client/src/models/get_supply.rs index 6e12b87e9..2547c9a4d 100644 --- a/crates/algod_client/src/models/get_supply.rs +++ b/crates/algod_client/src/models/get_supply.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Supply represents the current supply of MicroAlgos in the system #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetSupply { /// Round #[serde(rename = "current_round")] diff --git a/crates/algod_client/src/models/get_sync_round.rs b/crates/algod_client/src/models/get_sync_round.rs index 21c724843..c77dfd460 100644 --- a/crates/algod_client/src/models/get_sync_round.rs +++ b/crates/algod_client/src/models/get_sync_round.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Response containing the ledger's minimum sync round #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetSyncRound { /// The minimum sync round for the ledger. #[serde(rename = "round")] diff --git a/crates/algod_client/src/models/get_transaction_group_ledger_state_deltas_for_round.rs b/crates/algod_client/src/models/get_transaction_group_ledger_state_deltas_for_round.rs index 610db3130..9293d78da 100644 --- a/crates/algod_client/src/models/get_transaction_group_ledger_state_deltas_for_round.rs +++ b/crates/algod_client/src/models/get_transaction_group_ledger_state_deltas_for_round.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::LedgerStateDeltaForTransactionGroup; /// Response containing all ledger state deltas for transaction groups, with their associated Ids, in a single round. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetTransactionGroupLedgerStateDeltasForRound { #[serde(rename = "Deltas")] pub deltas: Vec, diff --git a/crates/algod_client/src/models/ledger_state_delta.rs b/crates/algod_client/src/models/ledger_state_delta.rs index 9d436940d..e289da6bb 100644 --- a/crates/algod_client/src/models/ledger_state_delta.rs +++ b/crates/algod_client/src/models/ledger_state_delta.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// Ledger StateDelta object #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LedgerStateDelta {} impl AlgorandMsgpack for LedgerStateDelta { diff --git a/crates/algod_client/src/models/ledger_state_delta_for_transaction_group.rs b/crates/algod_client/src/models/ledger_state_delta_for_transaction_group.rs index 673e70ba7..3787ce3a8 100644 --- a/crates/algod_client/src/models/ledger_state_delta_for_transaction_group.rs +++ b/crates/algod_client/src/models/ledger_state_delta_for_transaction_group.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::LedgerStateDelta; /// Contains a ledger delta for a single transaction group #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LedgerStateDeltaForTransactionGroup { #[serde(rename = "Delta")] pub delta: LedgerStateDelta, diff --git a/crates/algod_client/src/models/light_block_header_proof.rs b/crates/algod_client/src/models/light_block_header_proof.rs index 6faa5b9b2..7638e0269 100644 --- a/crates/algod_client/src/models/light_block_header_proof.rs +++ b/crates/algod_client/src/models/light_block_header_proof.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// Proof of membership and position of a light block header. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LightBlockHeaderProof { /// The index of the light block header in the vector commitment tree #[serde(rename = "index")] diff --git a/crates/algod_client/src/models/mod.rs b/crates/algod_client/src/models/mod.rs index 51cac1d74..4d85307fa 100644 --- a/crates/algod_client/src/models/mod.rs +++ b/crates/algod_client/src/models/mod.rs @@ -8,10 +8,6 @@ * Generated by: Rust OpenAPI Generator */ -#[cfg(feature = "ffi_uniffi")] -pub type UnknownJsonValue = String; - -#[cfg(not(feature = "ffi_uniffi"))] pub type UnknownJsonValue = serde_json::Value; pub mod genesis_allocation; diff --git a/crates/algod_client/src/models/participation_key.rs b/crates/algod_client/src/models/participation_key.rs index 168933f24..ddafc246d 100644 --- a/crates/algod_client/src/models/participation_key.rs +++ b/crates/algod_client/src/models/participation_key.rs @@ -15,7 +15,6 @@ use crate::models::AccountParticipation; /// Represents a participation key used by the node. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ParticipationKey { /// The key's ParticipationID. #[serde(rename = "id")] diff --git a/crates/algod_client/src/models/pending_transaction_response.rs b/crates/algod_client/src/models/pending_transaction_response.rs index 376bc762d..b3a90a2da 100644 --- a/crates/algod_client/src/models/pending_transaction_response.rs +++ b/crates/algod_client/src/models/pending_transaction_response.rs @@ -9,15 +9,11 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use crate::models::AccountStateDelta; use crate::models::StateDelta; @@ -26,7 +22,6 @@ use crate::models::UnknownJsonValue; /// Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details. #[serde_as] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PendingTransactionResponse { /// The asset index if the transaction was found and it created an asset. #[serde(rename = "asset-index", skip_serializing_if = "Option::is_none")] diff --git a/crates/algod_client/src/models/raw_transaction.rs b/crates/algod_client/src/models/raw_transaction.rs index 37c7a4e76..9821ce62d 100644 --- a/crates/algod_client/src/models/raw_transaction.rs +++ b/crates/algod_client/src/models/raw_transaction.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Transaction ID of the submission. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct RawTransaction { /// encoding of the transaction hash. #[serde(rename = "txId")] diff --git a/crates/algod_client/src/models/scratch_change.rs b/crates/algod_client/src/models/scratch_change.rs index bc314f451..9961240c2 100644 --- a/crates/algod_client/src/models/scratch_change.rs +++ b/crates/algod_client/src/models/scratch_change.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::AvmValue; /// A write operation into a scratch slot. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ScratchChange { /// The scratch slot written. #[serde(rename = "slot")] diff --git a/crates/algod_client/src/models/signed_txn_in_block.rs b/crates/algod_client/src/models/signed_txn_in_block.rs index 24b03ef00..891c28488 100644 --- a/crates/algod_client/src/models/signed_txn_in_block.rs +++ b/crates/algod_client/src/models/signed_txn_in_block.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::BlockAppEvalDelta; /// SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SignedTxnInBlock { /// SignedTransaction fields (flattened from algokit_transact) #[serde(flatten)] @@ -66,7 +60,6 @@ pub struct SignedTxnInBlock { #[serde(rename = "hgh", skip_serializing_if = "Option::is_none")] pub has_genesis_hash: Option, } - impl Default for SignedTxnInBlock { fn default() -> Self { Self { diff --git a/crates/algod_client/src/models/simulate_initial_states.rs b/crates/algod_client/src/models/simulate_initial_states.rs index 92184f622..064f78a9a 100644 --- a/crates/algod_client/src/models/simulate_initial_states.rs +++ b/crates/algod_client/src/models/simulate_initial_states.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationInitialStates; /// Initial states of resources that were accessed during simulation. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateInitialStates { /// The initial states of accessed application before simulation. The order of this array is arbitrary. #[serde(rename = "app-initial-states", skip_serializing_if = "Option::is_none")] diff --git a/crates/algod_client/src/models/simulate_request.rs b/crates/algod_client/src/models/simulate_request.rs index 377adb595..a718864c8 100644 --- a/crates/algod_client/src/models/simulate_request.rs +++ b/crates/algod_client/src/models/simulate_request.rs @@ -9,21 +9,15 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::SimulateRequestTransactionGroup; use crate::models::SimulateTraceConfig; /// Request type for simulation endpoint. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateRequest { /// The transaction groups to simulate. #[serde(rename = "txn-groups")] diff --git a/crates/algod_client/src/models/simulate_request_transaction_group.rs b/crates/algod_client/src/models/simulate_request_transaction_group.rs index 7a1e56288..81b5709de 100644 --- a/crates/algod_client/src/models/simulate_request_transaction_group.rs +++ b/crates/algod_client/src/models/simulate_request_transaction_group.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// A transaction group to simulate. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateRequestTransactionGroup { /// An atomic transaction group. #[serde(rename = "txns")] diff --git a/crates/algod_client/src/models/simulate_trace_config.rs b/crates/algod_client/src/models/simulate_trace_config.rs index f12ca2042..f1459343d 100644 --- a/crates/algod_client/src/models/simulate_trace_config.rs +++ b/crates/algod_client/src/models/simulate_trace_config.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// An object that configures simulation execution trace. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateTraceConfig { /// A boolean option for opting in execution trace features simulation endpoint. #[serde(rename = "enable", skip_serializing_if = "Option::is_none")] diff --git a/crates/algod_client/src/models/simulate_transaction.rs b/crates/algod_client/src/models/simulate_transaction.rs index d2df11829..b153a677d 100644 --- a/crates/algod_client/src/models/simulate_transaction.rs +++ b/crates/algod_client/src/models/simulate_transaction.rs @@ -9,15 +9,10 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::SimulateInitialStates; use crate::models::SimulateTraceConfig; use crate::models::SimulateTransactionGroupResult; @@ -25,7 +20,6 @@ use crate::models::SimulationEvalOverrides; /// Result of a transaction group simulation. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateTransaction { /// The version of this response object. #[serde(rename = "version")] diff --git a/crates/algod_client/src/models/simulate_transaction_group_result.rs b/crates/algod_client/src/models/simulate_transaction_group_result.rs index f4dda7fda..86e7566bb 100644 --- a/crates/algod_client/src/models/simulate_transaction_group_result.rs +++ b/crates/algod_client/src/models/simulate_transaction_group_result.rs @@ -9,21 +9,15 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::SimulateTransactionResult; use crate::models::SimulateUnnamedResourcesAccessed; /// Simulation result for an atomic transaction group #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateTransactionGroupResult { /// Simulation result for individual transactions #[serde(rename = "txn-results")] diff --git a/crates/algod_client/src/models/simulate_transaction_result.rs b/crates/algod_client/src/models/simulate_transaction_result.rs index de820d672..424219971 100644 --- a/crates/algod_client/src/models/simulate_transaction_result.rs +++ b/crates/algod_client/src/models/simulate_transaction_result.rs @@ -9,22 +9,16 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::PendingTransactionResponse; use crate::models::SimulateUnnamedResourcesAccessed; use crate::models::SimulationTransactionExecTrace; /// Simulation result for an individual transaction #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateTransactionResult { #[serde(rename = "txn-result")] pub txn_result: PendingTransactionResponse, diff --git a/crates/algod_client/src/models/simulate_unnamed_resources_accessed.rs b/crates/algod_client/src/models/simulate_unnamed_resources_accessed.rs index a8bb89a70..24cccd778 100644 --- a/crates/algod_client/src/models/simulate_unnamed_resources_accessed.rs +++ b/crates/algod_client/src/models/simulate_unnamed_resources_accessed.rs @@ -9,22 +9,16 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationLocalReference; use crate::models::AssetHoldingReference; use crate::models::BoxReference; /// These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulateUnnamedResourcesAccessed { /// The unnamed accounts that were referenced. The order of this array is arbitrary. #[serde(rename = "accounts", skip_serializing_if = "Option::is_none")] diff --git a/crates/algod_client/src/models/simulation_eval_overrides.rs b/crates/algod_client/src/models/simulation_eval_overrides.rs index c4e34f9a7..c78aa6196 100644 --- a/crates/algod_client/src/models/simulation_eval_overrides.rs +++ b/crates/algod_client/src/models/simulation_eval_overrides.rs @@ -9,18 +9,12 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - /// The set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulationEvalOverrides { /// If true, transactions without signatures are allowed and simulated as if they were properly signed. #[serde( diff --git a/crates/algod_client/src/models/simulation_opcode_trace_unit.rs b/crates/algod_client/src/models/simulation_opcode_trace_unit.rs index 0b7f6a14f..7315a8f15 100644 --- a/crates/algod_client/src/models/simulation_opcode_trace_unit.rs +++ b/crates/algod_client/src/models/simulation_opcode_trace_unit.rs @@ -9,22 +9,16 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::ApplicationStateOperation; use crate::models::AvmValue; use crate::models::ScratchChange; /// The set of trace information and effect from evaluating a single opcode. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulationOpcodeTraceUnit { /// The program counter of the current opcode being evaluated. #[serde(rename = "pc")] diff --git a/crates/algod_client/src/models/simulation_transaction_exec_trace.rs b/crates/algod_client/src/models/simulation_transaction_exec_trace.rs index 35576910c..307eb0176 100644 --- a/crates/algod_client/src/models/simulation_transaction_exec_trace.rs +++ b/crates/algod_client/src/models/simulation_transaction_exec_trace.rs @@ -9,22 +9,17 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use crate::models::SimulationOpcodeTraceUnit; /// The execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SimulationTransactionExecTrace { /// Program trace that contains a trace of opcode effects in an approval program. #[serde( diff --git a/crates/algod_client/src/models/start_catchup.rs b/crates/algod_client/src/models/start_catchup.rs index 612c81f47..4306deddb 100644 --- a/crates/algod_client/src/models/start_catchup.rs +++ b/crates/algod_client/src/models/start_catchup.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// An catchpoint start response. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StartCatchup { /// Catchup start response string #[serde(rename = "catchup-message")] diff --git a/crates/algod_client/src/models/state_delta.rs b/crates/algod_client/src/models/state_delta.rs index 7babd46cf..cdcc396ad 100644 --- a/crates/algod_client/src/models/state_delta.rs +++ b/crates/algod_client/src/models/state_delta.rs @@ -9,15 +9,10 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::EvalDeltaKeyValue; /// Application state delta. diff --git a/crates/algod_client/src/models/state_proof.rs b/crates/algod_client/src/models/state_proof.rs index 35d11ac52..a105300d8 100644 --- a/crates/algod_client/src/models/state_proof.rs +++ b/crates/algod_client/src/models/state_proof.rs @@ -17,7 +17,6 @@ use crate::models::StateProofMessage; /// Represents a state proof and its corresponding message #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProof { #[serde(rename = "Message")] pub message: StateProofMessage, diff --git a/crates/algod_client/src/models/state_proof_message.rs b/crates/algod_client/src/models/state_proof_message.rs index 8496a4910..a66f7a1a9 100644 --- a/crates/algod_client/src/models/state_proof_message.rs +++ b/crates/algod_client/src/models/state_proof_message.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// Represents the message that the state proofs are attesting to. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofMessage { /// The vector commitment root on all light block headers within a state proof interval. #[serde_as(as = "serde_with::base64::Base64")] diff --git a/crates/algod_client/src/models/teal_compile.rs b/crates/algod_client/src/models/teal_compile.rs index c5f8e68d6..53d551c60 100644 --- a/crates/algod_client/src/models/teal_compile.rs +++ b/crates/algod_client/src/models/teal_compile.rs @@ -17,7 +17,6 @@ use crate::models::UnknownJsonValue; /// Teal compile Result #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealCompile { /// base32 SHA512_256 of program bytes (Address style) #[serde(rename = "hash")] diff --git a/crates/algod_client/src/models/teal_disassemble.rs b/crates/algod_client/src/models/teal_disassemble.rs index eda6b9b40..022231941 100644 --- a/crates/algod_client/src/models/teal_disassemble.rs +++ b/crates/algod_client/src/models/teal_disassemble.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// Teal disassembly Result #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealDisassemble { /// disassembled Teal code #[serde(rename = "result")] diff --git a/crates/algod_client/src/models/teal_dryrun.rs b/crates/algod_client/src/models/teal_dryrun.rs index 0aaa08679..8e2da060f 100644 --- a/crates/algod_client/src/models/teal_dryrun.rs +++ b/crates/algod_client/src/models/teal_dryrun.rs @@ -15,7 +15,6 @@ use crate::models::DryrunTxnResult; /// DryrunResponse contains per-txn debug information from a dryrun. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealDryrun { #[serde(rename = "txns")] pub txns: Vec, diff --git a/crates/algod_client/src/models/teal_key_value.rs b/crates/algod_client/src/models/teal_key_value.rs index 8591dfc95..ac31b35e6 100644 --- a/crates/algod_client/src/models/teal_key_value.rs +++ b/crates/algod_client/src/models/teal_key_value.rs @@ -9,20 +9,14 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::TealValue; /// Represents a key-value pair in an application store. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealKeyValue { #[serde(rename = "key")] pub key: String, diff --git a/crates/algod_client/src/models/teal_key_value_store.rs b/crates/algod_client/src/models/teal_key_value_store.rs index 18c1784aa..243ceaa89 100644 --- a/crates/algod_client/src/models/teal_key_value_store.rs +++ b/crates/algod_client/src/models/teal_key_value_store.rs @@ -9,15 +9,10 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] +use algokit_transact::AlgorandMsgpack; use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - -use algokit_transact::AlgorandMsgpack; - use crate::models::TealKeyValue; /// Represents a key-value store for use in an application. diff --git a/crates/algod_client/src/models/teal_value.rs b/crates/algod_client/src/models/teal_value.rs index dd780f565..05b1defe6 100644 --- a/crates/algod_client/src/models/teal_value.rs +++ b/crates/algod_client/src/models/teal_value.rs @@ -9,29 +9,24 @@ */ use crate::models; -#[cfg(not(feature = "ffi_uniffi"))] -use algokit_transact::SignedTransaction as AlgokitSignedTransaction; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -#[cfg(feature = "ffi_uniffi")] -use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; - use algokit_transact::AlgorandMsgpack; +use algokit_transact::SignedTransaction as AlgokitSignedTransaction; /// Represents a TEAL value. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealValue { - /// \[tt\] value type. Value `1` refers to **bytes**, value `2` refers to **uint** + /// [tt] value type. Value `1` refers to **bytes**, value `2` refers to **uint** #[serde(rename = "type")] pub r#type: u64, - /// \[tb\] bytes value. + /// [tb] bytes value. #[serde_as(as = "Bytes")] #[serde(rename = "bytes")] pub bytes: Vec, - /// \[ui\] uint value. + /// [ui] uint value. #[serde(rename = "uint")] pub uint: u64, } diff --git a/crates/algod_client/src/models/transaction_params.rs b/crates/algod_client/src/models/transaction_params.rs index 48e200f56..00e5a382f 100644 --- a/crates/algod_client/src/models/transaction_params.rs +++ b/crates/algod_client/src/models/transaction_params.rs @@ -16,7 +16,6 @@ use serde_with::{Bytes, serde_as}; /// a new transaction. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionParams { /// ConsensusVersion indicates the consensus protocol version /// as of LastRound. diff --git a/crates/algod_client/src/models/transaction_proof.rs b/crates/algod_client/src/models/transaction_proof.rs index 6af751b16..521bbb812 100644 --- a/crates/algod_client/src/models/transaction_proof.rs +++ b/crates/algod_client/src/models/transaction_proof.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// Proof of transaction in a block. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionProof { /// Proof of transaction membership. #[serde_as(as = "serde_with::base64::Base64")] diff --git a/crates/algod_client/src/models/version.rs b/crates/algod_client/src/models/version.rs index 002ddb376..998dfc466 100644 --- a/crates/algod_client/src/models/version.rs +++ b/crates/algod_client/src/models/version.rs @@ -17,7 +17,6 @@ use crate::models::BuildVersion; /// algod version information. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Version { #[serde(rename = "build")] pub build: BuildVersion, diff --git a/crates/algod_client/src/models/wait_for_block.rs b/crates/algod_client/src/models/wait_for_block.rs index e60767912..281784da5 100644 --- a/crates/algod_client/src/models/wait_for_block.rs +++ b/crates/algod_client/src/models/wait_for_block.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// NodeStatus contains the information about a node status #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct WaitForBlock { /// CatchupTime in nanoseconds #[serde(rename = "catchup-time")] diff --git a/crates/algod_client_ffi/Cargo.toml b/crates/algod_client_ffi/Cargo.toml new file mode 100644 index 000000000..7ac191989 --- /dev/null +++ b/crates/algod_client_ffi/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "algod_client_ffi" +version = "0.0.1" +authors = ["AlgoKit Core Team"] +description = "API client for algod interaction." +license = "MIT" +edition = "2024" + + +[dependencies] +serde_json = "^1.0" + +# Error handling +snafu = { workspace = true } + +async-trait = "0.1.89" +algokit_transact_ffi = { path = "../algokit_transact_ffi" } +uniffi = { workspace = true } +algokit_http_client = { path = "../algokit_http_client", default-features = false, features = ["ffi_uniffi"] } +algod_client = { path = "../algod_client" } +[dev-dependencies] +tokio = { version = "1.0", features = ["full"] } +tokio-test = "^0.4" \ No newline at end of file diff --git a/crates/algod_client_ffi/README.md b/crates/algod_client_ffi/README.md new file mode 100644 index 000000000..89beb7fd5 --- /dev/null +++ b/crates/algod_client_ffi/README.md @@ -0,0 +1,326 @@ +# Algod REST API. + +API endpoint for algod operations. + +**Version:** 0.0.1 +**Contact:** contact@algorand.com + +This Rust crate provides a client library for the Algod REST API. API. + +## Installation + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +algod_client_ffi = "0.0.1" +``` + +## Usage + +```rust +use algod_client_ffi::AlgodClientFfi; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Initialize client (choose one based on your network) + let client = AlgodClientFfi::localnet(); // For local development + // let client = AlgodClientFfi::testnet(); // For TestNet + // let client = AlgodClientFfi::mainnet(); // For MainNet + + // Example: Get network status + let status = client.get_status().await?; + println!("Network status: {:?}", status); + + // Example: Get transaction parameters + let params = client.transaction_params().await?; + println!("Min fee: {}", params.min_fee); + println!("Last round: {}", params.last_round); + + // Example: Get account information + let account_address = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + let account_info = client.account_information( + None, // format + account_address, + None, // exclude + ).await?; + println!("Account balance: {}", account_info.amount); + + Ok(()) +} +``` + +## Configuration + +The client provides convenient constructors for different networks: + +```rust +use algod_client_ffi::AlgodClientFfi; + +// For local development (uses localhost:4001 with default API token) +let client = AlgodClientFfi::localnet(); + +// For Algorand TestNet +let client = AlgodClientFfi::testnet(); + +// For Algorand MainNet +let client = AlgodClientFfi::mainnet(); +``` + +For custom configurations, you can use a custom HTTP client: + +```rust +use algod_client_ffi::AlgodClientFfi; +use algokit_http_client::DefaultHttpClient; +use std::sync::Arc; + +// Custom endpoint with API token +let http_client = Arc::new( + DefaultHttpClient::with_header( + "http://localhost/", + "X-API-Key", + "your-api-key" + )? +); +let client = AlgodClientFfi::new(http_client); +``` + +## Complete Example + +Here's a more comprehensive example showing how to check network status, get account information, and prepare for transactions: + +```rust +use algod_client_ffi::AlgodClientFfi; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Connect to localnet + let client = AlgodClientFfi::localnet(); + + // Check if the node is healthy and ready + client.health_check().await?; + client.get_ready().await?; + println!("✓ Node is healthy and ready"); + + // Get network information + let status = client.get_status().await?; + println!("✓ Connected to network"); + println!(" Last round: {}", status.last_round); + println!(" Catching up: {}", status.catchup_time.unwrap_or(0)); + + // Get transaction parameters needed for building transactions + let params = client.transaction_params().await?; + println!("✓ Retrieved transaction parameters"); + println!(" Genesis ID: {}", params.genesis_id); + println!(" Min fee: {}", params.min_fee); + + // Example: Get account information + let test_address = "7ZUECA7HFLZTXENRV24SHLU4AVPUTMTTDUFUBNBD64C73F3UHRTHAIOF6Q"; + match client.account_information(None, test_address, None).await { + Ok(account) => { + println!("✓ Account information retrieved"); + println!(" Address: {}", account.address); + println!(" Balance: {} microAlgos", account.amount); + println!(" Min balance: {} microAlgos", account.min_balance); + } + Err(e) => { + println!("⚠ Could not retrieve account info: {}", e); + } + } + + Ok(()) +} +``` + +## API Operations + +This client provides access to 55 API operations: + +- `health_check` - Returns OK if healthy. +- `get_ready` - Returns OK if healthy and fully caught up. +- `metrics` - Return metrics about algod functioning. +- `get_genesis` - Gets the genesis information. +- `swagger_json` - Gets the current swagger spec. +- `get_version` - Retrieves the supported API versions, binary build versions, and genesis information. +- `get_debug_settings_prof` - Retrieves the current settings for blocking and mutex profiles +- `put_debug_settings_prof` - Enables blocking and mutex profiles, and returns the old settings +- `get_config` - Gets the merged config file. +- `account_information` - Get account information. +- `account_asset_information` - Get account information about a given asset. +- `account_assets_information` - Get a list of assets held by an account, inclusive of asset params. +- `account_application_information` - Get account information about a given app. +- `get_pending_transactions_by_address` - Get a list of unconfirmed transactions currently in the transaction pool by address. +- `get_block` - Get the block for the given round. +- `get_block_txids` - Get the top level transaction IDs for the block on the given round. +- `get_block_hash` - Get the block hash for the block on the given round. +- `get_transaction_proof` - Get a proof for a transaction in a block. +- `get_block_logs` - Get all of the logs from outer and inner app calls in the given round +- `get_supply` - Get the current supply reported by the ledger. +- `get_participation_keys` - Return a list of participation keys +- `add_participation_key` - Add a participation key to the node +- `generate_participation_keys` - Generate and install participation keys to the node. +- `get_participation_key_by_id` - Get participation key info given a participation ID +- `append_keys` - Append state proof keys to a participation key +- `delete_participation_key_by_id` - Delete a given participation key by ID +- `shutdown_node` - Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. +- `get_status` - Gets the current node status. +- `wait_for_block` - Gets the node status after waiting for a round after the given round. +- `raw_transaction` - Broadcasts a raw transaction or transaction group to the network. +- `raw_transaction_async` - Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. +- `simulate_transaction` - Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. +- `transaction_params` - Get parameters for constructing a new transaction +- `get_pending_transactions` - Get a list of unconfirmed transactions currently in the transaction pool. +- `pending_transaction_information` - Get a specific pending transaction. +- `get_ledger_state_delta` - Get a LedgerStateDelta object for a given round +- `get_transaction_group_ledger_state_deltas_for_round` - Get LedgerStateDelta objects for all transaction groups in a given round +- `get_ledger_state_delta_for_transaction_group` - Get a LedgerStateDelta object for a given transaction group +- `get_state_proof` - Get a state proof that covers a given round +- `get_light_block_header_proof` - Gets a proof for a given light block header inside a state proof commitment +- `get_application_by_id` - Get application information. +- `get_application_boxes` - Get all box names for a given application. +- `get_application_box_by_name` - Get box information for a given application. +- `get_asset_by_id` - Get asset information. +- `get_sync_round` - Returns the minimum sync round the ledger is keeping in cache. +- `unset_sync_round` - Removes minimum sync round restriction from the ledger. +- `set_sync_round` - Given a round, tells the ledger to keep that round in its cache. +- `teal_compile` - Compile TEAL source code to binary, produce its hash +- `teal_disassemble` - Disassemble program bytes into the TEAL source code. +- `start_catchup` - Starts a catchpoint catchup. +- `abort_catchup` - Aborts a catchpoint catchup. +- `teal_dryrun` - Provide debugging information for a transaction (or group). +- `experimental_check` - Returns OK if experimental API is enabled. +- `get_block_time_stamp_offset` - Returns the timestamp offset. Timestamp offsets can only be set in dev mode. +- `set_block_time_stamp_offset` - Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. + +## Models + +The following data models are available: + +- `GenesisAllocation` - No description +- `Genesis` - No description +- `LedgerStateDelta` - Ledger StateDelta object +- `LedgerStateDeltaForTransactionGroup` - Contains a ledger delta for a single transaction group +- `Account` - Account information at a given round. + +Definition: +data/basics/userBalance.go : AccountData + +- `AccountAssetHolding` - AccountAssetHolding describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. +- `AccountParticipation` - AccountParticipation describes the parameters used by this account in consensus protocol. +- `Asset` - Specifies both the unique identifier and the parameters for an asset +- `AssetHolding` - Describes an asset held by an account. + +Definition: +data/basics/userBalance.go : AssetHolding +- `AssetParams` - AssetParams specifies the parameters for an asset. + +\[apar\] when part of an AssetConfig transaction. + +Definition: +data/transactions/asset.go : AssetParams +- `AssetHoldingReference` - References an asset held by an account. +- `ApplicationLocalReference` - References an account's local state for an application. +- `ApplicationStateSchema` - Specifies maximums on the number of each type that may be stored. +- `ApplicationLocalState` - Stores local state associated with an application. +- `ParticipationKey` - Represents a participation key used by the node. +- `TealKeyValueStore` - Represents a key-value store for use in an application. +- `TealKeyValue` - Represents a key-value pair in an application store. +- `TealValue` - Represents a TEAL value. +- `AvmValue` - Represents an AVM value. +- `AvmKeyValue` - Represents an AVM key-value pair in an application store. +- `StateDelta` - Application state delta. +- `AccountStateDelta` - Application state delta. +- `EvalDeltaKeyValue` - Key-value pairs for StateDelta. +- `EvalDelta` - Represents a TEAL value delta. +- `Application` - Application index and its parameters +- `ApplicationParams` - Stores the global information associated with an application. +- `DryrunState` - Stores the TEAL eval step data +- `DryrunTxnResult` - DryrunTxnResult contains any LogicSig or ApplicationCall program debug information and state updates from a dryrun. +- `ErrorResponse` - An error response with optional data field. +- `DryrunRequest` - Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information. +- `DryrunSource` - DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into transactions or application state. +- `SimulateRequest` - Request type for simulation endpoint. +- `SimulateRequestTransactionGroup` - A transaction group to simulate. +- `SimulateTraceConfig` - An object that configures simulation execution trace. +- `Box` - Box name and its content. +- `BoxDescriptor` - Box descriptor describes a Box. +- `BoxReference` - References a box of an application. +- `Version` - algod version information. +- `DebugSettingsProf` - algod mutex and blocking profiling state. +- `BuildVersion` - No description +- `PendingTransactionResponse` - Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details. +- `SimulateTransactionGroupResult` - Simulation result for an atomic transaction group +- `SimulateTransactionResult` - Simulation result for an individual transaction +- `StateProof` - Represents a state proof and its corresponding message +- `LightBlockHeaderProof` - Proof of membership and position of a light block header. +- `StateProofMessage` - Represents the message that the state proofs are attesting to. +- `SimulationEvalOverrides` - The set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways. +- `ScratchChange` - A write operation into a scratch slot. +- `ApplicationStateOperation` - An operation against an application's global/local/box state. +- `ApplicationKvStorage` - An application's global/local/box state. +- `ApplicationInitialStates` - An application's initial global/local/box states that were accessed during simulation. +- `SimulationOpcodeTraceUnit` - The set of trace information and effect from evaluating a single opcode. +- `SimulationTransactionExecTrace` - The execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way. +- `SimulateUnnamedResourcesAccessed` - These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them. +- `SimulateInitialStates` - Initial states of resources that were accessed during simulation. +- `AppCallLogs` - The logged messages from an app call along with the app ID and outer transaction ID. Logs appear in the same order that they were emitted. +- `TransactionProof` - Proof of transaction in a block. +- `AccountAssetInformation` - AccountAssetResponse describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. Asset parameters will only be returned if the provided address is the asset's creator. +- `AccountAssetsInformation` - AccountAssetsInformationResponse contains a list of assets held by an account. +- `AccountApplicationInformation` - AccountApplicationResponse describes the account's application local state and global state (AppLocalState and AppParams, if either exists) for a specific application ID. Global state will only be returned if the provided address is the application's creator. +- `GetPendingTransactionsByAddress` - PendingTransactions is an array of signed transactions exactly as they were submitted. +- `GetBlock` - Encoded block object. +- `GetBlockTxids` - Top level transaction IDs in a block. +- `GetBlockHash` - Hash of a block header. +- `GetBlockLogs` - All logs emitted in the given round. Each app call, whether top-level or inner, that contains logs results in a separate AppCallLogs object. Therefore there may be multiple AppCallLogs with the same application ID and outer transaction ID in the event of multiple inner app calls to the same app. App calls with no logs are not included in the response. AppCallLogs are returned in the same order that their corresponding app call appeared in the block (pre-order traversal of inner app calls) +- `GetSupply` - Supply represents the current supply of MicroAlgos in the system +- `AddParticipationKey` - Participation ID of the submission +- `GetStatus` - NodeStatus contains the information about a node status +- `WaitForBlock` - NodeStatus contains the information about a node status +- `RawTransaction` - Transaction ID of the submission. +- `SimulateTransaction` - Result of a transaction group simulation. +- `TransactionParams` - TransactionParams contains the parameters that help a client construct +a new transaction. +- `GetPendingTransactions` - PendingTransactions is an array of signed transactions exactly as they were submitted. +- `GetTransactionGroupLedgerStateDeltasForRound` - Response containing all ledger state deltas for transaction groups, with their associated Ids, in a single round. +- `GetApplicationBoxes` - Box names of an application +- `GetSyncRound` - Response containing the ledger's minimum sync round +- `TealCompile` - Teal compile Result +- `TealDisassemble` - Teal disassembly Result +- `StartCatchup` - An catchpoint start response. +- `AbortCatchup` - An catchpoint abort response. +- `TealDryrun` - DryrunResponse contains per-txn debug information from a dryrun. +- `GetBlockTimeStampOffset` - Response containing the timestamp offset in seconds + +## Error Handling + +All API operations return a `Result` type. Errors include: + +- Network errors (connection issues, timeouts) +- HTTP errors (4xx, 5xx status codes) +- Serialization errors (invalid JSON responses) + +```rust +// Example error handling +match client.get_status().await { + Ok(status) => { + println!("Node is running on round: {}", status.last_round); + } + Err(error) => { + eprintln!("Failed to get node status: {:?}", error); + // Handle specific error types if needed + } +} + +// Or use the ? operator for early returns +let params = client.transaction_params().await + .map_err(|e| format!("Failed to get transaction params: {}", e))?; +``` + +## Generated Code + +This client was generated from an OpenAPI specification using a custom Rust code generator. + +**Generated on:** Generated by Rust OpenAPI Generator +**OpenAPI Version:** 3.0.0 +**Generator:** Rust OpenAPI Generator diff --git a/crates/algod_client_ffi/src/apis/abort_catchup.rs b/crates/algod_client_ffi/src/apis/abort_catchup.rs new file mode 100644 index 000000000..f9a0cc6fa --- /dev/null +++ b/crates/algod_client_ffi/src/apis/abort_catchup.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AbortCatchupError as RustAbortCatchupError; + +// Import all custom types used by this endpoint +use crate::models::{AbortCatchup, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`abort_catchup`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AbortCatchupError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AbortCatchupError { + fn from(e: RustAbortCatchupError) -> Self { + match e { + RustAbortCatchupError::Status400(v) => AbortCatchupError::Status400(v.into()), + RustAbortCatchupError::Status401(v) => AbortCatchupError::Status401(v.into()), + RustAbortCatchupError::Status500(v) => AbortCatchupError::Status500(v.into()), + RustAbortCatchupError::Statusdefault() => AbortCatchupError::Statusdefault(), + RustAbortCatchupError::DefaultResponse() => AbortCatchupError::DefaultResponse(), + RustAbortCatchupError::UnknownValue(v) => AbortCatchupError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/account_application_information.rs b/crates/algod_client_ffi/src/apis/account_application_information.rs new file mode 100644 index 000000000..682a1eaca --- /dev/null +++ b/crates/algod_client_ffi/src/apis/account_application_information.rs @@ -0,0 +1,57 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::parameter_enums::*; +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AccountApplicationInformationError as RustAccountApplicationInformationError; + +// Import all custom types used by this endpoint +use crate::models::{AccountApplicationInformation, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`account_application_information`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AccountApplicationInformationError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AccountApplicationInformationError { + fn from(e: RustAccountApplicationInformationError) -> Self { + match e { + RustAccountApplicationInformationError::Status400(v) => { + AccountApplicationInformationError::Status400(v.into()) + } + RustAccountApplicationInformationError::Status401(v) => { + AccountApplicationInformationError::Status401(v.into()) + } + RustAccountApplicationInformationError::Status500(v) => { + AccountApplicationInformationError::Status500(v.into()) + } + RustAccountApplicationInformationError::Statusdefault() => { + AccountApplicationInformationError::Statusdefault() + } + RustAccountApplicationInformationError::DefaultResponse() => { + AccountApplicationInformationError::DefaultResponse() + } + RustAccountApplicationInformationError::UnknownValue(v) => { + AccountApplicationInformationError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/account_asset_information.rs b/crates/algod_client_ffi/src/apis/account_asset_information.rs new file mode 100644 index 000000000..feea2efa2 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/account_asset_information.rs @@ -0,0 +1,57 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::parameter_enums::*; +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AccountAssetInformationError as RustAccountAssetInformationError; + +// Import all custom types used by this endpoint +use crate::models::{AccountAssetInformation, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`account_asset_information`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AccountAssetInformationError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AccountAssetInformationError { + fn from(e: RustAccountAssetInformationError) -> Self { + match e { + RustAccountAssetInformationError::Status400(v) => { + AccountAssetInformationError::Status400(v.into()) + } + RustAccountAssetInformationError::Status401(v) => { + AccountAssetInformationError::Status401(v.into()) + } + RustAccountAssetInformationError::Status500(v) => { + AccountAssetInformationError::Status500(v.into()) + } + RustAccountAssetInformationError::Statusdefault() => { + AccountAssetInformationError::Statusdefault() + } + RustAccountAssetInformationError::DefaultResponse() => { + AccountAssetInformationError::DefaultResponse() + } + RustAccountAssetInformationError::UnknownValue(v) => { + AccountAssetInformationError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/account_assets_information.rs b/crates/algod_client_ffi/src/apis/account_assets_information.rs new file mode 100644 index 000000000..052950506 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/account_assets_information.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AccountAssetsInformationError as RustAccountAssetsInformationError; + +// Import all custom types used by this endpoint +use crate::models::{AccountAssetsInformation, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`account_assets_information`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AccountAssetsInformationError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AccountAssetsInformationError { + fn from(e: RustAccountAssetsInformationError) -> Self { + match e { + RustAccountAssetsInformationError::Status400(v) => { + AccountAssetsInformationError::Status400(v.into()) + } + RustAccountAssetsInformationError::Status401(v) => { + AccountAssetsInformationError::Status401(v.into()) + } + RustAccountAssetsInformationError::Status500(v) => { + AccountAssetsInformationError::Status500(v.into()) + } + RustAccountAssetsInformationError::Statusdefault() => { + AccountAssetsInformationError::Statusdefault() + } + RustAccountAssetsInformationError::DefaultResponse() => { + AccountAssetsInformationError::DefaultResponse() + } + RustAccountAssetsInformationError::UnknownValue(v) => { + AccountAssetsInformationError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/account_information.rs b/crates/algod_client_ffi/src/apis/account_information.rs new file mode 100644 index 000000000..46f3f3d01 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/account_information.rs @@ -0,0 +1,57 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::parameter_enums::*; +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AccountInformationError as RustAccountInformationError; + +// Import all custom types used by this endpoint +use crate::models::{Account, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`account_information`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AccountInformationError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AccountInformationError { + fn from(e: RustAccountInformationError) -> Self { + match e { + RustAccountInformationError::Status400(v) => { + AccountInformationError::Status400(v.into()) + } + RustAccountInformationError::Status401(v) => { + AccountInformationError::Status401(v.into()) + } + RustAccountInformationError::Status500(v) => { + AccountInformationError::Status500(v.into()) + } + RustAccountInformationError::Statusdefault() => { + AccountInformationError::Statusdefault() + } + RustAccountInformationError::DefaultResponse() => { + AccountInformationError::DefaultResponse() + } + RustAccountInformationError::UnknownValue(v) => { + AccountInformationError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/add_participation_key.rs b/crates/algod_client_ffi/src/apis/add_participation_key.rs new file mode 100644 index 000000000..802ac8727 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/add_participation_key.rs @@ -0,0 +1,64 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AddParticipationKeyError as RustAddParticipationKeyError; + +// Import all custom types used by this endpoint +use crate::models::{AddParticipationKey, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`add_participation_key`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AddParticipationKeyError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AddParticipationKeyError { + fn from(e: RustAddParticipationKeyError) -> Self { + match e { + RustAddParticipationKeyError::Status400(v) => { + AddParticipationKeyError::Status400(v.into()) + } + RustAddParticipationKeyError::Status401(v) => { + AddParticipationKeyError::Status401(v.into()) + } + RustAddParticipationKeyError::Status404(v) => { + AddParticipationKeyError::Status404(v.into()) + } + RustAddParticipationKeyError::Status500(v) => { + AddParticipationKeyError::Status500(v.into()) + } + RustAddParticipationKeyError::Status503(v) => { + AddParticipationKeyError::Status503(v.into()) + } + RustAddParticipationKeyError::Statusdefault() => { + AddParticipationKeyError::Statusdefault() + } + RustAddParticipationKeyError::DefaultResponse() => { + AddParticipationKeyError::DefaultResponse() + } + RustAddParticipationKeyError::UnknownValue(v) => { + AddParticipationKeyError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/append_keys.rs b/crates/algod_client_ffi/src/apis/append_keys.rs new file mode 100644 index 000000000..dc2c9a8fa --- /dev/null +++ b/crates/algod_client_ffi/src/apis/append_keys.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::AppendKeysError as RustAppendKeysError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, ParticipationKey}; + +// Import request body type if needed + +/// struct for typed errors of method [`append_keys`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum AppendKeysError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for AppendKeysError { + fn from(e: RustAppendKeysError) -> Self { + match e { + RustAppendKeysError::Status400(v) => AppendKeysError::Status400(v.into()), + RustAppendKeysError::Status401(v) => AppendKeysError::Status401(v.into()), + RustAppendKeysError::Status404(v) => AppendKeysError::Status404(v.into()), + RustAppendKeysError::Status500(v) => AppendKeysError::Status500(v.into()), + RustAppendKeysError::Statusdefault() => AppendKeysError::Statusdefault(), + RustAppendKeysError::DefaultResponse() => AppendKeysError::DefaultResponse(), + RustAppendKeysError::UnknownValue(v) => AppendKeysError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/client.rs b/crates/algod_client_ffi/src/apis/client.rs new file mode 100644 index 000000000..110c10d83 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/client.rs @@ -0,0 +1,813 @@ +#![allow(clippy::let_and_return)] + +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use super::Error; +use super::parameter_enums::*; +use crate::models::{ + AbortCatchup, Account, AccountApplicationInformation, AccountAssetInformation, + AccountAssetsInformation, AddParticipationKey, Application, Asset, DebugSettingsProf, + DryrunRequest, ErrorResponse, Genesis, GetApplicationBoxes, GetBlock, GetBlockHash, + GetBlockLogs, GetBlockTimeStampOffset, GetBlockTxids, GetPendingTransactions, + GetPendingTransactionsByAddress, GetStatus, GetSupply, GetSyncRound, + GetTransactionGroupLedgerStateDeltasForRound, LedgerStateDelta, LightBlockHeaderProof, + ParticipationKey, PendingTransactionResponse, RawTransaction, SimulateRequest, + SimulateTransaction, StartCatchup, StateProof, TealCompile, TealDisassemble, TealDryrun, + TransactionParams, TransactionProof, UnknownJsonValue, Version, WaitForBlock, +}; +use algod_client::AlgodClient as RustAlgodClient; +use algokit_http_client::{DefaultHttpClient, HttpClient}; +use std::sync::Arc; + +/// The main Algod API client. +/// +/// This client provides convenient access to all Algod API endpoints. +/// It wraps the lower-level endpoint functions with a more ergonomic interface. +/// All methods return a unified `Error` type that can represent any endpoint error. +#[derive(Clone, uniffi::Object)] +pub struct AlgodClient { + pub inner_algod_client: Arc, +} + +#[uniffi::export] +impl AlgodClient { + /// Create a new AlgodClient with a custom http client. + #[uniffi::constructor] + pub fn new(http_client: Arc) -> Self { + let inner_algod_client = Arc::new(RustAlgodClient::new(http_client.clone())); + Self { inner_algod_client } + } +} +#[uniffi::export] +#[async_trait::async_trait] +impl AlgodClientTrait for AlgodClient { + /// Returns OK if healthy. + async fn health_check(&self) -> Result<(), Error> { + self.inner_algod_client + .health_check() + .await + .map_err(|e| e.into()) + } + + /// Returns OK if healthy and fully caught up. + async fn get_ready(&self) -> Result<(), Error> { + self.inner_algod_client + .get_ready() + .await + .map_err(|e| e.into()) + } + + /// Return metrics about algod functioning. + async fn metrics(&self) -> Result<(), Error> { + self.inner_algod_client + .metrics() + .await + .map_err(|e| e.into()) + } + + /// Gets the genesis information. + async fn get_genesis(&self) -> Result { + self.inner_algod_client + .get_genesis() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Gets the current swagger spec. + async fn swagger_json(&self) -> Result { + self.inner_algod_client + .swagger_json() + .await + .map_err(|e| e.into()) + } + + /// Retrieves the supported API versions, binary build versions, and genesis information. + async fn get_version(&self) -> Result { + self.inner_algod_client + .get_version() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Retrieves the current settings for blocking and mutex profiles + async fn get_debug_settings_prof(&self) -> Result { + self.inner_algod_client + .get_debug_settings_prof() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Enables blocking and mutex profiles, and returns the old settings + async fn put_debug_settings_prof(&self) -> Result { + self.inner_algod_client + .put_debug_settings_prof() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Gets the merged config file. + async fn get_config(&self) -> Result { + self.inner_algod_client + .get_config() + .await + .map_err(|e| e.into()) + } + + /// Get account information. + async fn account_information( + &self, + address: String, + exclude: Option, + format: Option, + ) -> Result { + self.inner_algod_client + .account_information( + &address, + exclude.map(|v| v.into()), + format.map(|v| v.into()), + ) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get account information about a given asset. + async fn account_asset_information( + &self, + address: String, + asset_id: u64, + format: Option, + ) -> Result { + self.inner_algod_client + .account_asset_information(&address, asset_id, format.map(|v| v.into())) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a list of assets held by an account, inclusive of asset params. + async fn account_assets_information( + &self, + address: String, + limit: Option, + next: Option, + ) -> Result { + self.inner_algod_client + .account_assets_information(&address, limit, next.as_deref()) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get account information about a given app. + async fn account_application_information( + &self, + address: String, + application_id: u64, + format: Option, + ) -> Result { + self.inner_algod_client + .account_application_information(&address, application_id, format.map(|v| v.into())) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a list of unconfirmed transactions currently in the transaction pool by address. + async fn get_pending_transactions_by_address( + &self, + address: String, + max: Option, + ) -> Result { + self.inner_algod_client + .get_pending_transactions_by_address(&address, max) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get the block for the given round. + async fn get_block(&self, round: u64, header_only: Option) -> Result { + self.inner_algod_client + .get_block(round, header_only) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get the top level transaction IDs for the block on the given round. + async fn get_block_txids(&self, round: u64) -> Result { + self.inner_algod_client + .get_block_txids(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get the block hash for the block on the given round. + async fn get_block_hash(&self, round: u64) -> Result { + self.inner_algod_client + .get_block_hash(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a proof for a transaction in a block. + async fn get_transaction_proof( + &self, + round: u64, + txid: String, + hashtype: Option, + format: Option, + ) -> Result { + self.inner_algod_client + .get_transaction_proof( + round, + &txid, + hashtype.map(|v| v.into()), + format.map(|v| v.into()), + ) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get all of the logs from outer and inner app calls in the given round + async fn get_block_logs(&self, round: u64) -> Result { + self.inner_algod_client + .get_block_logs(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get the current supply reported by the ledger. + async fn get_supply(&self) -> Result { + self.inner_algod_client + .get_supply() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Return a list of participation keys + async fn get_participation_keys(&self) -> Result, Error> { + self.inner_algod_client + .get_participation_keys() + .await + .map(|v| v.into_iter().map(|item| item.into()).collect()) + .map_err(|e| e.into()) + } + + /// Add a participation key to the node + async fn add_participation_key(&self, request: Vec) -> Result { + self.inner_algod_client + .add_participation_key(request) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Generate and install participation keys to the node. + async fn generate_participation_keys( + &self, + address: String, + dilution: Option, + first: u64, + last: u64, + ) -> Result { + self.inner_algod_client + .generate_participation_keys(&address, dilution, first, last) + .await + .map_err(|e| e.into()) + } + + /// Get participation key info given a participation ID + async fn get_participation_key_by_id( + &self, + participation_id: String, + ) -> Result { + self.inner_algod_client + .get_participation_key_by_id(&participation_id) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Append state proof keys to a participation key + async fn append_keys( + &self, + request: Vec, + participation_id: String, + ) -> Result { + self.inner_algod_client + .append_keys(request, &participation_id) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Delete a given participation key by ID + async fn delete_participation_key_by_id(&self, participation_id: String) -> Result<(), Error> { + self.inner_algod_client + .delete_participation_key_by_id(&participation_id) + .await + .map_err(|e| e.into()) + } + + /// Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. + async fn shutdown_node(&self, timeout: Option) -> Result { + self.inner_algod_client + .shutdown_node(timeout) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Gets the current node status. + async fn get_status(&self) -> Result { + self.inner_algod_client + .get_status() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Gets the node status after waiting for a round after the given round. + async fn wait_for_block(&self, round: u64) -> Result { + self.inner_algod_client + .wait_for_block(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Broadcasts a raw transaction or transaction group to the network. + async fn raw_transaction(&self, request: Vec) -> Result { + self.inner_algod_client + .raw_transaction(request) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. + async fn raw_transaction_async(&self, request: Vec) -> Result<(), Error> { + self.inner_algod_client + .raw_transaction_async(request) + .await + .map_err(|e| e.into()) + } + + /// Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. + async fn simulate_transaction( + &self, + request: SimulateRequest, + format: Option, + ) -> Result { + self.inner_algod_client + .simulate_transaction(request.try_into()?, format.map(|v| v.into())) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get parameters for constructing a new transaction + async fn transaction_params(&self) -> Result { + self.inner_algod_client + .transaction_params() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a list of unconfirmed transactions currently in the transaction pool. + async fn get_pending_transactions( + &self, + max: Option, + ) -> Result { + self.inner_algod_client + .get_pending_transactions(max) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a specific pending transaction. + async fn pending_transaction_information( + &self, + txid: String, + ) -> Result { + self.inner_algod_client + .pending_transaction_information(&txid) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a LedgerStateDelta object for a given round + async fn get_ledger_state_delta(&self, round: u64) -> Result { + self.inner_algod_client + .get_ledger_state_delta(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get LedgerStateDelta objects for all transaction groups in a given round + async fn get_transaction_group_ledger_state_deltas_for_round( + &self, + round: u64, + ) -> Result { + self.inner_algod_client + .get_transaction_group_ledger_state_deltas_for_round(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a LedgerStateDelta object for a given transaction group + async fn get_ledger_state_delta_for_transaction_group( + &self, + id: String, + ) -> Result { + self.inner_algod_client + .get_ledger_state_delta_for_transaction_group(&id) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get a state proof that covers a given round + async fn get_state_proof(&self, round: u64) -> Result { + self.inner_algod_client + .get_state_proof(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Gets a proof for a given light block header inside a state proof commitment + async fn get_light_block_header_proof( + &self, + round: u64, + ) -> Result { + self.inner_algod_client + .get_light_block_header_proof(round) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get application information. + async fn get_application_by_id(&self, application_id: u64) -> Result { + self.inner_algod_client + .get_application_by_id(application_id) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get all box names for a given application. + async fn get_application_boxes( + &self, + application_id: u64, + max: Option, + ) -> Result { + self.inner_algod_client + .get_application_boxes(application_id, max) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get box information for a given application. + async fn get_application_box_by_name( + &self, + application_id: u64, + name: String, + ) -> Result { + self.inner_algod_client + .get_application_box_by_name(application_id, &name) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Get asset information. + async fn get_asset_by_id(&self, asset_id: u64) -> Result { + self.inner_algod_client + .get_asset_by_id(asset_id) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Returns the minimum sync round the ledger is keeping in cache. + async fn get_sync_round(&self) -> Result { + self.inner_algod_client + .get_sync_round() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Removes minimum sync round restriction from the ledger. + async fn unset_sync_round(&self) -> Result<(), Error> { + self.inner_algod_client + .unset_sync_round() + .await + .map_err(|e| e.into()) + } + + /// Given a round, tells the ledger to keep that round in its cache. + async fn set_sync_round(&self, round: u64) -> Result<(), Error> { + self.inner_algod_client + .set_sync_round(round) + .await + .map_err(|e| e.into()) + } + + /// Compile TEAL source code to binary, produce its hash + async fn teal_compile( + &self, + request: Vec, + sourcemap: Option, + ) -> Result { + self.inner_algod_client + .teal_compile(request, sourcemap) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Disassemble program bytes into the TEAL source code. + async fn teal_disassemble(&self, request: String) -> Result { + self.inner_algod_client + .teal_disassemble(request) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Starts a catchpoint catchup. + async fn start_catchup( + &self, + catchpoint: String, + min: Option, + ) -> Result { + self.inner_algod_client + .start_catchup(&catchpoint, min) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Aborts a catchpoint catchup. + async fn abort_catchup(&self, catchpoint: String) -> Result { + self.inner_algod_client + .abort_catchup(&catchpoint) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Provide debugging information for a transaction (or group). + async fn teal_dryrun(&self, request: Option) -> Result { + self.inner_algod_client + .teal_dryrun(request.map(|v| v.try_into()).transpose()?) + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Returns OK if experimental API is enabled. + async fn experimental_check(&self) -> Result<(), Error> { + self.inner_algod_client + .experimental_check() + .await + .map_err(|e| e.into()) + } + + /// Returns the timestamp offset. Timestamp offsets can only be set in dev mode. + async fn get_block_time_stamp_offset(&self) -> Result { + self.inner_algod_client + .get_block_time_stamp_offset() + .await + .map(|v| v.into()) + .map_err(|e| e.into()) + } + + /// Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. + async fn set_block_time_stamp_offset(&self, offset: u64) -> Result<(), Error> { + self.inner_algod_client + .set_block_time_stamp_offset(offset) + .await + .map_err(|e| e.into()) + } +} +#[uniffi::export(with_foreign)] +#[async_trait::async_trait] +pub trait AlgodClientTrait: Send + Sync { + /// Returns OK if healthy. + async fn health_check(&self) -> Result<(), Error>; + /// Returns OK if healthy and fully caught up. + async fn get_ready(&self) -> Result<(), Error>; + /// Return metrics about algod functioning. + async fn metrics(&self) -> Result<(), Error>; + /// Gets the genesis information. + async fn get_genesis(&self) -> Result; + /// Gets the current swagger spec. + async fn swagger_json(&self) -> Result; + /// Retrieves the supported API versions, binary build versions, and genesis information. + async fn get_version(&self) -> Result; + /// Retrieves the current settings for blocking and mutex profiles + async fn get_debug_settings_prof(&self) -> Result; + /// Enables blocking and mutex profiles, and returns the old settings + async fn put_debug_settings_prof(&self) -> Result; + /// Gets the merged config file. + async fn get_config(&self) -> Result; + /// Get account information. + async fn account_information( + &self, + address: String, + exclude: Option, + format: Option, + ) -> Result; + /// Get account information about a given asset. + async fn account_asset_information( + &self, + address: String, + asset_id: u64, + format: Option, + ) -> Result; + /// Get a list of assets held by an account, inclusive of asset params. + async fn account_assets_information( + &self, + address: String, + limit: Option, + next: Option, + ) -> Result; + /// Get account information about a given app. + async fn account_application_information( + &self, + address: String, + application_id: u64, + format: Option, + ) -> Result; + /// Get a list of unconfirmed transactions currently in the transaction pool by address. + async fn get_pending_transactions_by_address( + &self, + address: String, + max: Option, + ) -> Result; + /// Get the block for the given round. + async fn get_block(&self, round: u64, header_only: Option) -> Result; + /// Get the top level transaction IDs for the block on the given round. + async fn get_block_txids(&self, round: u64) -> Result; + /// Get the block hash for the block on the given round. + async fn get_block_hash(&self, round: u64) -> Result; + /// Get a proof for a transaction in a block. + async fn get_transaction_proof( + &self, + round: u64, + txid: String, + hashtype: Option, + format: Option, + ) -> Result; + /// Get all of the logs from outer and inner app calls in the given round + async fn get_block_logs(&self, round: u64) -> Result; + /// Get the current supply reported by the ledger. + async fn get_supply(&self) -> Result; + /// Return a list of participation keys + async fn get_participation_keys(&self) -> Result, Error>; + /// Add a participation key to the node + async fn add_participation_key(&self, request: Vec) -> Result; + /// Generate and install participation keys to the node. + async fn generate_participation_keys( + &self, + address: String, + dilution: Option, + first: u64, + last: u64, + ) -> Result; + /// Get participation key info given a participation ID + async fn get_participation_key_by_id( + &self, + participation_id: String, + ) -> Result; + /// Append state proof keys to a participation key + async fn append_keys( + &self, + request: Vec, + participation_id: String, + ) -> Result; + /// Delete a given participation key by ID + async fn delete_participation_key_by_id(&self, participation_id: String) -> Result<(), Error>; + /// Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. + async fn shutdown_node(&self, timeout: Option) -> Result; + /// Gets the current node status. + async fn get_status(&self) -> Result; + /// Gets the node status after waiting for a round after the given round. + async fn wait_for_block(&self, round: u64) -> Result; + /// Broadcasts a raw transaction or transaction group to the network. + async fn raw_transaction(&self, request: Vec) -> Result; + /// Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. + async fn raw_transaction_async(&self, request: Vec) -> Result<(), Error>; + /// Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. + async fn simulate_transaction( + &self, + request: SimulateRequest, + format: Option, + ) -> Result; + /// Get parameters for constructing a new transaction + async fn transaction_params(&self) -> Result; + /// Get a list of unconfirmed transactions currently in the transaction pool. + async fn get_pending_transactions( + &self, + max: Option, + ) -> Result; + /// Get a specific pending transaction. + async fn pending_transaction_information( + &self, + txid: String, + ) -> Result; + /// Get a LedgerStateDelta object for a given round + async fn get_ledger_state_delta(&self, round: u64) -> Result; + /// Get LedgerStateDelta objects for all transaction groups in a given round + async fn get_transaction_group_ledger_state_deltas_for_round( + &self, + round: u64, + ) -> Result; + /// Get a LedgerStateDelta object for a given transaction group + async fn get_ledger_state_delta_for_transaction_group( + &self, + id: String, + ) -> Result; + /// Get a state proof that covers a given round + async fn get_state_proof(&self, round: u64) -> Result; + /// Gets a proof for a given light block header inside a state proof commitment + async fn get_light_block_header_proof( + &self, + round: u64, + ) -> Result; + /// Get application information. + async fn get_application_by_id(&self, application_id: u64) -> Result; + /// Get all box names for a given application. + async fn get_application_boxes( + &self, + application_id: u64, + max: Option, + ) -> Result; + /// Get box information for a given application. + async fn get_application_box_by_name( + &self, + application_id: u64, + name: String, + ) -> Result; + /// Get asset information. + async fn get_asset_by_id(&self, asset_id: u64) -> Result; + /// Returns the minimum sync round the ledger is keeping in cache. + async fn get_sync_round(&self) -> Result; + /// Removes minimum sync round restriction from the ledger. + async fn unset_sync_round(&self) -> Result<(), Error>; + /// Given a round, tells the ledger to keep that round in its cache. + async fn set_sync_round(&self, round: u64) -> Result<(), Error>; + /// Compile TEAL source code to binary, produce its hash + async fn teal_compile( + &self, + request: Vec, + sourcemap: Option, + ) -> Result; + /// Disassemble program bytes into the TEAL source code. + async fn teal_disassemble(&self, request: String) -> Result; + /// Starts a catchpoint catchup. + async fn start_catchup( + &self, + catchpoint: String, + min: Option, + ) -> Result; + /// Aborts a catchpoint catchup. + async fn abort_catchup(&self, catchpoint: String) -> Result; + /// Provide debugging information for a transaction (or group). + async fn teal_dryrun(&self, request: Option) -> Result; + /// Returns OK if experimental API is enabled. + async fn experimental_check(&self) -> Result<(), Error>; + /// Returns the timestamp offset. Timestamp offsets can only be set in dev mode. + async fn get_block_time_stamp_offset(&self) -> Result; + /// Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. + async fn set_block_time_stamp_offset(&self, offset: u64) -> Result<(), Error>; +} diff --git a/crates/algod_client_ffi/src/apis/delete_participation_key_by_id.rs b/crates/algod_client_ffi/src/apis/delete_participation_key_by_id.rs new file mode 100644 index 000000000..1cab5d60e --- /dev/null +++ b/crates/algod_client_ffi/src/apis/delete_participation_key_by_id.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::DeleteParticipationKeyByIdError as RustDeleteParticipationKeyByIdError; + +// Import all custom types used by this endpoint +use crate::models::ErrorResponse; + +// Import request body type if needed + +/// struct for typed errors of method [`delete_participation_key_by_id`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum DeleteParticipationKeyByIdError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for DeleteParticipationKeyByIdError { + fn from(e: RustDeleteParticipationKeyByIdError) -> Self { + match e { + RustDeleteParticipationKeyByIdError::Status400(v) => { + DeleteParticipationKeyByIdError::Status400(v.into()) + } + RustDeleteParticipationKeyByIdError::Status401(v) => { + DeleteParticipationKeyByIdError::Status401(v.into()) + } + RustDeleteParticipationKeyByIdError::Status404(v) => { + DeleteParticipationKeyByIdError::Status404(v.into()) + } + RustDeleteParticipationKeyByIdError::Status500(v) => { + DeleteParticipationKeyByIdError::Status500(v.into()) + } + RustDeleteParticipationKeyByIdError::Statusdefault() => { + DeleteParticipationKeyByIdError::Statusdefault() + } + RustDeleteParticipationKeyByIdError::DefaultResponse() => { + DeleteParticipationKeyByIdError::DefaultResponse() + } + RustDeleteParticipationKeyByIdError::UnknownValue(v) => { + DeleteParticipationKeyByIdError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/experimental_check.rs b/crates/algod_client_ffi/src/apis/experimental_check.rs new file mode 100644 index 000000000..5a95f6ed5 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/experimental_check.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::ExperimentalCheckError as RustExperimentalCheckError; + +// Import all custom types used by this endpoint + +// Import request body type if needed + +/// struct for typed errors of method [`experimental_check`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum ExperimentalCheckError { + Status404(), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for ExperimentalCheckError { + fn from(e: RustExperimentalCheckError) -> Self { + match e { + RustExperimentalCheckError::Status404() => ExperimentalCheckError::Status404(), + RustExperimentalCheckError::Statusdefault() => ExperimentalCheckError::Statusdefault(), + RustExperimentalCheckError::DefaultResponse() => { + ExperimentalCheckError::DefaultResponse() + } + RustExperimentalCheckError::UnknownValue(v) => { + ExperimentalCheckError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/generate_participation_keys.rs b/crates/algod_client_ffi/src/apis/generate_participation_keys.rs new file mode 100644 index 000000000..670667241 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/generate_participation_keys.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GenerateParticipationKeysError as RustGenerateParticipationKeysError; + +// Import all custom types used by this endpoint +use crate::models::ErrorResponse; + +// Import request body type if needed + +/// struct for typed errors of method [`generate_participation_keys`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GenerateParticipationKeysError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GenerateParticipationKeysError { + fn from(e: RustGenerateParticipationKeysError) -> Self { + match e { + RustGenerateParticipationKeysError::Status400(v) => { + GenerateParticipationKeysError::Status400(v.into()) + } + RustGenerateParticipationKeysError::Status401(v) => { + GenerateParticipationKeysError::Status401(v.into()) + } + RustGenerateParticipationKeysError::Status500(v) => { + GenerateParticipationKeysError::Status500(v.into()) + } + RustGenerateParticipationKeysError::Status503(v) => { + GenerateParticipationKeysError::Status503(v.into()) + } + RustGenerateParticipationKeysError::Statusdefault() => { + GenerateParticipationKeysError::Statusdefault() + } + RustGenerateParticipationKeysError::DefaultResponse() => { + GenerateParticipationKeysError::DefaultResponse() + } + RustGenerateParticipationKeysError::UnknownValue(v) => { + GenerateParticipationKeysError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_application_box_by_name.rs b/crates/algod_client_ffi/src/apis/get_application_box_by_name.rs new file mode 100644 index 000000000..798982fce --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_application_box_by_name.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetApplicationBoxByNameError as RustGetApplicationBoxByNameError; + +// Import all custom types used by this endpoint +use crate::models::{Box, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_application_box_by_name`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetApplicationBoxByNameError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetApplicationBoxByNameError { + fn from(e: RustGetApplicationBoxByNameError) -> Self { + match e { + RustGetApplicationBoxByNameError::Status400(v) => { + GetApplicationBoxByNameError::Status400(v.into()) + } + RustGetApplicationBoxByNameError::Status401(v) => { + GetApplicationBoxByNameError::Status401(v.into()) + } + RustGetApplicationBoxByNameError::Status404(v) => { + GetApplicationBoxByNameError::Status404(v.into()) + } + RustGetApplicationBoxByNameError::Status500(v) => { + GetApplicationBoxByNameError::Status500(v.into()) + } + RustGetApplicationBoxByNameError::Statusdefault() => { + GetApplicationBoxByNameError::Statusdefault() + } + RustGetApplicationBoxByNameError::DefaultResponse() => { + GetApplicationBoxByNameError::DefaultResponse() + } + RustGetApplicationBoxByNameError::UnknownValue(v) => { + GetApplicationBoxByNameError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_application_boxes.rs b/crates/algod_client_ffi/src/apis/get_application_boxes.rs new file mode 100644 index 000000000..abe80010b --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_application_boxes.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetApplicationBoxesError as RustGetApplicationBoxesError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetApplicationBoxes}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_application_boxes`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetApplicationBoxesError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetApplicationBoxesError { + fn from(e: RustGetApplicationBoxesError) -> Self { + match e { + RustGetApplicationBoxesError::Status400(v) => { + GetApplicationBoxesError::Status400(v.into()) + } + RustGetApplicationBoxesError::Status401(v) => { + GetApplicationBoxesError::Status401(v.into()) + } + RustGetApplicationBoxesError::Status500(v) => { + GetApplicationBoxesError::Status500(v.into()) + } + RustGetApplicationBoxesError::Statusdefault() => { + GetApplicationBoxesError::Statusdefault() + } + RustGetApplicationBoxesError::DefaultResponse() => { + GetApplicationBoxesError::DefaultResponse() + } + RustGetApplicationBoxesError::UnknownValue(v) => { + GetApplicationBoxesError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_application_by_id.rs b/crates/algod_client_ffi/src/apis/get_application_by_id.rs new file mode 100644 index 000000000..54ac4784b --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_application_by_id.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetApplicationByIdError as RustGetApplicationByIdError; + +// Import all custom types used by this endpoint +use crate::models::{Application, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_application_by_id`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetApplicationByIdError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetApplicationByIdError { + fn from(e: RustGetApplicationByIdError) -> Self { + match e { + RustGetApplicationByIdError::Status400(v) => { + GetApplicationByIdError::Status400(v.into()) + } + RustGetApplicationByIdError::Status401(v) => { + GetApplicationByIdError::Status401(v.into()) + } + RustGetApplicationByIdError::Status404(v) => { + GetApplicationByIdError::Status404(v.into()) + } + RustGetApplicationByIdError::Status500(v) => { + GetApplicationByIdError::Status500(v.into()) + } + RustGetApplicationByIdError::Statusdefault() => { + GetApplicationByIdError::Statusdefault() + } + RustGetApplicationByIdError::DefaultResponse() => { + GetApplicationByIdError::DefaultResponse() + } + RustGetApplicationByIdError::UnknownValue(v) => { + GetApplicationByIdError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_asset_by_id.rs b/crates/algod_client_ffi/src/apis/get_asset_by_id.rs new file mode 100644 index 000000000..7fd5891ad --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_asset_by_id.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetAssetByIdError as RustGetAssetByIdError; + +// Import all custom types used by this endpoint +use crate::models::{Asset, ErrorResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_asset_by_id`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetAssetByIdError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetAssetByIdError { + fn from(e: RustGetAssetByIdError) -> Self { + match e { + RustGetAssetByIdError::Status400(v) => GetAssetByIdError::Status400(v.into()), + RustGetAssetByIdError::Status401(v) => GetAssetByIdError::Status401(v.into()), + RustGetAssetByIdError::Status404(v) => GetAssetByIdError::Status404(v.into()), + RustGetAssetByIdError::Status500(v) => GetAssetByIdError::Status500(v.into()), + RustGetAssetByIdError::Statusdefault() => GetAssetByIdError::Statusdefault(), + RustGetAssetByIdError::DefaultResponse() => GetAssetByIdError::DefaultResponse(), + RustGetAssetByIdError::UnknownValue(v) => GetAssetByIdError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_block.rs b/crates/algod_client_ffi/src/apis/get_block.rs new file mode 100644 index 000000000..545312046 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_block.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetBlockError as RustGetBlockError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetBlock}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_block`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetBlockError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetBlockError { + fn from(e: RustGetBlockError) -> Self { + match e { + RustGetBlockError::Status400(v) => GetBlockError::Status400(v.into()), + RustGetBlockError::Status401(v) => GetBlockError::Status401(v.into()), + RustGetBlockError::Status404(v) => GetBlockError::Status404(v.into()), + RustGetBlockError::Status500(v) => GetBlockError::Status500(v.into()), + RustGetBlockError::Statusdefault() => GetBlockError::Statusdefault(), + RustGetBlockError::DefaultResponse() => GetBlockError::DefaultResponse(), + RustGetBlockError::UnknownValue(v) => GetBlockError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_block_hash.rs b/crates/algod_client_ffi/src/apis/get_block_hash.rs new file mode 100644 index 000000000..bb0edc5d1 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_block_hash.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetBlockHashError as RustGetBlockHashError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetBlockHash}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_block_hash`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetBlockHashError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetBlockHashError { + fn from(e: RustGetBlockHashError) -> Self { + match e { + RustGetBlockHashError::Status400(v) => GetBlockHashError::Status400(v.into()), + RustGetBlockHashError::Status401(v) => GetBlockHashError::Status401(v.into()), + RustGetBlockHashError::Status404(v) => GetBlockHashError::Status404(v.into()), + RustGetBlockHashError::Status500(v) => GetBlockHashError::Status500(v.into()), + RustGetBlockHashError::Statusdefault() => GetBlockHashError::Statusdefault(), + RustGetBlockHashError::DefaultResponse() => GetBlockHashError::DefaultResponse(), + RustGetBlockHashError::UnknownValue(v) => GetBlockHashError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_block_logs.rs b/crates/algod_client_ffi/src/apis/get_block_logs.rs new file mode 100644 index 000000000..ba1b3e31a --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_block_logs.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetBlockLogsError as RustGetBlockLogsError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetBlockLogs}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_block_logs`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetBlockLogsError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetBlockLogsError { + fn from(e: RustGetBlockLogsError) -> Self { + match e { + RustGetBlockLogsError::Status400(v) => GetBlockLogsError::Status400(v.into()), + RustGetBlockLogsError::Status401(v) => GetBlockLogsError::Status401(v.into()), + RustGetBlockLogsError::Status404(v) => GetBlockLogsError::Status404(v.into()), + RustGetBlockLogsError::Status500(v) => GetBlockLogsError::Status500(v.into()), + RustGetBlockLogsError::DefaultResponse() => GetBlockLogsError::DefaultResponse(), + RustGetBlockLogsError::UnknownValue(v) => GetBlockLogsError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_block_time_stamp_offset.rs b/crates/algod_client_ffi/src/apis/get_block_time_stamp_offset.rs new file mode 100644 index 000000000..6af602721 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_block_time_stamp_offset.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetBlockTimeStampOffsetError as RustGetBlockTimeStampOffsetError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetBlockTimeStampOffset}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_block_time_stamp_offset`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetBlockTimeStampOffsetError { + Status400(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetBlockTimeStampOffsetError { + fn from(e: RustGetBlockTimeStampOffsetError) -> Self { + match e { + RustGetBlockTimeStampOffsetError::Status400(v) => { + GetBlockTimeStampOffsetError::Status400(v.into()) + } + RustGetBlockTimeStampOffsetError::Statusdefault() => { + GetBlockTimeStampOffsetError::Statusdefault() + } + RustGetBlockTimeStampOffsetError::DefaultResponse() => { + GetBlockTimeStampOffsetError::DefaultResponse() + } + RustGetBlockTimeStampOffsetError::UnknownValue(v) => { + GetBlockTimeStampOffsetError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_block_txids.rs b/crates/algod_client_ffi/src/apis/get_block_txids.rs new file mode 100644 index 000000000..84d015981 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_block_txids.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetBlockTxidsError as RustGetBlockTxidsError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetBlockTxids}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_block_txids`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetBlockTxidsError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetBlockTxidsError { + fn from(e: RustGetBlockTxidsError) -> Self { + match e { + RustGetBlockTxidsError::Status400(v) => GetBlockTxidsError::Status400(v.into()), + RustGetBlockTxidsError::Status401(v) => GetBlockTxidsError::Status401(v.into()), + RustGetBlockTxidsError::Status404(v) => GetBlockTxidsError::Status404(v.into()), + RustGetBlockTxidsError::Status500(v) => GetBlockTxidsError::Status500(v.into()), + RustGetBlockTxidsError::Statusdefault() => GetBlockTxidsError::Statusdefault(), + RustGetBlockTxidsError::DefaultResponse() => GetBlockTxidsError::DefaultResponse(), + RustGetBlockTxidsError::UnknownValue(v) => GetBlockTxidsError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_config.rs b/crates/algod_client_ffi/src/apis/get_config.rs new file mode 100644 index 000000000..1962a4412 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_config.rs @@ -0,0 +1,37 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetConfigError as RustGetConfigError; + +// Import all custom types used by this endpoint + +// Import request body type if needed + +/// struct for typed errors of method [`get_config`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetConfigError { + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetConfigError { + fn from(e: RustGetConfigError) -> Self { + match e { + RustGetConfigError::Statusdefault() => GetConfigError::Statusdefault(), + RustGetConfigError::DefaultResponse() => GetConfigError::DefaultResponse(), + RustGetConfigError::UnknownValue(v) => GetConfigError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_debug_settings_prof.rs b/crates/algod_client_ffi/src/apis/get_debug_settings_prof.rs new file mode 100644 index 000000000..e1bb9790a --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_debug_settings_prof.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetDebugSettingsProfError as RustGetDebugSettingsProfError; + +// Import all custom types used by this endpoint +use crate::models::DebugSettingsProf; + +// Import request body type if needed + +/// struct for typed errors of method [`get_debug_settings_prof`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetDebugSettingsProfError { + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetDebugSettingsProfError { + fn from(e: RustGetDebugSettingsProfError) -> Self { + match e { + RustGetDebugSettingsProfError::DefaultResponse() => { + GetDebugSettingsProfError::DefaultResponse() + } + RustGetDebugSettingsProfError::UnknownValue(v) => { + GetDebugSettingsProfError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_genesis.rs b/crates/algod_client_ffi/src/apis/get_genesis.rs new file mode 100644 index 000000000..205e974b1 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_genesis.rs @@ -0,0 +1,38 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetGenesisError as RustGetGenesisError; + +// Import all custom types used by this endpoint +use crate::models::Genesis; + +// Import request body type if needed + +/// struct for typed errors of method [`get_genesis`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetGenesisError { + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetGenesisError { + fn from(e: RustGetGenesisError) -> Self { + match e { + RustGetGenesisError::Statusdefault() => GetGenesisError::Statusdefault(), + RustGetGenesisError::DefaultResponse() => GetGenesisError::DefaultResponse(), + RustGetGenesisError::UnknownValue(v) => GetGenesisError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_ledger_state_delta.rs b/crates/algod_client_ffi/src/apis/get_ledger_state_delta.rs new file mode 100644 index 000000000..639a829b5 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_ledger_state_delta.rs @@ -0,0 +1,64 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetLedgerStateDeltaError as RustGetLedgerStateDeltaError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, LedgerStateDelta}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_ledger_state_delta`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetLedgerStateDeltaError { + Status401(ErrorResponse), + Status404(ErrorResponse), + Status408(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetLedgerStateDeltaError { + fn from(e: RustGetLedgerStateDeltaError) -> Self { + match e { + RustGetLedgerStateDeltaError::Status401(v) => { + GetLedgerStateDeltaError::Status401(v.into()) + } + RustGetLedgerStateDeltaError::Status404(v) => { + GetLedgerStateDeltaError::Status404(v.into()) + } + RustGetLedgerStateDeltaError::Status408(v) => { + GetLedgerStateDeltaError::Status408(v.into()) + } + RustGetLedgerStateDeltaError::Status500(v) => { + GetLedgerStateDeltaError::Status500(v.into()) + } + RustGetLedgerStateDeltaError::Status503(v) => { + GetLedgerStateDeltaError::Status503(v.into()) + } + RustGetLedgerStateDeltaError::Statusdefault() => { + GetLedgerStateDeltaError::Statusdefault() + } + RustGetLedgerStateDeltaError::DefaultResponse() => { + GetLedgerStateDeltaError::DefaultResponse() + } + RustGetLedgerStateDeltaError::UnknownValue(v) => { + GetLedgerStateDeltaError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_ledger_state_delta_for_transaction_group.rs b/crates/algod_client_ffi/src/apis/get_ledger_state_delta_for_transaction_group.rs new file mode 100644 index 000000000..2567cc261 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_ledger_state_delta_for_transaction_group.rs @@ -0,0 +1,66 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetLedgerStateDeltaForTransactionGroupError as RustGetLedgerStateDeltaForTransactionGroupError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, LedgerStateDelta}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_ledger_state_delta_for_transaction_group`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetLedgerStateDeltaForTransactionGroupError { + Status401(ErrorResponse), + Status404(ErrorResponse), + Status408(ErrorResponse), + Status500(ErrorResponse), + Status501(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From + for GetLedgerStateDeltaForTransactionGroupError +{ + fn from(e: RustGetLedgerStateDeltaForTransactionGroupError) -> Self { + match e { + RustGetLedgerStateDeltaForTransactionGroupError::Status401(v) => { + GetLedgerStateDeltaForTransactionGroupError::Status401(v.into()) + } + RustGetLedgerStateDeltaForTransactionGroupError::Status404(v) => { + GetLedgerStateDeltaForTransactionGroupError::Status404(v.into()) + } + RustGetLedgerStateDeltaForTransactionGroupError::Status408(v) => { + GetLedgerStateDeltaForTransactionGroupError::Status408(v.into()) + } + RustGetLedgerStateDeltaForTransactionGroupError::Status500(v) => { + GetLedgerStateDeltaForTransactionGroupError::Status500(v.into()) + } + RustGetLedgerStateDeltaForTransactionGroupError::Status501(v) => { + GetLedgerStateDeltaForTransactionGroupError::Status501(v.into()) + } + RustGetLedgerStateDeltaForTransactionGroupError::Statusdefault() => { + GetLedgerStateDeltaForTransactionGroupError::Statusdefault() + } + RustGetLedgerStateDeltaForTransactionGroupError::DefaultResponse() => { + GetLedgerStateDeltaForTransactionGroupError::DefaultResponse() + } + RustGetLedgerStateDeltaForTransactionGroupError::UnknownValue(v) => { + GetLedgerStateDeltaForTransactionGroupError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_light_block_header_proof.rs b/crates/algod_client_ffi/src/apis/get_light_block_header_proof.rs new file mode 100644 index 000000000..492a14f8b --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_light_block_header_proof.rs @@ -0,0 +1,64 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetLightBlockHeaderProofError as RustGetLightBlockHeaderProofError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, LightBlockHeaderProof}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_light_block_header_proof`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetLightBlockHeaderProofError { + Status401(ErrorResponse), + Status404(ErrorResponse), + Status408(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetLightBlockHeaderProofError { + fn from(e: RustGetLightBlockHeaderProofError) -> Self { + match e { + RustGetLightBlockHeaderProofError::Status401(v) => { + GetLightBlockHeaderProofError::Status401(v.into()) + } + RustGetLightBlockHeaderProofError::Status404(v) => { + GetLightBlockHeaderProofError::Status404(v.into()) + } + RustGetLightBlockHeaderProofError::Status408(v) => { + GetLightBlockHeaderProofError::Status408(v.into()) + } + RustGetLightBlockHeaderProofError::Status500(v) => { + GetLightBlockHeaderProofError::Status500(v.into()) + } + RustGetLightBlockHeaderProofError::Status503(v) => { + GetLightBlockHeaderProofError::Status503(v.into()) + } + RustGetLightBlockHeaderProofError::Statusdefault() => { + GetLightBlockHeaderProofError::Statusdefault() + } + RustGetLightBlockHeaderProofError::DefaultResponse() => { + GetLightBlockHeaderProofError::DefaultResponse() + } + RustGetLightBlockHeaderProofError::UnknownValue(v) => { + GetLightBlockHeaderProofError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_participation_key_by_id.rs b/crates/algod_client_ffi/src/apis/get_participation_key_by_id.rs new file mode 100644 index 000000000..01023c4e4 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_participation_key_by_id.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetParticipationKeyByIdError as RustGetParticipationKeyByIdError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, ParticipationKey}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_participation_key_by_id`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetParticipationKeyByIdError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetParticipationKeyByIdError { + fn from(e: RustGetParticipationKeyByIdError) -> Self { + match e { + RustGetParticipationKeyByIdError::Status400(v) => { + GetParticipationKeyByIdError::Status400(v.into()) + } + RustGetParticipationKeyByIdError::Status401(v) => { + GetParticipationKeyByIdError::Status401(v.into()) + } + RustGetParticipationKeyByIdError::Status404(v) => { + GetParticipationKeyByIdError::Status404(v.into()) + } + RustGetParticipationKeyByIdError::Status500(v) => { + GetParticipationKeyByIdError::Status500(v.into()) + } + RustGetParticipationKeyByIdError::Statusdefault() => { + GetParticipationKeyByIdError::Statusdefault() + } + RustGetParticipationKeyByIdError::DefaultResponse() => { + GetParticipationKeyByIdError::DefaultResponse() + } + RustGetParticipationKeyByIdError::UnknownValue(v) => { + GetParticipationKeyByIdError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_participation_keys.rs b/crates/algod_client_ffi/src/apis/get_participation_keys.rs new file mode 100644 index 000000000..1695cb77f --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_participation_keys.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetParticipationKeysError as RustGetParticipationKeysError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, ParticipationKey}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_participation_keys`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetParticipationKeysError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetParticipationKeysError { + fn from(e: RustGetParticipationKeysError) -> Self { + match e { + RustGetParticipationKeysError::Status400(v) => { + GetParticipationKeysError::Status400(v.into()) + } + RustGetParticipationKeysError::Status401(v) => { + GetParticipationKeysError::Status401(v.into()) + } + RustGetParticipationKeysError::Status404(v) => { + GetParticipationKeysError::Status404(v.into()) + } + RustGetParticipationKeysError::Status500(v) => { + GetParticipationKeysError::Status500(v.into()) + } + RustGetParticipationKeysError::Statusdefault() => { + GetParticipationKeysError::Statusdefault() + } + RustGetParticipationKeysError::DefaultResponse() => { + GetParticipationKeysError::DefaultResponse() + } + RustGetParticipationKeysError::UnknownValue(v) => { + GetParticipationKeysError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_pending_transactions.rs b/crates/algod_client_ffi/src/apis/get_pending_transactions.rs new file mode 100644 index 000000000..e7145eff5 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_pending_transactions.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetPendingTransactionsError as RustGetPendingTransactionsError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetPendingTransactions}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_pending_transactions`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetPendingTransactionsError { + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetPendingTransactionsError { + fn from(e: RustGetPendingTransactionsError) -> Self { + match e { + RustGetPendingTransactionsError::Status401(v) => { + GetPendingTransactionsError::Status401(v.into()) + } + RustGetPendingTransactionsError::Status500(v) => { + GetPendingTransactionsError::Status500(v.into()) + } + RustGetPendingTransactionsError::Status503(v) => { + GetPendingTransactionsError::Status503(v.into()) + } + RustGetPendingTransactionsError::Statusdefault() => { + GetPendingTransactionsError::Statusdefault() + } + RustGetPendingTransactionsError::DefaultResponse() => { + GetPendingTransactionsError::DefaultResponse() + } + RustGetPendingTransactionsError::UnknownValue(v) => { + GetPendingTransactionsError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_pending_transactions_by_address.rs b/crates/algod_client_ffi/src/apis/get_pending_transactions_by_address.rs new file mode 100644 index 000000000..a37dbcec8 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_pending_transactions_by_address.rs @@ -0,0 +1,60 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetPendingTransactionsByAddressError as RustGetPendingTransactionsByAddressError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetPendingTransactionsByAddress}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_pending_transactions_by_address`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetPendingTransactionsByAddressError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetPendingTransactionsByAddressError { + fn from(e: RustGetPendingTransactionsByAddressError) -> Self { + match e { + RustGetPendingTransactionsByAddressError::Status400(v) => { + GetPendingTransactionsByAddressError::Status400(v.into()) + } + RustGetPendingTransactionsByAddressError::Status401(v) => { + GetPendingTransactionsByAddressError::Status401(v.into()) + } + RustGetPendingTransactionsByAddressError::Status500(v) => { + GetPendingTransactionsByAddressError::Status500(v.into()) + } + RustGetPendingTransactionsByAddressError::Status503(v) => { + GetPendingTransactionsByAddressError::Status503(v.into()) + } + RustGetPendingTransactionsByAddressError::Statusdefault() => { + GetPendingTransactionsByAddressError::Statusdefault() + } + RustGetPendingTransactionsByAddressError::DefaultResponse() => { + GetPendingTransactionsByAddressError::DefaultResponse() + } + RustGetPendingTransactionsByAddressError::UnknownValue(v) => { + GetPendingTransactionsByAddressError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_ready.rs b/crates/algod_client_ffi/src/apis/get_ready.rs new file mode 100644 index 000000000..507cb9215 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_ready.rs @@ -0,0 +1,41 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetReadyError as RustGetReadyError; + +// Import all custom types used by this endpoint + +// Import request body type if needed + +/// struct for typed errors of method [`get_ready`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetReadyError { + Status500(), + Status503(), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetReadyError { + fn from(e: RustGetReadyError) -> Self { + match e { + RustGetReadyError::Status500() => GetReadyError::Status500(), + RustGetReadyError::Status503() => GetReadyError::Status503(), + RustGetReadyError::Statusdefault() => GetReadyError::Statusdefault(), + RustGetReadyError::DefaultResponse() => GetReadyError::DefaultResponse(), + RustGetReadyError::UnknownValue(v) => GetReadyError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_state_proof.rs b/crates/algod_client_ffi/src/apis/get_state_proof.rs new file mode 100644 index 000000000..1543a983a --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_state_proof.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetStateProofError as RustGetStateProofError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, StateProof}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_state_proof`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetStateProofError { + Status401(ErrorResponse), + Status404(ErrorResponse), + Status408(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetStateProofError { + fn from(e: RustGetStateProofError) -> Self { + match e { + RustGetStateProofError::Status401(v) => GetStateProofError::Status401(v.into()), + RustGetStateProofError::Status404(v) => GetStateProofError::Status404(v.into()), + RustGetStateProofError::Status408(v) => GetStateProofError::Status408(v.into()), + RustGetStateProofError::Status500(v) => GetStateProofError::Status500(v.into()), + RustGetStateProofError::Status503(v) => GetStateProofError::Status503(v.into()), + RustGetStateProofError::Statusdefault() => GetStateProofError::Statusdefault(), + RustGetStateProofError::DefaultResponse() => GetStateProofError::DefaultResponse(), + RustGetStateProofError::UnknownValue(v) => GetStateProofError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_status.rs b/crates/algod_client_ffi/src/apis/get_status.rs new file mode 100644 index 000000000..3dd14cdce --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_status.rs @@ -0,0 +1,42 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetStatusError as RustGetStatusError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetStatus}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_status`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetStatusError { + Status401(ErrorResponse), + Status500(String), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetStatusError { + fn from(e: RustGetStatusError) -> Self { + match e { + RustGetStatusError::Status401(v) => GetStatusError::Status401(v.into()), + RustGetStatusError::Status500(v) => GetStatusError::Status500(v), + RustGetStatusError::Statusdefault() => GetStatusError::Statusdefault(), + RustGetStatusError::DefaultResponse() => GetStatusError::DefaultResponse(), + RustGetStatusError::UnknownValue(v) => GetStatusError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_supply.rs b/crates/algod_client_ffi/src/apis/get_supply.rs new file mode 100644 index 000000000..c0063a46f --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_supply.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetSupplyError as RustGetSupplyError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetSupply}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_supply`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetSupplyError { + Status401(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetSupplyError { + fn from(e: RustGetSupplyError) -> Self { + match e { + RustGetSupplyError::Status401(v) => GetSupplyError::Status401(v.into()), + RustGetSupplyError::Statusdefault() => GetSupplyError::Statusdefault(), + RustGetSupplyError::DefaultResponse() => GetSupplyError::DefaultResponse(), + RustGetSupplyError::UnknownValue(v) => GetSupplyError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_sync_round.rs b/crates/algod_client_ffi/src/apis/get_sync_round.rs new file mode 100644 index 000000000..eb3429c82 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_sync_round.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetSyncRoundError as RustGetSyncRoundError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetSyncRound}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_sync_round`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetSyncRoundError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetSyncRoundError { + fn from(e: RustGetSyncRoundError) -> Self { + match e { + RustGetSyncRoundError::Status400(v) => GetSyncRoundError::Status400(v.into()), + RustGetSyncRoundError::Status401(v) => GetSyncRoundError::Status401(v.into()), + RustGetSyncRoundError::Status500(v) => GetSyncRoundError::Status500(v.into()), + RustGetSyncRoundError::Status503(v) => GetSyncRoundError::Status503(v.into()), + RustGetSyncRoundError::Statusdefault() => GetSyncRoundError::Statusdefault(), + RustGetSyncRoundError::DefaultResponse() => GetSyncRoundError::DefaultResponse(), + RustGetSyncRoundError::UnknownValue(v) => GetSyncRoundError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs b/crates/algod_client_ffi/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs new file mode 100644 index 000000000..8ca7613c9 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_transaction_group_ledger_state_deltas_for_round.rs @@ -0,0 +1,66 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetTransactionGroupLedgerStateDeltasForRoundError as RustGetTransactionGroupLedgerStateDeltasForRoundError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, GetTransactionGroupLedgerStateDeltasForRound}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_transaction_group_ledger_state_deltas_for_round`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetTransactionGroupLedgerStateDeltasForRoundError { + Status401(ErrorResponse), + Status404(ErrorResponse), + Status408(ErrorResponse), + Status500(ErrorResponse), + Status501(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From + for GetTransactionGroupLedgerStateDeltasForRoundError +{ + fn from(e: RustGetTransactionGroupLedgerStateDeltasForRoundError) -> Self { + match e { + RustGetTransactionGroupLedgerStateDeltasForRoundError::Status401(v) => { + GetTransactionGroupLedgerStateDeltasForRoundError::Status401(v.into()) + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::Status404(v) => { + GetTransactionGroupLedgerStateDeltasForRoundError::Status404(v.into()) + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::Status408(v) => { + GetTransactionGroupLedgerStateDeltasForRoundError::Status408(v.into()) + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::Status500(v) => { + GetTransactionGroupLedgerStateDeltasForRoundError::Status500(v.into()) + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::Status501(v) => { + GetTransactionGroupLedgerStateDeltasForRoundError::Status501(v.into()) + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::Statusdefault() => { + GetTransactionGroupLedgerStateDeltasForRoundError::Statusdefault() + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::DefaultResponse() => { + GetTransactionGroupLedgerStateDeltasForRoundError::DefaultResponse() + } + RustGetTransactionGroupLedgerStateDeltasForRoundError::UnknownValue(v) => { + GetTransactionGroupLedgerStateDeltasForRoundError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_transaction_proof.rs b/crates/algod_client_ffi/src/apis/get_transaction_proof.rs new file mode 100644 index 000000000..7fd19c7c9 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_transaction_proof.rs @@ -0,0 +1,61 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::parameter_enums::*; +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetTransactionProofError as RustGetTransactionProofError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, TransactionProof}; + +// Import request body type if needed + +/// struct for typed errors of method [`get_transaction_proof`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetTransactionProofError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetTransactionProofError { + fn from(e: RustGetTransactionProofError) -> Self { + match e { + RustGetTransactionProofError::Status400(v) => { + GetTransactionProofError::Status400(v.into()) + } + RustGetTransactionProofError::Status401(v) => { + GetTransactionProofError::Status401(v.into()) + } + RustGetTransactionProofError::Status404(v) => { + GetTransactionProofError::Status404(v.into()) + } + RustGetTransactionProofError::Status500(v) => { + GetTransactionProofError::Status500(v.into()) + } + RustGetTransactionProofError::Statusdefault() => { + GetTransactionProofError::Statusdefault() + } + RustGetTransactionProofError::DefaultResponse() => { + GetTransactionProofError::DefaultResponse() + } + RustGetTransactionProofError::UnknownValue(v) => { + GetTransactionProofError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/get_version.rs b/crates/algod_client_ffi/src/apis/get_version.rs new file mode 100644 index 000000000..8f31d20af --- /dev/null +++ b/crates/algod_client_ffi/src/apis/get_version.rs @@ -0,0 +1,36 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::GetVersionError as RustGetVersionError; + +// Import all custom types used by this endpoint +use crate::models::Version; + +// Import request body type if needed + +/// struct for typed errors of method [`get_version`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum GetVersionError { + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for GetVersionError { + fn from(e: RustGetVersionError) -> Self { + match e { + RustGetVersionError::DefaultResponse() => GetVersionError::DefaultResponse(), + RustGetVersionError::UnknownValue(v) => GetVersionError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/health_check.rs b/crates/algod_client_ffi/src/apis/health_check.rs new file mode 100644 index 000000000..b305f3535 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/health_check.rs @@ -0,0 +1,37 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::HealthCheckError as RustHealthCheckError; + +// Import all custom types used by this endpoint + +// Import request body type if needed + +/// struct for typed errors of method [`health_check`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum HealthCheckError { + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for HealthCheckError { + fn from(e: RustHealthCheckError) -> Self { + match e { + RustHealthCheckError::Statusdefault() => HealthCheckError::Statusdefault(), + RustHealthCheckError::DefaultResponse() => HealthCheckError::DefaultResponse(), + RustHealthCheckError::UnknownValue(v) => HealthCheckError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/metrics.rs b/crates/algod_client_ffi/src/apis/metrics.rs new file mode 100644 index 000000000..85967351c --- /dev/null +++ b/crates/algod_client_ffi/src/apis/metrics.rs @@ -0,0 +1,37 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::MetricsError as RustMetricsError; + +// Import all custom types used by this endpoint + +// Import request body type if needed + +/// struct for typed errors of method [`metrics`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum MetricsError { + Status404(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for MetricsError { + fn from(e: RustMetricsError) -> Self { + match e { + RustMetricsError::Status404() => MetricsError::Status404(), + RustMetricsError::DefaultResponse() => MetricsError::DefaultResponse(), + RustMetricsError::UnknownValue(v) => MetricsError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/mod.rs b/crates/algod_client_ffi/src/apis/mod.rs new file mode 100644 index 000000000..6dcc755b2 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/mod.rs @@ -0,0 +1,784 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +// Consolidated client +pub mod client; + +// Parameter enums for type-safe API parameters +pub mod parameter_enums; + +// Individual endpoint modules +pub mod abort_catchup; +pub mod account_application_information; +pub mod account_asset_information; +pub mod account_assets_information; +pub mod account_information; +pub mod add_participation_key; +pub mod append_keys; +pub mod delete_participation_key_by_id; +pub mod experimental_check; +pub mod generate_participation_keys; +pub mod get_application_box_by_name; +pub mod get_application_boxes; +pub mod get_application_by_id; +pub mod get_asset_by_id; +pub mod get_block; +pub mod get_block_hash; +pub mod get_block_logs; +pub mod get_block_time_stamp_offset; +pub mod get_block_txids; +pub mod get_config; +pub mod get_debug_settings_prof; +pub mod get_genesis; +pub mod get_ledger_state_delta; +pub mod get_ledger_state_delta_for_transaction_group; +pub mod get_light_block_header_proof; +pub mod get_participation_key_by_id; +pub mod get_participation_keys; +pub mod get_pending_transactions; +pub mod get_pending_transactions_by_address; +pub mod get_ready; +pub mod get_state_proof; +pub mod get_status; +pub mod get_supply; +pub mod get_sync_round; +pub mod get_transaction_group_ledger_state_deltas_for_round; +pub mod get_transaction_proof; +pub mod get_version; +pub mod health_check; +pub mod metrics; +pub mod pending_transaction_information; +pub mod put_debug_settings_prof; +pub mod raw_transaction; +pub mod raw_transaction_async; +pub mod set_block_time_stamp_offset; +pub mod set_sync_round; +pub mod shutdown_node; +pub mod simulate_transaction; +pub mod start_catchup; +pub mod swagger_json; +pub mod teal_compile; +pub mod teal_disassemble; +pub mod teal_dryrun; +pub mod transaction_params; +pub mod unset_sync_round; +pub mod wait_for_block; +use algod_client::apis::AlgodApiError as RustApiError; +use algod_client::apis::Error as RustError; + +use snafu::Snafu; + +/// Unified error type that can represent any API error from any endpoint +#[derive(Debug, Snafu, uniffi::Error)] +pub enum AlgodApiError { + #[snafu(display("Health_check error: {error:?}"))] + HealthCheck { error: health_check::HealthCheckError }, + #[snafu(display("Get_ready error: {error:?}"))] + GetReady { error: get_ready::GetReadyError }, + #[snafu(display("Metrics error: {error:?}"))] + Metrics { error: metrics::MetricsError }, + #[snafu(display("Get_genesis error: {error:?}"))] + GetGenesis { error: get_genesis::GetGenesisError }, + #[snafu(display("Swagger_json error: {error:?}"))] + SwaggerJson { error: swagger_json::SwaggerJsonError }, + #[snafu(display("Get_version error: {error:?}"))] + GetVersion { error: get_version::GetVersionError }, + #[snafu(display("Get_debug_settings_prof error: {error:?}"))] + GetDebugSettingsProf { error: get_debug_settings_prof::GetDebugSettingsProfError }, + #[snafu(display("Put_debug_settings_prof error: {error:?}"))] + PutDebugSettingsProf { error: put_debug_settings_prof::PutDebugSettingsProfError }, + #[snafu(display("Get_config error: {error:?}"))] + GetConfig { error: get_config::GetConfigError }, + #[snafu(display("Account_information error: {error:?}"))] + AccountInformation { error: account_information::AccountInformationError }, + #[snafu(display("Account_asset_information error: {error:?}"))] + AccountAssetInformation { error: account_asset_information::AccountAssetInformationError }, + #[snafu(display("Account_assets_information error: {error:?}"))] + AccountAssetsInformation { error: account_assets_information::AccountAssetsInformationError }, + #[snafu(display("Account_application_information error: {error:?}"))] + AccountApplicationInformation { error: account_application_information::AccountApplicationInformationError }, + #[snafu(display("Get_pending_transactions_by_address error: {error:?}"))] + GetPendingTransactionsByAddress { error: get_pending_transactions_by_address::GetPendingTransactionsByAddressError }, + #[snafu(display("Get_block error: {error:?}"))] + GetBlock { error: get_block::GetBlockError }, + #[snafu(display("Get_block_txids error: {error:?}"))] + GetBlockTxids { error: get_block_txids::GetBlockTxidsError }, + #[snafu(display("Get_block_hash error: {error:?}"))] + GetBlockHash { error: get_block_hash::GetBlockHashError }, + #[snafu(display("Get_transaction_proof error: {error:?}"))] + GetTransactionProof { error: get_transaction_proof::GetTransactionProofError }, + #[snafu(display("Get_block_logs error: {error:?}"))] + GetBlockLogs { error: get_block_logs::GetBlockLogsError }, + #[snafu(display("Get_supply error: {error:?}"))] + GetSupply { error: get_supply::GetSupplyError }, + #[snafu(display("Get_participation_keys error: {error:?}"))] + GetParticipationKeys { error: get_participation_keys::GetParticipationKeysError }, + #[snafu(display("Add_participation_key error: {error:?}"))] + AddParticipationKey { error: add_participation_key::AddParticipationKeyError }, + #[snafu(display("Generate_participation_keys error: {error:?}"))] + GenerateParticipationKeys { error: generate_participation_keys::GenerateParticipationKeysError }, + #[snafu(display("Get_participation_key_by_id error: {error:?}"))] + GetParticipationKeyById { error: get_participation_key_by_id::GetParticipationKeyByIdError }, + #[snafu(display("Append_keys error: {error:?}"))] + AppendKeys { error: append_keys::AppendKeysError }, + #[snafu(display("Delete_participation_key_by_id error: {error:?}"))] + DeleteParticipationKeyById { error: delete_participation_key_by_id::DeleteParticipationKeyByIdError }, + #[snafu(display("Shutdown_node error: {error:?}"))] + ShutdownNode { error: shutdown_node::ShutdownNodeError }, + #[snafu(display("Get_status error: {error:?}"))] + GetStatus { error: get_status::GetStatusError }, + #[snafu(display("Wait_for_block error: {error:?}"))] + WaitForBlock { error: wait_for_block::WaitForBlockError }, + #[snafu(display("Raw_transaction error: {error:?}"))] + RawTransaction { error: raw_transaction::RawTransactionError }, + #[snafu(display("Raw_transaction_async error: {error:?}"))] + RawTransactionAsync { error: raw_transaction_async::RawTransactionAsyncError }, + #[snafu(display("Simulate_transaction error: {error:?}"))] + SimulateTransaction { error: simulate_transaction::SimulateTransactionError }, + #[snafu(display("Transaction_params error: {error:?}"))] + TransactionParams { error: transaction_params::TransactionParamsError }, + #[snafu(display("Get_pending_transactions error: {error:?}"))] + GetPendingTransactions { error: get_pending_transactions::GetPendingTransactionsError }, + #[snafu(display("Pending_transaction_information error: {error:?}"))] + PendingTransactionInformation { error: pending_transaction_information::PendingTransactionInformationError }, + #[snafu(display("Get_ledger_state_delta error: {error:?}"))] + GetLedgerStateDelta { error: get_ledger_state_delta::GetLedgerStateDeltaError }, + #[snafu(display("Get_transaction_group_ledger_state_deltas_for_round error: {error:?}"))] + GetTransactionGroupLedgerStateDeltasForRound { error: get_transaction_group_ledger_state_deltas_for_round::GetTransactionGroupLedgerStateDeltasForRoundError }, + #[snafu(display("Get_ledger_state_delta_for_transaction_group error: {error:?}"))] + GetLedgerStateDeltaForTransactionGroup { error: get_ledger_state_delta_for_transaction_group::GetLedgerStateDeltaForTransactionGroupError }, + #[snafu(display("Get_state_proof error: {error:?}"))] + GetStateProof { error: get_state_proof::GetStateProofError }, + #[snafu(display("Get_light_block_header_proof error: {error:?}"))] + GetLightBlockHeaderProof { error: get_light_block_header_proof::GetLightBlockHeaderProofError }, + #[snafu(display("Get_application_by_id error: {error:?}"))] + GetApplicationById { error: get_application_by_id::GetApplicationByIdError }, + #[snafu(display("Get_application_boxes error: {error:?}"))] + GetApplicationBoxes { error: get_application_boxes::GetApplicationBoxesError }, + #[snafu(display("Get_application_box_by_name error: {error:?}"))] + GetApplicationBoxByName { error: get_application_box_by_name::GetApplicationBoxByNameError }, + #[snafu(display("Get_asset_by_id error: {error:?}"))] + GetAssetById { error: get_asset_by_id::GetAssetByIdError }, + #[snafu(display("Get_sync_round error: {error:?}"))] + GetSyncRound { error: get_sync_round::GetSyncRoundError }, + #[snafu(display("Unset_sync_round error: {error:?}"))] + UnsetSyncRound { error: unset_sync_round::UnsetSyncRoundError }, + #[snafu(display("Set_sync_round error: {error:?}"))] + SetSyncRound { error: set_sync_round::SetSyncRoundError }, + #[snafu(display("Teal_compile error: {error:?}"))] + TealCompile { error: teal_compile::TealCompileError }, + #[snafu(display("Teal_disassemble error: {error:?}"))] + TealDisassemble { error: teal_disassemble::TealDisassembleError }, + #[snafu(display("Start_catchup error: {error:?}"))] + StartCatchup { error: start_catchup::StartCatchupError }, + #[snafu(display("Abort_catchup error: {error:?}"))] + AbortCatchup { error: abort_catchup::AbortCatchupError }, + #[snafu(display("Teal_dryrun error: {error:?}"))] + TealDryrun { error: teal_dryrun::TealDryrunError }, + #[snafu(display("Experimental_check error: {error:?}"))] + ExperimentalCheck { error: experimental_check::ExperimentalCheckError }, + #[snafu(display("Get_block_time_stamp_offset error: {error:?}"))] + GetBlockTimeStampOffset { error: get_block_time_stamp_offset::GetBlockTimeStampOffsetError }, + #[snafu(display("Set_block_time_stamp_offset error: {error:?}"))] + SetBlockTimeStampOffset { error: set_block_time_stamp_offset::SetBlockTimeStampOffsetError }, + #[snafu(display("Unknown API error: {message}"))] + Unknown { message: String }, +} + +impl From for AlgodApiError { + fn from(err: RustApiError) -> Self { + match err { + RustApiError::HealthCheck { error } => AlgodApiError::HealthCheck { + error: error.into(), + }, + RustApiError::GetReady { error } => AlgodApiError::GetReady { + error: error.into(), + }, + RustApiError::Metrics { error } => AlgodApiError::Metrics { + error: error.into(), + }, + RustApiError::GetGenesis { error } => AlgodApiError::GetGenesis { + error: error.into(), + }, + RustApiError::SwaggerJson { error } => AlgodApiError::SwaggerJson { + error: error.into(), + }, + RustApiError::GetVersion { error } => AlgodApiError::GetVersion { + error: error.into(), + }, + RustApiError::GetDebugSettingsProf { error } => AlgodApiError::GetDebugSettingsProf { + error: error.into(), + }, + RustApiError::PutDebugSettingsProf { error } => AlgodApiError::PutDebugSettingsProf { + error: error.into(), + }, + RustApiError::GetConfig { error } => AlgodApiError::GetConfig { + error: error.into(), + }, + RustApiError::AccountInformation { error } => AlgodApiError::AccountInformation { + error: error.into(), + }, + RustApiError::AccountAssetInformation { error } => { + AlgodApiError::AccountAssetInformation { + error: error.into(), + } + } + RustApiError::AccountAssetsInformation { error } => { + AlgodApiError::AccountAssetsInformation { + error: error.into(), + } + } + RustApiError::AccountApplicationInformation { error } => { + AlgodApiError::AccountApplicationInformation { + error: error.into(), + } + } + RustApiError::GetPendingTransactionsByAddress { error } => { + AlgodApiError::GetPendingTransactionsByAddress { + error: error.into(), + } + } + RustApiError::GetBlock { error } => AlgodApiError::GetBlock { + error: error.into(), + }, + RustApiError::GetBlockTxids { error } => AlgodApiError::GetBlockTxids { + error: error.into(), + }, + RustApiError::GetBlockHash { error } => AlgodApiError::GetBlockHash { + error: error.into(), + }, + RustApiError::GetTransactionProof { error } => AlgodApiError::GetTransactionProof { + error: error.into(), + }, + RustApiError::GetBlockLogs { error } => AlgodApiError::GetBlockLogs { + error: error.into(), + }, + RustApiError::GetSupply { error } => AlgodApiError::GetSupply { + error: error.into(), + }, + RustApiError::GetParticipationKeys { error } => AlgodApiError::GetParticipationKeys { + error: error.into(), + }, + RustApiError::AddParticipationKey { error } => AlgodApiError::AddParticipationKey { + error: error.into(), + }, + RustApiError::GenerateParticipationKeys { error } => { + AlgodApiError::GenerateParticipationKeys { + error: error.into(), + } + } + RustApiError::GetParticipationKeyById { error } => { + AlgodApiError::GetParticipationKeyById { + error: error.into(), + } + } + RustApiError::AppendKeys { error } => AlgodApiError::AppendKeys { + error: error.into(), + }, + RustApiError::DeleteParticipationKeyById { error } => { + AlgodApiError::DeleteParticipationKeyById { + error: error.into(), + } + } + RustApiError::ShutdownNode { error } => AlgodApiError::ShutdownNode { + error: error.into(), + }, + RustApiError::GetStatus { error } => AlgodApiError::GetStatus { + error: error.into(), + }, + RustApiError::WaitForBlock { error } => AlgodApiError::WaitForBlock { + error: error.into(), + }, + RustApiError::RawTransaction { error } => AlgodApiError::RawTransaction { + error: error.into(), + }, + RustApiError::RawTransactionAsync { error } => AlgodApiError::RawTransactionAsync { + error: error.into(), + }, + RustApiError::SimulateTransaction { error } => AlgodApiError::SimulateTransaction { + error: error.into(), + }, + RustApiError::TransactionParams { error } => AlgodApiError::TransactionParams { + error: error.into(), + }, + RustApiError::GetPendingTransactions { error } => { + AlgodApiError::GetPendingTransactions { + error: error.into(), + } + } + RustApiError::PendingTransactionInformation { error } => { + AlgodApiError::PendingTransactionInformation { + error: error.into(), + } + } + RustApiError::GetLedgerStateDelta { error } => AlgodApiError::GetLedgerStateDelta { + error: error.into(), + }, + RustApiError::GetTransactionGroupLedgerStateDeltasForRound { error } => { + AlgodApiError::GetTransactionGroupLedgerStateDeltasForRound { + error: error.into(), + } + } + RustApiError::GetLedgerStateDeltaForTransactionGroup { error } => { + AlgodApiError::GetLedgerStateDeltaForTransactionGroup { + error: error.into(), + } + } + RustApiError::GetStateProof { error } => AlgodApiError::GetStateProof { + error: error.into(), + }, + RustApiError::GetLightBlockHeaderProof { error } => { + AlgodApiError::GetLightBlockHeaderProof { + error: error.into(), + } + } + RustApiError::GetApplicationById { error } => AlgodApiError::GetApplicationById { + error: error.into(), + }, + RustApiError::GetApplicationBoxes { error } => AlgodApiError::GetApplicationBoxes { + error: error.into(), + }, + RustApiError::GetApplicationBoxByName { error } => { + AlgodApiError::GetApplicationBoxByName { + error: error.into(), + } + } + RustApiError::GetAssetById { error } => AlgodApiError::GetAssetById { + error: error.into(), + }, + RustApiError::GetSyncRound { error } => AlgodApiError::GetSyncRound { + error: error.into(), + }, + RustApiError::UnsetSyncRound { error } => AlgodApiError::UnsetSyncRound { + error: error.into(), + }, + RustApiError::SetSyncRound { error } => AlgodApiError::SetSyncRound { + error: error.into(), + }, + RustApiError::TealCompile { error } => AlgodApiError::TealCompile { + error: error.into(), + }, + RustApiError::TealDisassemble { error } => AlgodApiError::TealDisassemble { + error: error.into(), + }, + RustApiError::StartCatchup { error } => AlgodApiError::StartCatchup { + error: error.into(), + }, + RustApiError::AbortCatchup { error } => AlgodApiError::AbortCatchup { + error: error.into(), + }, + RustApiError::TealDryrun { error } => AlgodApiError::TealDryrun { + error: error.into(), + }, + RustApiError::ExperimentalCheck { error } => AlgodApiError::ExperimentalCheck { + error: error.into(), + }, + RustApiError::GetBlockTimeStampOffset { error } => { + AlgodApiError::GetBlockTimeStampOffset { + error: error.into(), + } + } + RustApiError::SetBlockTimeStampOffset { error } => { + AlgodApiError::SetBlockTimeStampOffset { + error: error.into(), + } + } + RustApiError::Unknown { message } => AlgodApiError::Unknown { message }, + } + } +} + +impl From for AlgodApiError { + fn from(err: health_check::HealthCheckError) -> Self { + AlgodApiError::HealthCheck { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_ready::GetReadyError) -> Self { + AlgodApiError::GetReady { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: metrics::MetricsError) -> Self { + AlgodApiError::Metrics { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_genesis::GetGenesisError) -> Self { + AlgodApiError::GetGenesis { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: swagger_json::SwaggerJsonError) -> Self { + AlgodApiError::SwaggerJson { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_version::GetVersionError) -> Self { + AlgodApiError::GetVersion { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_debug_settings_prof::GetDebugSettingsProfError) -> Self { + AlgodApiError::GetDebugSettingsProf { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: put_debug_settings_prof::PutDebugSettingsProfError) -> Self { + AlgodApiError::PutDebugSettingsProf { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_config::GetConfigError) -> Self { + AlgodApiError::GetConfig { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: account_information::AccountInformationError) -> Self { + AlgodApiError::AccountInformation { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: account_asset_information::AccountAssetInformationError) -> Self { + AlgodApiError::AccountAssetInformation { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: account_assets_information::AccountAssetsInformationError) -> Self { + AlgodApiError::AccountAssetsInformation { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: account_application_information::AccountApplicationInformationError) -> Self { + AlgodApiError::AccountApplicationInformation { error: err } + } +} + +impl From + for AlgodApiError +{ + fn from( + err: get_pending_transactions_by_address::GetPendingTransactionsByAddressError, + ) -> Self { + AlgodApiError::GetPendingTransactionsByAddress { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_block::GetBlockError) -> Self { + AlgodApiError::GetBlock { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_block_txids::GetBlockTxidsError) -> Self { + AlgodApiError::GetBlockTxids { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_block_hash::GetBlockHashError) -> Self { + AlgodApiError::GetBlockHash { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_transaction_proof::GetTransactionProofError) -> Self { + AlgodApiError::GetTransactionProof { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_block_logs::GetBlockLogsError) -> Self { + AlgodApiError::GetBlockLogs { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_supply::GetSupplyError) -> Self { + AlgodApiError::GetSupply { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_participation_keys::GetParticipationKeysError) -> Self { + AlgodApiError::GetParticipationKeys { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: add_participation_key::AddParticipationKeyError) -> Self { + AlgodApiError::AddParticipationKey { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: generate_participation_keys::GenerateParticipationKeysError) -> Self { + AlgodApiError::GenerateParticipationKeys { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_participation_key_by_id::GetParticipationKeyByIdError) -> Self { + AlgodApiError::GetParticipationKeyById { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: append_keys::AppendKeysError) -> Self { + AlgodApiError::AppendKeys { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: delete_participation_key_by_id::DeleteParticipationKeyByIdError) -> Self { + AlgodApiError::DeleteParticipationKeyById { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: shutdown_node::ShutdownNodeError) -> Self { + AlgodApiError::ShutdownNode { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_status::GetStatusError) -> Self { + AlgodApiError::GetStatus { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: wait_for_block::WaitForBlockError) -> Self { + AlgodApiError::WaitForBlock { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: raw_transaction::RawTransactionError) -> Self { + AlgodApiError::RawTransaction { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: raw_transaction_async::RawTransactionAsyncError) -> Self { + AlgodApiError::RawTransactionAsync { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: simulate_transaction::SimulateTransactionError) -> Self { + AlgodApiError::SimulateTransaction { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: transaction_params::TransactionParamsError) -> Self { + AlgodApiError::TransactionParams { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_pending_transactions::GetPendingTransactionsError) -> Self { + AlgodApiError::GetPendingTransactions { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: pending_transaction_information::PendingTransactionInformationError) -> Self { + AlgodApiError::PendingTransactionInformation { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_ledger_state_delta::GetLedgerStateDeltaError) -> Self { + AlgodApiError::GetLedgerStateDelta { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_transaction_group_ledger_state_deltas_for_round::GetTransactionGroupLedgerStateDeltasForRoundError) -> Self { + AlgodApiError::GetTransactionGroupLedgerStateDeltasForRound { error: err } + } +} + +impl From + for AlgodApiError +{ + fn from( + err: get_ledger_state_delta_for_transaction_group::GetLedgerStateDeltaForTransactionGroupError, + ) -> Self { + AlgodApiError::GetLedgerStateDeltaForTransactionGroup { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_state_proof::GetStateProofError) -> Self { + AlgodApiError::GetStateProof { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_light_block_header_proof::GetLightBlockHeaderProofError) -> Self { + AlgodApiError::GetLightBlockHeaderProof { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_application_by_id::GetApplicationByIdError) -> Self { + AlgodApiError::GetApplicationById { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_application_boxes::GetApplicationBoxesError) -> Self { + AlgodApiError::GetApplicationBoxes { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_application_box_by_name::GetApplicationBoxByNameError) -> Self { + AlgodApiError::GetApplicationBoxByName { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_asset_by_id::GetAssetByIdError) -> Self { + AlgodApiError::GetAssetById { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_sync_round::GetSyncRoundError) -> Self { + AlgodApiError::GetSyncRound { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: unset_sync_round::UnsetSyncRoundError) -> Self { + AlgodApiError::UnsetSyncRound { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: set_sync_round::SetSyncRoundError) -> Self { + AlgodApiError::SetSyncRound { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: teal_compile::TealCompileError) -> Self { + AlgodApiError::TealCompile { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: teal_disassemble::TealDisassembleError) -> Self { + AlgodApiError::TealDisassemble { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: start_catchup::StartCatchupError) -> Self { + AlgodApiError::StartCatchup { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: abort_catchup::AbortCatchupError) -> Self { + AlgodApiError::AbortCatchup { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: teal_dryrun::TealDryrunError) -> Self { + AlgodApiError::TealDryrun { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: experimental_check::ExperimentalCheckError) -> Self { + AlgodApiError::ExperimentalCheck { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: get_block_time_stamp_offset::GetBlockTimeStampOffsetError) -> Self { + AlgodApiError::GetBlockTimeStampOffset { error: err } + } +} + +impl From for AlgodApiError { + fn from(err: set_block_time_stamp_offset::SetBlockTimeStampOffsetError) -> Self { + AlgodApiError::SetBlockTimeStampOffset { error: err } + } +} + +/// The main error type for all algod client operations +#[derive(Debug, Snafu, uniffi::Error)] +pub enum Error { + #[snafu(display("HTTP error: {source}"))] + Http { + source: algokit_http_client::HttpError, + }, + #[snafu(display("Serialization error: {message}"))] + Serde { message: String }, + #[snafu(display("API error: {source}"))] + Api { source: AlgodApiError }, +} + +impl From for Error { + fn from(err: RustError) -> Self { + match err { + RustError::Http { source } => Error::Http { source }, + RustError::Serde { message } => Error::Serde { message }, + RustError::Api { source } => Error::Api { + source: source.into(), + }, + } + } +} + +#[derive(Debug, PartialEq, Eq)] +pub enum ContentType { + Json, + MsgPack, + Text, + Unsupported(String), +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.contains("application/json") { + ContentType::Json + } else if content_type.contains("application/msgpack") { + ContentType::MsgPack + } else if content_type.contains("text/plain") { + ContentType::Text + } else { + ContentType::Unsupported(content_type.to_string()) + } + } +} + +// Re-export the consolidated client +pub use client::AlgodClient; diff --git a/crates/algod_client_ffi/src/apis/parameter_enums.rs b/crates/algod_client_ffi/src/apis/parameter_enums.rs new file mode 100644 index 000000000..d4129cd6c --- /dev/null +++ b/crates/algod_client_ffi/src/apis/parameter_enums.rs @@ -0,0 +1,90 @@ +/* + * Parameter Enums for Algod REST API. + * + * Auto-generated enums for parameters with constrained string values. + * + * Generated by: Rust OpenAPI Generator + */ + +/// When set to `all` will exclude asset holdings, application local state, created asset parameters, any created application parameters. Defaults to `none`. +#[derive(Debug, Clone, Copy, PartialEq, Eq, uniffi::Enum)] +pub enum Exclude { + /// all + All, + /// none + None, +} + +impl From for algod_client::apis::Exclude { + fn from(value: Exclude) -> Self { + match value { + Exclude::All => algod_client::apis::Exclude::All, + Exclude::None => algod_client::apis::Exclude::None, + } + } +} + +impl From for Exclude { + fn from(value: algod_client::apis::Exclude) -> Self { + match value { + algod_client::apis::Exclude::All => Exclude::All, + algod_client::apis::Exclude::None => Exclude::None, + } + } +} + +/// Configures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON. +#[derive(Debug, Clone, Copy, PartialEq, Eq, uniffi::Enum)] +pub enum Format { + /// json + Json, + /// msgpack + Msgpack, +} + +impl From for algod_client::apis::Format { + fn from(value: Format) -> Self { + match value { + Format::Json => algod_client::apis::Format::Json, + Format::Msgpack => algod_client::apis::Format::Msgpack, + } + } +} + +impl From for Format { + fn from(value: algod_client::apis::Format) -> Self { + match value { + algod_client::apis::Format::Json => Format::Json, + algod_client::apis::Format::Msgpack => Format::Msgpack, + } + } +} + +/// The type of hash function used to create the proof, must be one of: +/// * sha512_256 +/// * sha256 +#[derive(Debug, Clone, Copy, PartialEq, Eq, uniffi::Enum)] +pub enum Hashtype { + /// sha512_256 + Sha512256, + /// sha256 + Sha256, +} + +impl From for algod_client::apis::Hashtype { + fn from(value: Hashtype) -> Self { + match value { + Hashtype::Sha512256 => algod_client::apis::Hashtype::Sha512256, + Hashtype::Sha256 => algod_client::apis::Hashtype::Sha256, + } + } +} + +impl From for Hashtype { + fn from(value: algod_client::apis::Hashtype) -> Self { + match value { + algod_client::apis::Hashtype::Sha512256 => Hashtype::Sha512256, + algod_client::apis::Hashtype::Sha256 => Hashtype::Sha256, + } + } +} diff --git a/crates/algod_client_ffi/src/apis/pending_transaction_information.rs b/crates/algod_client_ffi/src/apis/pending_transaction_information.rs new file mode 100644 index 000000000..5eb3fd5db --- /dev/null +++ b/crates/algod_client_ffi/src/apis/pending_transaction_information.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::PendingTransactionInformationError as RustPendingTransactionInformationError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, PendingTransactionResponse}; + +// Import request body type if needed + +/// struct for typed errors of method [`pending_transaction_information`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum PendingTransactionInformationError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for PendingTransactionInformationError { + fn from(e: RustPendingTransactionInformationError) -> Self { + match e { + RustPendingTransactionInformationError::Status400(v) => { + PendingTransactionInformationError::Status400(v.into()) + } + RustPendingTransactionInformationError::Status401(v) => { + PendingTransactionInformationError::Status401(v.into()) + } + RustPendingTransactionInformationError::Status404(v) => { + PendingTransactionInformationError::Status404(v.into()) + } + RustPendingTransactionInformationError::Statusdefault() => { + PendingTransactionInformationError::Statusdefault() + } + RustPendingTransactionInformationError::DefaultResponse() => { + PendingTransactionInformationError::DefaultResponse() + } + RustPendingTransactionInformationError::UnknownValue(v) => { + PendingTransactionInformationError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/put_debug_settings_prof.rs b/crates/algod_client_ffi/src/apis/put_debug_settings_prof.rs new file mode 100644 index 000000000..9367c4a56 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/put_debug_settings_prof.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::PutDebugSettingsProfError as RustPutDebugSettingsProfError; + +// Import all custom types used by this endpoint +use crate::models::DebugSettingsProf; + +// Import request body type if needed + +/// struct for typed errors of method [`put_debug_settings_prof`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum PutDebugSettingsProfError { + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for PutDebugSettingsProfError { + fn from(e: RustPutDebugSettingsProfError) -> Self { + match e { + RustPutDebugSettingsProfError::DefaultResponse() => { + PutDebugSettingsProfError::DefaultResponse() + } + RustPutDebugSettingsProfError::UnknownValue(v) => { + PutDebugSettingsProfError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/raw_transaction.rs b/crates/algod_client_ffi/src/apis/raw_transaction.rs new file mode 100644 index 000000000..de997d797 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/raw_transaction.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::RawTransactionError as RustRawTransactionError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, RawTransaction}; + +// Import request body type if needed + +/// struct for typed errors of method [`raw_transaction`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum RawTransactionError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for RawTransactionError { + fn from(e: RustRawTransactionError) -> Self { + match e { + RustRawTransactionError::Status400(v) => RawTransactionError::Status400(v.into()), + RustRawTransactionError::Status401(v) => RawTransactionError::Status401(v.into()), + RustRawTransactionError::Status500(v) => RawTransactionError::Status500(v.into()), + RustRawTransactionError::Status503(v) => RawTransactionError::Status503(v.into()), + RustRawTransactionError::Statusdefault() => RawTransactionError::Statusdefault(), + RustRawTransactionError::DefaultResponse() => RawTransactionError::DefaultResponse(), + RustRawTransactionError::UnknownValue(v) => RawTransactionError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/raw_transaction_async.rs b/crates/algod_client_ffi/src/apis/raw_transaction_async.rs new file mode 100644 index 000000000..fa8f3c608 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/raw_transaction_async.rs @@ -0,0 +1,62 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::RawTransactionAsyncError as RustRawTransactionAsyncError; + +// Import all custom types used by this endpoint +use crate::models::ErrorResponse; + +// Import request body type if needed + +/// struct for typed errors of method [`raw_transaction_async`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum RawTransactionAsyncError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for RawTransactionAsyncError { + fn from(e: RustRawTransactionAsyncError) -> Self { + match e { + RustRawTransactionAsyncError::Status400(v) => { + RawTransactionAsyncError::Status400(v.into()) + } + RustRawTransactionAsyncError::Status401(v) => { + RawTransactionAsyncError::Status401(v.into()) + } + RustRawTransactionAsyncError::Status404() => RawTransactionAsyncError::Status404(), + RustRawTransactionAsyncError::Status500(v) => { + RawTransactionAsyncError::Status500(v.into()) + } + RustRawTransactionAsyncError::Status503(v) => { + RawTransactionAsyncError::Status503(v.into()) + } + RustRawTransactionAsyncError::Statusdefault() => { + RawTransactionAsyncError::Statusdefault() + } + RustRawTransactionAsyncError::DefaultResponse() => { + RawTransactionAsyncError::DefaultResponse() + } + RustRawTransactionAsyncError::UnknownValue(v) => { + RawTransactionAsyncError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/set_block_time_stamp_offset.rs b/crates/algod_client_ffi/src/apis/set_block_time_stamp_offset.rs new file mode 100644 index 000000000..5bfbf2250 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/set_block_time_stamp_offset.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::SetBlockTimeStampOffsetError as RustSetBlockTimeStampOffsetError; + +// Import all custom types used by this endpoint +use crate::models::ErrorResponse; + +// Import request body type if needed + +/// struct for typed errors of method [`set_block_time_stamp_offset`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum SetBlockTimeStampOffsetError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for SetBlockTimeStampOffsetError { + fn from(e: RustSetBlockTimeStampOffsetError) -> Self { + match e { + RustSetBlockTimeStampOffsetError::Status400(v) => { + SetBlockTimeStampOffsetError::Status400(v.into()) + } + RustSetBlockTimeStampOffsetError::Status401(v) => { + SetBlockTimeStampOffsetError::Status401(v.into()) + } + RustSetBlockTimeStampOffsetError::Status500(v) => { + SetBlockTimeStampOffsetError::Status500(v.into()) + } + RustSetBlockTimeStampOffsetError::Statusdefault() => { + SetBlockTimeStampOffsetError::Statusdefault() + } + RustSetBlockTimeStampOffsetError::DefaultResponse() => { + SetBlockTimeStampOffsetError::DefaultResponse() + } + RustSetBlockTimeStampOffsetError::UnknownValue(v) => { + SetBlockTimeStampOffsetError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/set_sync_round.rs b/crates/algod_client_ffi/src/apis/set_sync_round.rs new file mode 100644 index 000000000..d5c0075c8 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/set_sync_round.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::SetSyncRoundError as RustSetSyncRoundError; + +// Import all custom types used by this endpoint +use crate::models::ErrorResponse; + +// Import request body type if needed + +/// struct for typed errors of method [`set_sync_round`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum SetSyncRoundError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for SetSyncRoundError { + fn from(e: RustSetSyncRoundError) -> Self { + match e { + RustSetSyncRoundError::Status400(v) => SetSyncRoundError::Status400(v.into()), + RustSetSyncRoundError::Status401(v) => SetSyncRoundError::Status401(v.into()), + RustSetSyncRoundError::Status500(v) => SetSyncRoundError::Status500(v.into()), + RustSetSyncRoundError::Status503(v) => SetSyncRoundError::Status503(v.into()), + RustSetSyncRoundError::Statusdefault() => SetSyncRoundError::Statusdefault(), + RustSetSyncRoundError::DefaultResponse() => SetSyncRoundError::DefaultResponse(), + RustSetSyncRoundError::UnknownValue(v) => SetSyncRoundError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/shutdown_node.rs b/crates/algod_client_ffi/src/apis/shutdown_node.rs new file mode 100644 index 000000000..7b687a308 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/shutdown_node.rs @@ -0,0 +1,36 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::ShutdownNodeError as RustShutdownNodeError; + +// Import all custom types used by this endpoint +use crate::models::UnknownJsonValue; + +// Import request body type if needed + +/// struct for typed errors of method [`shutdown_node`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum ShutdownNodeError { + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for ShutdownNodeError { + fn from(e: RustShutdownNodeError) -> Self { + match e { + RustShutdownNodeError::DefaultResponse() => ShutdownNodeError::DefaultResponse(), + RustShutdownNodeError::UnknownValue(v) => ShutdownNodeError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/simulate_transaction.rs b/crates/algod_client_ffi/src/apis/simulate_transaction.rs new file mode 100644 index 000000000..73b7d55b8 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/simulate_transaction.rs @@ -0,0 +1,62 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::parameter_enums::*; +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::SimulateTransactionError as RustSimulateTransactionError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, SimulateTransaction}; + +// Import request body type if needed +use crate::models::SimulateRequest; + +/// struct for typed errors of method [`simulate_transaction`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum SimulateTransactionError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for SimulateTransactionError { + fn from(e: RustSimulateTransactionError) -> Self { + match e { + RustSimulateTransactionError::Status400(v) => { + SimulateTransactionError::Status400(v.into()) + } + RustSimulateTransactionError::Status401(v) => { + SimulateTransactionError::Status401(v.into()) + } + RustSimulateTransactionError::Status500(v) => { + SimulateTransactionError::Status500(v.into()) + } + RustSimulateTransactionError::Status503(v) => { + SimulateTransactionError::Status503(v.into()) + } + RustSimulateTransactionError::Statusdefault() => { + SimulateTransactionError::Statusdefault() + } + RustSimulateTransactionError::DefaultResponse() => { + SimulateTransactionError::DefaultResponse() + } + RustSimulateTransactionError::UnknownValue(v) => { + SimulateTransactionError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/start_catchup.rs b/crates/algod_client_ffi/src/apis/start_catchup.rs new file mode 100644 index 000000000..bd7ea12c7 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/start_catchup.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::StartCatchupError as RustStartCatchupError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, StartCatchup}; + +// Import request body type if needed + +/// struct for typed errors of method [`start_catchup`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum StartCatchupError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status408(ErrorResponse), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for StartCatchupError { + fn from(e: RustStartCatchupError) -> Self { + match e { + RustStartCatchupError::Status400(v) => StartCatchupError::Status400(v.into()), + RustStartCatchupError::Status401(v) => StartCatchupError::Status401(v.into()), + RustStartCatchupError::Status408(v) => StartCatchupError::Status408(v.into()), + RustStartCatchupError::Status500(v) => StartCatchupError::Status500(v.into()), + RustStartCatchupError::Statusdefault() => StartCatchupError::Statusdefault(), + RustStartCatchupError::DefaultResponse() => StartCatchupError::DefaultResponse(), + RustStartCatchupError::UnknownValue(v) => StartCatchupError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/swagger_json.rs b/crates/algod_client_ffi/src/apis/swagger_json.rs new file mode 100644 index 000000000..97526dd9b --- /dev/null +++ b/crates/algod_client_ffi/src/apis/swagger_json.rs @@ -0,0 +1,37 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::SwaggerJsonError as RustSwaggerJsonError; + +// Import all custom types used by this endpoint + +// Import request body type if needed + +/// struct for typed errors of method [`swagger_json`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum SwaggerJsonError { + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for SwaggerJsonError { + fn from(e: RustSwaggerJsonError) -> Self { + match e { + RustSwaggerJsonError::Statusdefault() => SwaggerJsonError::Statusdefault(), + RustSwaggerJsonError::DefaultResponse() => SwaggerJsonError::DefaultResponse(), + RustSwaggerJsonError::UnknownValue(v) => SwaggerJsonError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/teal_compile.rs b/crates/algod_client_ffi/src/apis/teal_compile.rs new file mode 100644 index 000000000..4e6a23427 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/teal_compile.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::TealCompileError as RustTealCompileError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, TealCompile}; + +// Import request body type if needed + +/// struct for typed errors of method [`teal_compile`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum TealCompileError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for TealCompileError { + fn from(e: RustTealCompileError) -> Self { + match e { + RustTealCompileError::Status400(v) => TealCompileError::Status400(v.into()), + RustTealCompileError::Status401(v) => TealCompileError::Status401(v.into()), + RustTealCompileError::Status404() => TealCompileError::Status404(), + RustTealCompileError::Status500(v) => TealCompileError::Status500(v.into()), + RustTealCompileError::Statusdefault() => TealCompileError::Statusdefault(), + RustTealCompileError::DefaultResponse() => TealCompileError::DefaultResponse(), + RustTealCompileError::UnknownValue(v) => TealCompileError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/teal_disassemble.rs b/crates/algod_client_ffi/src/apis/teal_disassemble.rs new file mode 100644 index 000000000..f85dfae29 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/teal_disassemble.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::TealDisassembleError as RustTealDisassembleError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, TealDisassemble}; + +// Import request body type if needed + +/// struct for typed errors of method [`teal_disassemble`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum TealDisassembleError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for TealDisassembleError { + fn from(e: RustTealDisassembleError) -> Self { + match e { + RustTealDisassembleError::Status400(v) => TealDisassembleError::Status400(v.into()), + RustTealDisassembleError::Status401(v) => TealDisassembleError::Status401(v.into()), + RustTealDisassembleError::Status404() => TealDisassembleError::Status404(), + RustTealDisassembleError::Status500(v) => TealDisassembleError::Status500(v.into()), + RustTealDisassembleError::Statusdefault() => TealDisassembleError::Statusdefault(), + RustTealDisassembleError::DefaultResponse() => TealDisassembleError::DefaultResponse(), + RustTealDisassembleError::UnknownValue(v) => { + TealDisassembleError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/teal_dryrun.rs b/crates/algod_client_ffi/src/apis/teal_dryrun.rs new file mode 100644 index 000000000..8cb193b38 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/teal_dryrun.rs @@ -0,0 +1,47 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::TealDryrunError as RustTealDryrunError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, TealDryrun}; + +// Import request body type if needed +use crate::models::DryrunRequest; + +/// struct for typed errors of method [`teal_dryrun`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum TealDryrunError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status404(), + Status500(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for TealDryrunError { + fn from(e: RustTealDryrunError) -> Self { + match e { + RustTealDryrunError::Status400(v) => TealDryrunError::Status400(v.into()), + RustTealDryrunError::Status401(v) => TealDryrunError::Status401(v.into()), + RustTealDryrunError::Status404() => TealDryrunError::Status404(), + RustTealDryrunError::Status500(v) => TealDryrunError::Status500(v.into()), + RustTealDryrunError::Statusdefault() => TealDryrunError::Statusdefault(), + RustTealDryrunError::DefaultResponse() => TealDryrunError::DefaultResponse(), + RustTealDryrunError::UnknownValue(v) => TealDryrunError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/transaction_params.rs b/crates/algod_client_ffi/src/apis/transaction_params.rs new file mode 100644 index 000000000..bbc1b5610 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/transaction_params.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::TransactionParamsError as RustTransactionParamsError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, TransactionParams}; + +// Import request body type if needed + +/// struct for typed errors of method [`transaction_params`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum TransactionParamsError { + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for TransactionParamsError { + fn from(e: RustTransactionParamsError) -> Self { + match e { + RustTransactionParamsError::Status401(v) => TransactionParamsError::Status401(v.into()), + RustTransactionParamsError::Status500(v) => TransactionParamsError::Status500(v.into()), + RustTransactionParamsError::Status503(v) => TransactionParamsError::Status503(v.into()), + RustTransactionParamsError::Statusdefault() => TransactionParamsError::Statusdefault(), + RustTransactionParamsError::DefaultResponse() => { + TransactionParamsError::DefaultResponse() + } + RustTransactionParamsError::UnknownValue(v) => { + TransactionParamsError::UnknownValue(v.into()) + } + } + } +} diff --git a/crates/algod_client_ffi/src/apis/unset_sync_round.rs b/crates/algod_client_ffi/src/apis/unset_sync_round.rs new file mode 100644 index 000000000..8e765c696 --- /dev/null +++ b/crates/algod_client_ffi/src/apis/unset_sync_round.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::UnsetSyncRoundError as RustUnsetSyncRoundError; + +// Import all custom types used by this endpoint +use crate::models::ErrorResponse; + +// Import request body type if needed + +/// struct for typed errors of method [`unset_sync_round`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum UnsetSyncRoundError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for UnsetSyncRoundError { + fn from(e: RustUnsetSyncRoundError) -> Self { + match e { + RustUnsetSyncRoundError::Status400(v) => UnsetSyncRoundError::Status400(v.into()), + RustUnsetSyncRoundError::Status401(v) => UnsetSyncRoundError::Status401(v.into()), + RustUnsetSyncRoundError::Status500(v) => UnsetSyncRoundError::Status500(v.into()), + RustUnsetSyncRoundError::Status503(v) => UnsetSyncRoundError::Status503(v.into()), + RustUnsetSyncRoundError::Statusdefault() => UnsetSyncRoundError::Statusdefault(), + RustUnsetSyncRoundError::DefaultResponse() => UnsetSyncRoundError::DefaultResponse(), + RustUnsetSyncRoundError::UnknownValue(v) => UnsetSyncRoundError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/apis/wait_for_block.rs b/crates/algod_client_ffi/src/apis/wait_for_block.rs new file mode 100644 index 000000000..1155b867d --- /dev/null +++ b/crates/algod_client_ffi/src/apis/wait_for_block.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use algokit_http_client::{HttpClient, HttpMethod}; +use std::collections::HashMap; + +use super::{AlgodApiError, ContentType, Error}; +use algod_client::apis::WaitForBlockError as RustWaitForBlockError; + +// Import all custom types used by this endpoint +use crate::models::{ErrorResponse, WaitForBlock}; + +// Import request body type if needed + +/// struct for typed errors of method [`wait_for_block`] +#[derive(Debug, Clone, uniffi::Error)] +pub enum WaitForBlockError { + Status400(ErrorResponse), + Status401(ErrorResponse), + Status500(ErrorResponse), + Status503(ErrorResponse), + Statusdefault(), + DefaultResponse(), + UnknownValue(crate::models::UnknownJsonValue), +} + +impl From for WaitForBlockError { + fn from(e: RustWaitForBlockError) -> Self { + match e { + RustWaitForBlockError::Status400(v) => WaitForBlockError::Status400(v.into()), + RustWaitForBlockError::Status401(v) => WaitForBlockError::Status401(v.into()), + RustWaitForBlockError::Status500(v) => WaitForBlockError::Status500(v.into()), + RustWaitForBlockError::Status503(v) => WaitForBlockError::Status503(v.into()), + RustWaitForBlockError::Statusdefault() => WaitForBlockError::Statusdefault(), + RustWaitForBlockError::DefaultResponse() => WaitForBlockError::DefaultResponse(), + RustWaitForBlockError::UnknownValue(v) => WaitForBlockError::UnknownValue(v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/lib.rs b/crates/algod_client_ffi/src/lib.rs new file mode 100644 index 000000000..eaf684059 --- /dev/null +++ b/crates/algod_client_ffi/src/lib.rs @@ -0,0 +1,9 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +uniffi::setup_scaffolding!(); +pub mod apis; +pub mod models; + +// Re-export the main client for convenience +pub use apis::AlgodClient; diff --git a/crates/algod_client_ffi/src/models/abort_catchup.rs b/crates/algod_client_ffi/src/models/abort_catchup.rs new file mode 100644 index 000000000..f8e927a17 --- /dev/null +++ b/crates/algod_client_ffi/src/models/abort_catchup.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AbortCatchup as RustAbortCatchup; + +/// An catchpoint abort response. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AbortCatchup { + /// Catchup abort response string + pub catchup_message: String, +} + +impl From for AbortCatchup { + fn from(rust_struct: RustAbortCatchup) -> Self { + Self { + catchup_message: rust_struct.catchup_message, + } + } +} + +impl From for RustAbortCatchup { + fn from(ffi_struct: AbortCatchup) -> Self { + Self { + catchup_message: ffi_struct.catchup_message, + } + } +} diff --git a/crates/algod_client_ffi/src/models/account.rs b/crates/algod_client_ffi/src/models/account.rs new file mode 100644 index 000000000..76969ca6e --- /dev/null +++ b/crates/algod_client_ffi/src/models/account.rs @@ -0,0 +1,180 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Account as RustAccount; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AccountParticipation; +use crate::models::Application; +use crate::models::ApplicationLocalState; +use crate::models::ApplicationStateSchema; +use crate::models::Asset; +use crate::models::AssetHolding; + +/// Account information at a given round. +/// +/// Definition: +/// data/basics/userBalance.go : AccountData +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Account { + /// the account public key + pub address: String, + /// [algo] total number of MicroAlgos in the account + pub amount: u64, + /// MicroAlgo balance required by the account. + /// + /// The requirement grows based on asset and application usage. + pub min_balance: u64, + /// specifies the amount of MicroAlgos in the account, without the pending rewards. + pub amount_without_pending_rewards: u64, + /// [appl] applications local data stored in this account. + /// + /// Note the raw object uses `map[int] -> AppLocalState` for this type. + pub apps_local_state: Option>, + /// The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. + pub total_apps_opted_in: u64, + pub apps_total_schema: Option, + /// [teap] the sum of all extra application program pages for this account. + pub apps_total_extra_pages: Option, + /// [asset] assets held by this account. + /// + /// Note the raw object uses `map[int] -> AssetHolding` for this type. + pub assets: Option>, + /// The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. + pub total_assets_opted_in: u64, + /// [appp] parameters of applications created by this account including app global data. + /// + /// Note: the raw account uses `map[int] -> AppParams` for this type. + pub created_apps: Option>, + /// The count of all apps (AppParams objects) created by this account. + pub total_created_apps: u64, + /// [apar] parameters of assets created by this account. + /// + /// Note: the raw account uses `map[int] -> Asset` for this type. + pub created_assets: Option>, + /// The count of all assets (AssetParams objects) created by this account. + pub total_created_assets: u64, + /// [tbx] The number of existing boxes created by this account's app. + pub total_boxes: Option, + /// [tbxb] The total number of bytes used by this account's app's box keys and values. + pub total_box_bytes: Option, + pub participation: Option, + /// Whether or not the account can receive block incentives if its balance is in range at proposal time. + pub incentive_eligible: Option, + /// amount of MicroAlgos of pending rewards in this account. + pub pending_rewards: u64, + /// [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. + pub reward_base: Option, + /// [ern] total rewards of MicroAlgos the account has received, including pending rewards. + pub rewards: u64, + /// The round for which this information is relevant. + pub round: u64, + /// [onl] delegation status of the account's MicroAlgos + /// * Offline - indicates that the associated account is delegated. + /// * Online - indicates that the associated account used as part of the delegation pool. + /// * NotParticipating - indicates that the associated account is neither a delegator nor a delegate. + pub status: String, + /// Indicates what type of signature is used by this account, must be one of: + /// * sig + /// * msig + /// * lsig + pub sig_type: Option, + /// [spend] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. + pub auth_addr: Option, + /// The round in which this account last proposed the block. + pub last_proposed: Option, + /// The round in which this account last went online, or explicitly renewed their online status. + pub last_heartbeat: Option, +} + +impl From for Account { + fn from(rust_struct: RustAccount) -> Self { + Self { + address: rust_struct.address, + amount: rust_struct.amount, + min_balance: rust_struct.min_balance, + amount_without_pending_rewards: rust_struct.amount_without_pending_rewards, + apps_local_state: rust_struct + .apps_local_state + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_apps_opted_in: rust_struct.total_apps_opted_in, + apps_total_schema: rust_struct.apps_total_schema.map(|v| v.into()), + apps_total_extra_pages: rust_struct.apps_total_extra_pages, + assets: rust_struct + .assets + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_assets_opted_in: rust_struct.total_assets_opted_in, + created_apps: rust_struct + .created_apps + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_created_apps: rust_struct.total_created_apps, + created_assets: rust_struct + .created_assets + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_created_assets: rust_struct.total_created_assets, + total_boxes: rust_struct.total_boxes, + total_box_bytes: rust_struct.total_box_bytes, + participation: rust_struct.participation.map(|v| v.into()), + incentive_eligible: rust_struct.incentive_eligible, + pending_rewards: rust_struct.pending_rewards, + reward_base: rust_struct.reward_base, + rewards: rust_struct.rewards, + round: rust_struct.round, + status: rust_struct.status, + sig_type: rust_struct.sig_type, + auth_addr: rust_struct.auth_addr, + last_proposed: rust_struct.last_proposed, + last_heartbeat: rust_struct.last_heartbeat, + } + } +} + +impl From for RustAccount { + fn from(ffi_struct: Account) -> Self { + Self { + address: ffi_struct.address, + amount: ffi_struct.amount, + min_balance: ffi_struct.min_balance, + amount_without_pending_rewards: ffi_struct.amount_without_pending_rewards, + apps_local_state: ffi_struct + .apps_local_state + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_apps_opted_in: ffi_struct.total_apps_opted_in, + apps_total_schema: ffi_struct.apps_total_schema.map(|v| v.into()), + apps_total_extra_pages: ffi_struct.apps_total_extra_pages, + assets: ffi_struct + .assets + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_assets_opted_in: ffi_struct.total_assets_opted_in, + created_apps: ffi_struct + .created_apps + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_created_apps: ffi_struct.total_created_apps, + created_assets: ffi_struct + .created_assets + .map(|v| v.into_iter().map(|v| v.into()).collect()), + total_created_assets: ffi_struct.total_created_assets, + total_boxes: ffi_struct.total_boxes, + total_box_bytes: ffi_struct.total_box_bytes, + participation: ffi_struct.participation.map(|v| v.into()), + incentive_eligible: ffi_struct.incentive_eligible, + pending_rewards: ffi_struct.pending_rewards, + reward_base: ffi_struct.reward_base, + rewards: ffi_struct.rewards, + round: ffi_struct.round, + status: ffi_struct.status, + sig_type: ffi_struct.sig_type, + auth_addr: ffi_struct.auth_addr, + last_proposed: ffi_struct.last_proposed, + last_heartbeat: ffi_struct.last_heartbeat, + } + } +} diff --git a/crates/algod_client_ffi/src/models/account_application_information.rs b/crates/algod_client_ffi/src/models/account_application_information.rs new file mode 100644 index 000000000..c6ea29889 --- /dev/null +++ b/crates/algod_client_ffi/src/models/account_application_information.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AccountApplicationInformation as RustAccountApplicationInformation; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationLocalState; +use crate::models::ApplicationParams; + +/// AccountApplicationResponse describes the account's application local state and global state (AppLocalState and AppParams, if either exists) for a specific application ID. Global state will only be returned if the provided address is the application's creator. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AccountApplicationInformation { + /// The round for which this information is relevant. + pub round: u64, + pub app_local_state: Option, + pub created_app: Option, +} + +impl From for AccountApplicationInformation { + fn from(rust_struct: RustAccountApplicationInformation) -> Self { + Self { + round: rust_struct.round, + app_local_state: rust_struct.app_local_state.map(|v| v.into()), + created_app: rust_struct.created_app.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/account_asset_holding.rs b/crates/algod_client_ffi/src/models/account_asset_holding.rs new file mode 100644 index 000000000..74415ddda --- /dev/null +++ b/crates/algod_client_ffi/src/models/account_asset_holding.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AccountAssetHolding as RustAccountAssetHolding; + +use crate::models::AssetHolding; +use crate::models::AssetParams; + +/// AccountAssetHolding describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AccountAssetHolding { + pub asset_holding: AssetHolding, + pub asset_params: Option, +} + +impl From for AccountAssetHolding { + fn from(rust_struct: RustAccountAssetHolding) -> Self { + Self { + asset_holding: rust_struct.asset_holding.into(), + asset_params: rust_struct.asset_params.map(|v| v.into()), + } + } +} + +impl From for RustAccountAssetHolding { + fn from(ffi_struct: AccountAssetHolding) -> Self { + Self { + asset_holding: ffi_struct.asset_holding.into(), + asset_params: ffi_struct.asset_params.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/account_asset_information.rs b/crates/algod_client_ffi/src/models/account_asset_information.rs new file mode 100644 index 000000000..619c15807 --- /dev/null +++ b/crates/algod_client_ffi/src/models/account_asset_information.rs @@ -0,0 +1,45 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AccountAssetInformation as RustAccountAssetInformation; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AssetHolding; +use crate::models::AssetParams; + +/// AccountAssetResponse describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. Asset parameters will only be returned if the provided address is the asset's creator. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AccountAssetInformation { + /// The round for which this information is relevant. + pub round: u64, + pub asset_holding: Option, + pub created_asset: Option, +} + +impl From for AccountAssetInformation { + fn from(rust_struct: RustAccountAssetInformation) -> Self { + Self { + round: rust_struct.round, + asset_holding: rust_struct.asset_holding.map(|v| v.into()), + created_asset: rust_struct.created_asset.map(|v| v.into()), + } + } +} + +impl From for RustAccountAssetInformation { + fn from(ffi_struct: AccountAssetInformation) -> Self { + Self { + round: ffi_struct.round, + asset_holding: ffi_struct.asset_holding.map(|v| v.into()), + created_asset: ffi_struct.created_asset.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/account_assets_information.rs b/crates/algod_client_ffi/src/models/account_assets_information.rs new file mode 100644 index 000000000..ec8c62b8c --- /dev/null +++ b/crates/algod_client_ffi/src/models/account_assets_information.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AccountAssetsInformation as RustAccountAssetsInformation; + +use crate::models::AccountAssetHolding; + +/// AccountAssetsInformationResponse contains a list of assets held by an account. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AccountAssetsInformation { + /// The round for which this information is relevant. + pub round: u64, + /// Used for pagination, when making another request provide this token with the next parameter. + pub next_token: Option, + pub asset_holdings: Option>, +} + +impl From for AccountAssetsInformation { + fn from(rust_struct: RustAccountAssetsInformation) -> Self { + Self { + round: rust_struct.round, + next_token: rust_struct.next_token, + asset_holdings: rust_struct + .asset_holdings + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} + +impl From for RustAccountAssetsInformation { + fn from(ffi_struct: AccountAssetsInformation) -> Self { + Self { + round: ffi_struct.round, + next_token: ffi_struct.next_token, + asset_holdings: ffi_struct + .asset_holdings + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/account_participation.rs b/crates/algod_client_ffi/src/models/account_participation.rs new file mode 100644 index 000000000..087e9b43e --- /dev/null +++ b/crates/algod_client_ffi/src/models/account_participation.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AccountParticipation as RustAccountParticipation; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// AccountParticipation describes the parameters used by this account in consensus protocol. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AccountParticipation { + /// [sel] Selection public key (if any) currently registered for this round. + pub selection_participation_key: Vec, + /// [voteFst] First round for which this participation is valid. + pub vote_first_valid: u64, + /// [voteKD] Number of subkeys in each batch of participation keys. + pub vote_key_dilution: u64, + /// [voteLst] Last round for which this participation is valid. + pub vote_last_valid: u64, + /// [vote] root participation public key (if any) currently registered for this round. + pub vote_participation_key: Vec, + /// [stprf] Root of the state proof key (if any) + pub state_proof_key: Option>, +} + +impl From for AccountParticipation { + fn from(rust_struct: RustAccountParticipation) -> Self { + Self { + selection_participation_key: rust_struct.selection_participation_key, + vote_first_valid: rust_struct.vote_first_valid, + vote_key_dilution: rust_struct.vote_key_dilution, + vote_last_valid: rust_struct.vote_last_valid, + vote_participation_key: rust_struct.vote_participation_key, + state_proof_key: rust_struct.state_proof_key, + } + } +} + +impl From for RustAccountParticipation { + fn from(ffi_struct: AccountParticipation) -> Self { + Self { + selection_participation_key: ffi_struct.selection_participation_key, + vote_first_valid: ffi_struct.vote_first_valid, + vote_key_dilution: ffi_struct.vote_key_dilution, + vote_last_valid: ffi_struct.vote_last_valid, + vote_participation_key: ffi_struct.vote_participation_key, + state_proof_key: ffi_struct.state_proof_key, + } + } +} diff --git a/crates/algod_client_ffi/src/models/account_state_delta.rs b/crates/algod_client_ffi/src/models/account_state_delta.rs new file mode 100644 index 000000000..94a20fb0c --- /dev/null +++ b/crates/algod_client_ffi/src/models/account_state_delta.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AccountStateDelta as RustAccountStateDelta; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::StateDelta; + +/// Application state delta. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AccountStateDelta { + pub address: String, + pub delta: StateDelta, +} + +impl From for AccountStateDelta { + fn from(rust_struct: RustAccountStateDelta) -> Self { + Self { + address: rust_struct.address, + delta: rust_struct.delta.into(), + } + } +} + +impl From for RustAccountStateDelta { + fn from(ffi_struct: AccountStateDelta) -> Self { + Self { + address: ffi_struct.address, + delta: ffi_struct.delta.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/add_participation_key.rs b/crates/algod_client_ffi/src/models/add_participation_key.rs new file mode 100644 index 000000000..e8e54151a --- /dev/null +++ b/crates/algod_client_ffi/src/models/add_participation_key.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AddParticipationKey as RustAddParticipationKey; + +/// Participation ID of the submission +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AddParticipationKey { + /// encoding of the participation ID. + pub part_id: String, +} + +impl From for AddParticipationKey { + fn from(rust_struct: RustAddParticipationKey) -> Self { + Self { + part_id: rust_struct.part_id, + } + } +} + +impl From for RustAddParticipationKey { + fn from(ffi_struct: AddParticipationKey) -> Self { + Self { + part_id: ffi_struct.part_id, + } + } +} diff --git a/crates/algod_client_ffi/src/models/app_call_logs.rs b/crates/algod_client_ffi/src/models/app_call_logs.rs new file mode 100644 index 000000000..4f0ca84cc --- /dev/null +++ b/crates/algod_client_ffi/src/models/app_call_logs.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AppCallLogs as RustAppCallLogs; + +/// The logged messages from an app call along with the app ID and outer transaction ID. Logs appear in the same order that they were emitted. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AppCallLogs { + /// An array of logs + pub logs: Vec>, + /// The application from which the logs were generated + pub app_id: u64, + /// The transaction ID of the outer app call that lead to these logs + pub tx_id: String, +} + +impl From for AppCallLogs { + fn from(rust_struct: RustAppCallLogs) -> Self { + Self { + logs: rust_struct.logs.into_iter().collect(), + app_id: rust_struct.app_id, + tx_id: rust_struct.tx_id, + } + } +} + +impl From for RustAppCallLogs { + fn from(ffi_struct: AppCallLogs) -> Self { + Self { + logs: ffi_struct.logs.into_iter().collect(), + app_id: ffi_struct.app_id, + tx_id: ffi_struct.tx_id, + } + } +} diff --git a/crates/algod_client_ffi/src/models/application.rs b/crates/algod_client_ffi/src/models/application.rs new file mode 100644 index 000000000..043dfb0bb --- /dev/null +++ b/crates/algod_client_ffi/src/models/application.rs @@ -0,0 +1,41 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Application as RustApplication; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationParams; + +/// Application index and its parameters +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Application { + /// [appidx] application index. + pub id: u64, + pub params: ApplicationParams, +} + +impl From for Application { + fn from(rust_struct: RustApplication) -> Self { + Self { + id: rust_struct.id, + params: rust_struct.params.into(), + } + } +} + +impl From for RustApplication { + fn from(ffi_struct: Application) -> Self { + Self { + id: ffi_struct.id, + params: ffi_struct.params.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_initial_states.rs b/crates/algod_client_ffi/src/models/application_initial_states.rs new file mode 100644 index 000000000..7aeb86e61 --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_initial_states.rs @@ -0,0 +1,52 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationInitialStates as RustApplicationInitialStates; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationKvStorage; + +/// An application's initial global/local/box states that were accessed during simulation. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationInitialStates { + /// Application index. + pub id: u64, + /// An application's initial local states tied to different accounts. + pub app_locals: Option>, + pub app_globals: Option, + pub app_boxes: Option, +} + +impl From for ApplicationInitialStates { + fn from(rust_struct: RustApplicationInitialStates) -> Self { + Self { + id: rust_struct.id, + app_locals: rust_struct + .app_locals + .map(|v| v.into_iter().map(|v| v.into()).collect()), + app_globals: rust_struct.app_globals.map(|v| v.into()), + app_boxes: rust_struct.app_boxes.map(|v| v.into()), + } + } +} + +impl From for RustApplicationInitialStates { + fn from(ffi_struct: ApplicationInitialStates) -> Self { + Self { + id: ffi_struct.id, + app_locals: ffi_struct + .app_locals + .map(|v| v.into_iter().map(|v| v.into()).collect()), + app_globals: ffi_struct.app_globals.map(|v| v.into()), + app_boxes: ffi_struct.app_boxes.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_kv_storage.rs b/crates/algod_client_ffi/src/models/application_kv_storage.rs new file mode 100644 index 000000000..f90fcba04 --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_kv_storage.rs @@ -0,0 +1,42 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationKvStorage as RustApplicationKvStorage; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AvmKeyValue; + +/// An application's global/local/box state. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationKvStorage { + /// Key-Value pairs representing application states. + pub kvs: Vec, + /// The address of the account associated with the local state. + pub account: Option, +} + +impl From for ApplicationKvStorage { + fn from(rust_struct: RustApplicationKvStorage) -> Self { + Self { + kvs: rust_struct.kvs.into_iter().map(|v| v.into()).collect(), + account: rust_struct.account, + } + } +} + +impl From for RustApplicationKvStorage { + fn from(ffi_struct: ApplicationKvStorage) -> Self { + Self { + kvs: ffi_struct.kvs.into_iter().map(|v| v.into()).collect(), + account: ffi_struct.account, + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_local_reference.rs b/crates/algod_client_ffi/src/models/application_local_reference.rs new file mode 100644 index 000000000..2235be841 --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_local_reference.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationLocalReference as RustApplicationLocalReference; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// References an account's local state for an application. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationLocalReference { + /// Address of the account with the local state. + pub account: String, + /// Application ID of the local state application. + pub app: u64, +} + +impl From for ApplicationLocalReference { + fn from(rust_struct: RustApplicationLocalReference) -> Self { + Self { + account: rust_struct.account, + app: rust_struct.app, + } + } +} + +impl From for RustApplicationLocalReference { + fn from(ffi_struct: ApplicationLocalReference) -> Self { + Self { + account: ffi_struct.account, + app: ffi_struct.app, + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_local_state.rs b/crates/algod_client_ffi/src/models/application_local_state.rs new file mode 100644 index 000000000..f33318a92 --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_local_state.rs @@ -0,0 +1,45 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationLocalState as RustApplicationLocalState; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationStateSchema; +use crate::models::TealKeyValueStore; + +/// Stores local state associated with an application. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationLocalState { + /// The application which this local state is for. + pub id: u64, + pub schema: ApplicationStateSchema, + pub key_value: Option, +} + +impl From for ApplicationLocalState { + fn from(rust_struct: RustApplicationLocalState) -> Self { + Self { + id: rust_struct.id, + schema: rust_struct.schema.into(), + key_value: rust_struct.key_value.map(|v| v.into()), + } + } +} + +impl From for RustApplicationLocalState { + fn from(ffi_struct: ApplicationLocalState) -> Self { + Self { + id: ffi_struct.id, + schema: ffi_struct.schema.into(), + key_value: ffi_struct.key_value.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_params.rs b/crates/algod_client_ffi/src/models/application_params.rs new file mode 100644 index 000000000..fd459875c --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_params.rs @@ -0,0 +1,64 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationParams as RustApplicationParams; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationStateSchema; +use crate::models::TealKeyValueStore; + +/// Stores the global information associated with an application. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationParams { + /// The address that created this application. This is the address where the parameters and global state for this application can be found. + pub creator: String, + /// [approv] approval program. + pub approval_program: Vec, + /// [clearp] approval program. + pub clear_state_program: Vec, + /// [epp] the amount of extra program pages available to this app. + pub extra_program_pages: Option, + pub local_state_schema: Option, + pub global_state_schema: Option, + pub global_state: Option, + /// [v] the number of updates to the application programs + pub version: Option, +} + +impl From for ApplicationParams { + fn from(rust_struct: RustApplicationParams) -> Self { + Self { + creator: rust_struct.creator, + approval_program: rust_struct.approval_program, + clear_state_program: rust_struct.clear_state_program, + extra_program_pages: rust_struct.extra_program_pages, + local_state_schema: rust_struct.local_state_schema.map(|v| v.into()), + global_state_schema: rust_struct.global_state_schema.map(|v| v.into()), + global_state: rust_struct.global_state.map(|v| v.into()), + version: rust_struct.version, + } + } +} + +impl From for RustApplicationParams { + fn from(ffi_struct: ApplicationParams) -> Self { + Self { + creator: ffi_struct.creator, + approval_program: ffi_struct.approval_program, + clear_state_program: ffi_struct.clear_state_program, + extra_program_pages: ffi_struct.extra_program_pages, + local_state_schema: ffi_struct.local_state_schema.map(|v| v.into()), + global_state_schema: ffi_struct.global_state_schema.map(|v| v.into()), + global_state: ffi_struct.global_state.map(|v| v.into()), + version: ffi_struct.version, + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_state_operation.rs b/crates/algod_client_ffi/src/models/application_state_operation.rs new file mode 100644 index 000000000..b67896c86 --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_state_operation.rs @@ -0,0 +1,53 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationStateOperation as RustApplicationStateOperation; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AvmValue; + +/// An operation against an application's global/local/box state. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationStateOperation { + /// Operation type. Value `w` is **write**, `d` is **delete**. + pub operation: String, + /// Type of application state. Value `g` is **global state**, `l` is **local state**, `b` is **boxes**. + pub app_state_type: String, + /// The key (name) of the global/local/box state. + pub key: Vec, + pub new_value: Option, + /// For local state changes, the address of the account associated with the local state. + pub account: Option, +} + +impl From for ApplicationStateOperation { + fn from(rust_struct: RustApplicationStateOperation) -> Self { + Self { + operation: rust_struct.operation, + app_state_type: rust_struct.app_state_type, + key: rust_struct.key, + new_value: rust_struct.new_value.map(|v| v.into()), + account: rust_struct.account, + } + } +} + +impl From for RustApplicationStateOperation { + fn from(ffi_struct: ApplicationStateOperation) -> Self { + Self { + operation: ffi_struct.operation, + app_state_type: ffi_struct.app_state_type, + key: ffi_struct.key, + new_value: ffi_struct.new_value.map(|v| v.into()), + account: ffi_struct.account, + } + } +} diff --git a/crates/algod_client_ffi/src/models/application_state_schema.rs b/crates/algod_client_ffi/src/models/application_state_schema.rs new file mode 100644 index 000000000..3b1f47262 --- /dev/null +++ b/crates/algod_client_ffi/src/models/application_state_schema.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ApplicationStateSchema as RustApplicationStateSchema; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// Specifies maximums on the number of each type that may be stored. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ApplicationStateSchema { + /// [nui] num of uints. + pub num_uint: u32, + /// [nbs] num of byte slices. + pub num_byte_slice: u32, +} + +impl From for ApplicationStateSchema { + fn from(rust_struct: RustApplicationStateSchema) -> Self { + Self { + num_uint: rust_struct.num_uint, + num_byte_slice: rust_struct.num_byte_slice, + } + } +} + +impl From for RustApplicationStateSchema { + fn from(ffi_struct: ApplicationStateSchema) -> Self { + Self { + num_uint: ffi_struct.num_uint, + num_byte_slice: ffi_struct.num_byte_slice, + } + } +} diff --git a/crates/algod_client_ffi/src/models/asset.rs b/crates/algod_client_ffi/src/models/asset.rs new file mode 100644 index 000000000..aa56620a4 --- /dev/null +++ b/crates/algod_client_ffi/src/models/asset.rs @@ -0,0 +1,41 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Asset as RustAsset; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AssetParams; + +/// Specifies both the unique identifier and the parameters for an asset +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Asset { + /// unique asset identifier + pub index: u64, + pub params: AssetParams, +} + +impl From for Asset { + fn from(rust_struct: RustAsset) -> Self { + Self { + index: rust_struct.index, + params: rust_struct.params.into(), + } + } +} + +impl From for RustAsset { + fn from(ffi_struct: Asset) -> Self { + Self { + index: ffi_struct.index, + params: ffi_struct.params.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/asset_holding.rs b/crates/algod_client_ffi/src/models/asset_holding.rs new file mode 100644 index 000000000..237043365 --- /dev/null +++ b/crates/algod_client_ffi/src/models/asset_holding.rs @@ -0,0 +1,47 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AssetHolding as RustAssetHolding; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// Describes an asset held by an account. +/// +/// Definition: +/// data/basics/userBalance.go : AssetHolding +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AssetHolding { + /// [a] number of units held. + pub amount: u64, + /// Asset ID of the holding. + pub asset_id: u64, + /// [f] whether or not the holding is frozen. + pub is_frozen: bool, +} + +impl From for AssetHolding { + fn from(rust_struct: RustAssetHolding) -> Self { + Self { + amount: rust_struct.amount, + asset_id: rust_struct.asset_id, + is_frozen: rust_struct.is_frozen, + } + } +} + +impl From for RustAssetHolding { + fn from(ffi_struct: AssetHolding) -> Self { + Self { + amount: ffi_struct.amount, + asset_id: ffi_struct.asset_id, + is_frozen: ffi_struct.is_frozen, + } + } +} diff --git a/crates/algod_client_ffi/src/models/asset_holding_reference.rs b/crates/algod_client_ffi/src/models/asset_holding_reference.rs new file mode 100644 index 000000000..75e0f65d6 --- /dev/null +++ b/crates/algod_client_ffi/src/models/asset_holding_reference.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AssetHoldingReference as RustAssetHoldingReference; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// References an asset held by an account. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AssetHoldingReference { + /// Address of the account holding the asset. + pub account: String, + /// Asset ID of the holding. + pub asset: u64, +} + +impl From for AssetHoldingReference { + fn from(rust_struct: RustAssetHoldingReference) -> Self { + Self { + account: rust_struct.account, + asset: rust_struct.asset, + } + } +} + +impl From for RustAssetHoldingReference { + fn from(ffi_struct: AssetHoldingReference) -> Self { + Self { + account: ffi_struct.account, + asset: ffi_struct.asset, + } + } +} diff --git a/crates/algod_client_ffi/src/models/asset_params.rs b/crates/algod_client_ffi/src/models/asset_params.rs new file mode 100644 index 000000000..f8a71fe3a --- /dev/null +++ b/crates/algod_client_ffi/src/models/asset_params.rs @@ -0,0 +1,97 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AssetParams as RustAssetParams; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// AssetParams specifies the parameters for an asset. +/// +/// [apar] when part of an AssetConfig transaction. +/// +/// Definition: +/// data/transactions/asset.go : AssetParams +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AssetParams { + /// [c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted. + pub clawback: Option, + /// The address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case. + pub creator: String, + /// [dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive). + pub decimals: u64, + /// [df] Whether holdings of this asset are frozen by default. + pub default_frozen: Option, + /// [f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted. + pub freeze: Option, + /// [m] Address of account used to manage the keys of this asset and to destroy it. + pub manager: Option, + /// [am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application. + pub metadata_hash: Option>, + /// [an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters. + pub name: Option, + /// Base64 encoded name of this asset, as supplied by the creator. + pub name_b64: Option>, + /// [r] Address of account holding reserve (non-minted) units of this asset. + pub reserve: Option, + /// [t] The total number of units of this asset. + pub total: u64, + /// [un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters. + pub unit_name: Option, + /// Base64 encoded name of a unit of this asset, as supplied by the creator. + pub unit_name_b64: Option>, + /// [au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters. + pub url: Option, + /// Base64 encoded URL where more information about the asset can be retrieved. + pub url_b64: Option>, +} + +impl From for AssetParams { + fn from(rust_struct: RustAssetParams) -> Self { + Self { + clawback: rust_struct.clawback, + creator: rust_struct.creator, + decimals: rust_struct.decimals, + default_frozen: rust_struct.default_frozen, + freeze: rust_struct.freeze, + manager: rust_struct.manager, + metadata_hash: rust_struct.metadata_hash, + name: rust_struct.name, + name_b64: rust_struct.name_b64, + reserve: rust_struct.reserve, + total: rust_struct.total, + unit_name: rust_struct.unit_name, + unit_name_b64: rust_struct.unit_name_b64, + url: rust_struct.url, + url_b64: rust_struct.url_b64, + } + } +} + +impl From for RustAssetParams { + fn from(ffi_struct: AssetParams) -> Self { + Self { + clawback: ffi_struct.clawback, + creator: ffi_struct.creator, + decimals: ffi_struct.decimals, + default_frozen: ffi_struct.default_frozen, + freeze: ffi_struct.freeze, + manager: ffi_struct.manager, + metadata_hash: ffi_struct.metadata_hash, + name: ffi_struct.name, + name_b64: ffi_struct.name_b64, + reserve: ffi_struct.reserve, + total: ffi_struct.total, + unit_name: ffi_struct.unit_name, + unit_name_b64: ffi_struct.unit_name_b64, + url: ffi_struct.url, + url_b64: ffi_struct.url_b64, + } + } +} diff --git a/crates/algod_client_ffi/src/models/avm_key_value.rs b/crates/algod_client_ffi/src/models/avm_key_value.rs new file mode 100644 index 000000000..b032c58ab --- /dev/null +++ b/crates/algod_client_ffi/src/models/avm_key_value.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AvmKeyValue as RustAvmKeyValue; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AvmValue; + +/// Represents an AVM key-value pair in an application store. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AvmKeyValue { + pub key: Vec, + pub value: AvmValue, +} + +impl From for AvmKeyValue { + fn from(rust_struct: RustAvmKeyValue) -> Self { + Self { + key: rust_struct.key, + value: rust_struct.value.into(), + } + } +} + +impl From for RustAvmKeyValue { + fn from(ffi_struct: AvmKeyValue) -> Self { + Self { + key: ffi_struct.key, + value: ffi_struct.value.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/avm_value.rs b/crates/algod_client_ffi/src/models/avm_value.rs new file mode 100644 index 000000000..75a8bd5ca --- /dev/null +++ b/crates/algod_client_ffi/src/models/avm_value.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::AvmValue as RustAvmValue; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// Represents an AVM value. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct AvmValue { + /// value type. Value `1` refers to **bytes**, value `2` refers to **uint64** + pub r#type: u64, + /// bytes value. + pub bytes: Option, + /// uint value. + pub uint: Option, +} + +impl From for AvmValue { + fn from(rust_struct: RustAvmValue) -> Self { + Self { + r#type: rust_struct.r#type, + bytes: rust_struct.bytes, + uint: rust_struct.uint, + } + } +} + +impl From for RustAvmValue { + fn from(ffi_struct: AvmValue) -> Self { + Self { + r#type: ffi_struct.r#type, + bytes: ffi_struct.bytes, + uint: ffi_struct.uint, + } + } +} diff --git a/crates/algod_client_ffi/src/models/block.rs b/crates/algod_client_ffi/src/models/block.rs new file mode 100644 index 000000000..56e778e4e --- /dev/null +++ b/crates/algod_client_ffi/src/models/block.rs @@ -0,0 +1,182 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Block as RustBlock; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::BlockStateProofTracking; +use crate::models::SignedTxnInBlock; + +/// Block contains the BlockHeader and the list of transactions (Payset). +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Block { + /// [rnd] Round number. + pub round: Option, + /// [prev] Previous block hash. + pub previous_block_hash: Option>, + /// [prev512] Previous block hash using SHA-512. + pub previous_block_hash_512: Option>, + /// [seed] Sortition seed. + pub seed: Option>, + /// [txn] Root of transaction merkle tree using SHA512_256. + pub transactions_root: Option>, + /// [txn256] Root of transaction vector commitment using SHA256. + pub transactions_root_sha256: Option>, + /// [txn512] Root of transaction vector commitment using SHA512. + pub transactions_root_sha512: Option>, + /// [ts] Block timestamp in seconds since epoch. + pub timestamp: Option, + /// [gen] Genesis ID. + pub genesis_id: Option, + /// [gh] Genesis hash. + pub genesis_hash: Option>, + /// [prp] Proposer address. + pub proposer: Option>, + /// [fc] Fees collected in this block. + pub fees_collected: Option, + /// [bi] Bonus incentive for block proposal. + pub bonus: Option, + /// [pp] Proposer payout. + pub proposer_payout: Option, + /// [fees] FeeSink address. + pub fee_sink: Option>, + /// [rwd] RewardsPool address. + pub rewards_pool: Option>, + /// [earn] Rewards level. + pub rewards_level: Option, + /// [rate] Rewards rate. + pub rewards_rate: Option, + /// [frac] Rewards residue. + pub rewards_residue: Option, + /// [rwcalr] Rewards recalculation round. + pub rewards_recalculation_round: Option, + /// [proto] Current consensus protocol. + pub current_protocol: Option, + /// [nextproto] Next proposed protocol. + pub next_protocol: Option, + /// [nextyes] Next protocol approvals. + pub next_protocol_approvals: Option, + /// [nextbefore] Next protocol vote deadline. + pub next_protocol_vote_before: Option, + /// [nextswitch] Next protocol switch round. + pub next_protocol_switch_on: Option, + /// [upgradeprop] Upgrade proposal. + pub upgrade_propose: Option, + /// [upgradedelay] Upgrade delay in rounds. + pub upgrade_delay: Option, + /// [upgradeyes] Upgrade approval flag. + pub upgrade_approve: Option, + /// [tc] Transaction counter. + pub txn_counter: Option, + /// [spt] State proof tracking data keyed by state proof type. + pub state_proof_tracking: Option, + /// [partupdrmv] Expired participation accounts. + pub expired_participation_accounts: Option>>, + /// [partupdabs] Absent participation accounts. + pub absent_participation_accounts: Option>>, + /// [txns] Block transactions (Payset). + pub transactions: Option>, +} + +impl From for Block { + fn from(rust_struct: RustBlock) -> Self { + Self { + round: rust_struct.round, + previous_block_hash: rust_struct.previous_block_hash, + previous_block_hash_512: rust_struct.previous_block_hash_512, + seed: rust_struct.seed, + transactions_root: rust_struct.transactions_root, + transactions_root_sha256: rust_struct.transactions_root_sha256, + transactions_root_sha512: rust_struct.transactions_root_sha512, + timestamp: rust_struct.timestamp, + genesis_id: rust_struct.genesis_id, + genesis_hash: rust_struct.genesis_hash, + proposer: rust_struct.proposer, + fees_collected: rust_struct.fees_collected, + bonus: rust_struct.bonus, + proposer_payout: rust_struct.proposer_payout, + fee_sink: rust_struct.fee_sink, + rewards_pool: rust_struct.rewards_pool, + rewards_level: rust_struct.rewards_level, + rewards_rate: rust_struct.rewards_rate, + rewards_residue: rust_struct.rewards_residue, + rewards_recalculation_round: rust_struct.rewards_recalculation_round, + current_protocol: rust_struct.current_protocol, + next_protocol: rust_struct.next_protocol, + next_protocol_approvals: rust_struct.next_protocol_approvals, + next_protocol_vote_before: rust_struct.next_protocol_vote_before, + next_protocol_switch_on: rust_struct.next_protocol_switch_on, + upgrade_propose: rust_struct.upgrade_propose, + upgrade_delay: rust_struct.upgrade_delay, + upgrade_approve: rust_struct.upgrade_approve, + txn_counter: rust_struct.txn_counter, + state_proof_tracking: rust_struct + .state_proof_tracking + .map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + expired_participation_accounts: rust_struct.expired_participation_accounts, + absent_participation_accounts: rust_struct.absent_participation_accounts, + transactions: rust_struct + .transactions + .map(|v| v.into_iter().map(|tx| tx.into()).collect()), + } + } +} + +impl TryFrom for RustBlock { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: Block) -> Result { + Ok(Self { + round: ffi_struct.round, + previous_block_hash: ffi_struct.previous_block_hash, + previous_block_hash_512: ffi_struct.previous_block_hash_512, + seed: ffi_struct.seed, + transactions_root: ffi_struct.transactions_root, + transactions_root_sha256: ffi_struct.transactions_root_sha256, + transactions_root_sha512: ffi_struct.transactions_root_sha512, + timestamp: ffi_struct.timestamp, + genesis_id: ffi_struct.genesis_id, + genesis_hash: ffi_struct.genesis_hash, + proposer: ffi_struct.proposer, + fees_collected: ffi_struct.fees_collected, + bonus: ffi_struct.bonus, + proposer_payout: ffi_struct.proposer_payout, + fee_sink: ffi_struct.fee_sink, + rewards_pool: ffi_struct.rewards_pool, + rewards_level: ffi_struct.rewards_level, + rewards_rate: ffi_struct.rewards_rate, + rewards_residue: ffi_struct.rewards_residue, + rewards_recalculation_round: ffi_struct.rewards_recalculation_round, + current_protocol: ffi_struct.current_protocol, + next_protocol: ffi_struct.next_protocol, + next_protocol_approvals: ffi_struct.next_protocol_approvals, + next_protocol_vote_before: ffi_struct.next_protocol_vote_before, + next_protocol_switch_on: ffi_struct.next_protocol_switch_on, + upgrade_propose: ffi_struct.upgrade_propose, + upgrade_delay: ffi_struct.upgrade_delay, + upgrade_approve: ffi_struct.upgrade_approve, + txn_counter: ffi_struct.txn_counter, + state_proof_tracking: ffi_struct + .state_proof_tracking + .map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + expired_participation_accounts: ffi_struct.expired_participation_accounts, + absent_participation_accounts: ffi_struct.absent_participation_accounts, + transactions: ffi_struct + .transactions + .map(|v| { + v.into_iter() + .map(|tx| tx.try_into()) + .collect::, _>>() + }) + .transpose()?, + }) + } +} diff --git a/crates/algod_client_ffi/src/models/block_account_state_delta.rs b/crates/algod_client_ffi/src/models/block_account_state_delta.rs new file mode 100644 index 000000000..775b07de3 --- /dev/null +++ b/crates/algod_client_ffi/src/models/block_account_state_delta.rs @@ -0,0 +1,46 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use crate::models::BlockStateDelta; +use algod_client::models::BlockAccountStateDelta as RustBlockAccountStateDelta; + +/// BlockAccountStateDelta pairs an address with a BlockStateDelta map. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BlockAccountStateDelta { + pub address: String, + pub delta: BlockStateDelta, +} + +impl From for BlockAccountStateDelta { + fn from(rust_struct: RustBlockAccountStateDelta) -> Self { + Self { + address: rust_struct.address, + delta: rust_struct + .delta + .into_iter() + .map(|(k, v)| (k, v.into())) + .collect(), + } + } +} + +impl From for RustBlockAccountStateDelta { + fn from(ffi_struct: BlockAccountStateDelta) -> Self { + Self { + address: ffi_struct.address, + delta: ffi_struct + .delta + .into_iter() + .map(|(k, v)| (k, v.into())) + .collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/block_app_eval_delta.rs b/crates/algod_client_ffi/src/models/block_app_eval_delta.rs new file mode 100644 index 000000000..d223b692b --- /dev/null +++ b/crates/algod_client_ffi/src/models/block_app_eval_delta.rs @@ -0,0 +1,79 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::BlockAppEvalDelta as RustBlockAppEvalDelta; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; +use std::collections::HashMap; + +use crate::models::BlockStateDelta; +use crate::models::SignedTxnInBlock; + +/// BlockAppEvalDelta matches msgpack wire for blocks; uses BlockStateDelta maps. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BlockAppEvalDelta { + /// [gd] Global state delta for the application. + pub global_delta: Option, + /// [ld] Local state deltas keyed by integer account index. + pub local_deltas: Option>, + /// [itx] Inner transactions produced by this application execution. + pub inner_txns: Option>, + /// [sa] Shared accounts referenced by local deltas. + pub shared_accounts: Option>>, + /// [lg] Application log outputs as strings (msgpack strings). + pub logs: Option>, +} + +impl From for BlockAppEvalDelta { + fn from(rust_struct: RustBlockAppEvalDelta) -> Self { + Self { + global_delta: rust_struct + .global_delta + .map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + local_deltas: rust_struct.local_deltas.map(|v| { + v.into_iter() + .map(|(k, v)| (k, v.into_iter().map(|(k2, v2)| (k2, v2.into())).collect())) + .collect() + }), + inner_txns: rust_struct + .inner_txns + .map(|v| v.into_iter().map(|tx| tx.into()).collect()), + shared_accounts: rust_struct.shared_accounts, + logs: rust_struct.logs, + } + } +} + +impl TryFrom for RustBlockAppEvalDelta { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: BlockAppEvalDelta) -> Result { + Ok(Self { + global_delta: ffi_struct + .global_delta + .map(|v| v.into_iter().map(|(k, v)| (k, v.into())).collect()), + local_deltas: ffi_struct.local_deltas.map(|v| { + v.into_iter() + .map(|(k, v)| (k, v.into_iter().map(|(k2, v2)| (k2, v2.into())).collect())) + .collect() + }), + inner_txns: ffi_struct + .inner_txns + .map(|v| { + v.into_iter() + .map(|tx| tx.try_into()) + .collect::, _>>() + }) + .transpose()?, + shared_accounts: ffi_struct.shared_accounts, + logs: ffi_struct.logs, + }) + } +} diff --git a/crates/algod_client_ffi/src/models/block_eval_delta.rs b/crates/algod_client_ffi/src/models/block_eval_delta.rs new file mode 100644 index 000000000..b3e0f4e61 --- /dev/null +++ b/crates/algod_client_ffi/src/models/block_eval_delta.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::BlockEvalDelta as RustBlockEvalDelta; + +/// BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BlockEvalDelta { + /// [at] delta action. + pub action: u32, + /// [bs] bytes value. + pub bytes: Option, + /// [ui] uint value. + pub uint: Option, +} + +impl From for BlockEvalDelta { + fn from(rust_struct: RustBlockEvalDelta) -> Self { + Self { + action: rust_struct.action, + bytes: rust_struct.bytes, + uint: rust_struct.uint, + } + } +} + +impl From for RustBlockEvalDelta { + fn from(ffi_struct: BlockEvalDelta) -> Self { + Self { + action: ffi_struct.action, + bytes: ffi_struct.bytes, + uint: ffi_struct.uint, + } + } +} diff --git a/crates/algod_client_ffi/src/models/block_state_delta.rs b/crates/algod_client_ffi/src/models/block_state_delta.rs new file mode 100644 index 000000000..506bd9626 --- /dev/null +++ b/crates/algod_client_ffi/src/models/block_state_delta.rs @@ -0,0 +1,17 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use std::collections::HashMap; + +use crate::models::BlockEvalDelta; + +/// BlockStateDelta is a map keyed by state key to BlockEvalDelta. +pub type BlockStateDelta = HashMap; diff --git a/crates/algod_client_ffi/src/models/block_state_proof_tracking.rs b/crates/algod_client_ffi/src/models/block_state_proof_tracking.rs new file mode 100644 index 000000000..826278541 --- /dev/null +++ b/crates/algod_client_ffi/src/models/block_state_proof_tracking.rs @@ -0,0 +1,17 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use std::collections::HashMap; + +use crate::models::BlockStateProofTrackingData; + +/// Tracks state proof metadata by state proof type. +pub type BlockStateProofTracking = HashMap; diff --git a/crates/algod_client_ffi/src/models/block_state_proof_tracking_data.rs b/crates/algod_client_ffi/src/models/block_state_proof_tracking_data.rs new file mode 100644 index 000000000..d2ccdd4ed --- /dev/null +++ b/crates/algod_client_ffi/src/models/block_state_proof_tracking_data.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::BlockStateProofTrackingData as RustBlockStateProofTrackingData; + +/// Tracking metadata for a specific StateProofType. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BlockStateProofTrackingData { + /// [v] Vector commitment root of state proof voters (may be absent when not applicable). + pub state_proof_voters_commitment: Option>, + /// [t] Online total weight during state proof round. + pub state_proof_online_total_weight: Option, + /// [n] Next round for which state proofs are accepted. + pub state_proof_next_round: Option, +} + +impl From for BlockStateProofTrackingData { + fn from(rust_struct: RustBlockStateProofTrackingData) -> Self { + Self { + state_proof_voters_commitment: rust_struct.state_proof_voters_commitment, + state_proof_online_total_weight: rust_struct.state_proof_online_total_weight, + state_proof_next_round: rust_struct.state_proof_next_round, + } + } +} + +impl From for RustBlockStateProofTrackingData { + fn from(ffi_struct: BlockStateProofTrackingData) -> Self { + Self { + state_proof_voters_commitment: ffi_struct.state_proof_voters_commitment, + state_proof_online_total_weight: ffi_struct.state_proof_online_total_weight, + state_proof_next_round: ffi_struct.state_proof_next_round, + } + } +} diff --git a/crates/algod_client_ffi/src/models/box_descriptor.rs b/crates/algod_client_ffi/src/models/box_descriptor.rs new file mode 100644 index 000000000..3d9258f2f --- /dev/null +++ b/crates/algod_client_ffi/src/models/box_descriptor.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::BoxDescriptor as RustBoxDescriptor; + +/// Box descriptor describes a Box. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BoxDescriptor { + /// Base64 encoded box name + pub name: Vec, +} + +impl From for BoxDescriptor { + fn from(rust_struct: RustBoxDescriptor) -> Self { + Self { + name: rust_struct.name, + } + } +} + +impl From for RustBoxDescriptor { + fn from(ffi_struct: BoxDescriptor) -> Self { + Self { + name: ffi_struct.name, + } + } +} diff --git a/crates/algod_client_ffi/src/models/box_model.rs b/crates/algod_client_ffi/src/models/box_model.rs new file mode 100644 index 000000000..96be90977 --- /dev/null +++ b/crates/algod_client_ffi/src/models/box_model.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Box as RustBox; + +/// Box name and its content. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Box { + /// The round for which this information is relevant + pub round: u64, + /// The box name, base64 encoded + pub name: Vec, + /// The box value, base64 encoded. + pub value: Vec, +} + +impl From for Box { + fn from(rust_struct: RustBox) -> Self { + Self { + round: rust_struct.round, + name: rust_struct.name, + value: rust_struct.value, + } + } +} + +impl From for RustBox { + fn from(ffi_struct: Box) -> Self { + Self { + round: ffi_struct.round, + name: ffi_struct.name, + value: ffi_struct.value, + } + } +} diff --git a/crates/algod_client_ffi/src/models/box_reference.rs b/crates/algod_client_ffi/src/models/box_reference.rs new file mode 100644 index 000000000..85b91062d --- /dev/null +++ b/crates/algod_client_ffi/src/models/box_reference.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::BoxReference as RustBoxReference; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// References a box of an application. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BoxReference { + /// Application ID which this box belongs to + pub app: u64, + /// Base64 encoded box name + pub name: Vec, +} + +impl From for BoxReference { + fn from(rust_struct: RustBoxReference) -> Self { + Self { + app: rust_struct.app, + name: rust_struct.name, + } + } +} + +impl From for RustBoxReference { + fn from(ffi_struct: BoxReference) -> Self { + Self { + app: ffi_struct.app, + name: ffi_struct.name, + } + } +} diff --git a/crates/algod_client_ffi/src/models/build_version.rs b/crates/algod_client_ffi/src/models/build_version.rs new file mode 100644 index 000000000..6ccb7a3d9 --- /dev/null +++ b/crates/algod_client_ffi/src/models/build_version.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::BuildVersion as RustBuildVersion; + +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct BuildVersion { + pub branch: String, + pub build_number: u64, + pub channel: String, + pub commit_hash: String, + pub major: u64, + pub minor: u64, +} + +impl From for BuildVersion { + fn from(rust_struct: RustBuildVersion) -> Self { + Self { + branch: rust_struct.branch, + build_number: rust_struct.build_number, + channel: rust_struct.channel, + commit_hash: rust_struct.commit_hash, + major: rust_struct.major, + minor: rust_struct.minor, + } + } +} + +impl From for RustBuildVersion { + fn from(ffi_struct: BuildVersion) -> Self { + Self { + branch: ffi_struct.branch, + build_number: ffi_struct.build_number, + channel: ffi_struct.channel, + commit_hash: ffi_struct.commit_hash, + major: ffi_struct.major, + minor: ffi_struct.minor, + } + } +} diff --git a/crates/algod_client_ffi/src/models/debug_settings_prof.rs b/crates/algod_client_ffi/src/models/debug_settings_prof.rs new file mode 100644 index 000000000..1c11f45e6 --- /dev/null +++ b/crates/algod_client_ffi/src/models/debug_settings_prof.rs @@ -0,0 +1,39 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::DebugSettingsProf as RustDebugSettingsProf; + +/// algod mutex and blocking profiling state. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct DebugSettingsProf { + /// The rate of blocking events. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To turn off profiling entirely, pass rate 0. + pub block_rate: Option, + /// The rate of mutex events. On average 1/rate events are reported. To turn off profiling entirely, pass rate 0 + pub mutex_rate: Option, +} + +impl From for DebugSettingsProf { + fn from(rust_struct: RustDebugSettingsProf) -> Self { + Self { + block_rate: rust_struct.block_rate, + mutex_rate: rust_struct.mutex_rate, + } + } +} + +impl From for RustDebugSettingsProf { + fn from(ffi_struct: DebugSettingsProf) -> Self { + Self { + block_rate: ffi_struct.block_rate, + mutex_rate: ffi_struct.mutex_rate, + } + } +} diff --git a/crates/algod_client_ffi/src/models/dryrun_request.rs b/crates/algod_client_ffi/src/models/dryrun_request.rs new file mode 100644 index 000000000..a0dcdb3c3 --- /dev/null +++ b/crates/algod_client_ffi/src/models/dryrun_request.rs @@ -0,0 +1,73 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::DryrunRequest as RustDryrunRequest; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::Account; +use crate::models::Application; +use crate::models::DryrunSource; + +/// Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct DryrunRequest { + pub txns: Vec, + pub accounts: Vec, + pub apps: Vec, + /// ProtocolVersion specifies a specific version string to operate under, otherwise whatever the current protocol of the network this algod is running in. + pub protocol_version: String, + /// Round is available to some TEAL scripts. Defaults to the current round on the network this algod is attached to. + pub round: u64, + /// LatestTimestamp is available to some TEAL scripts. Defaults to the latest confirmed timestamp this algod is attached to. + pub latest_timestamp: u64, + pub sources: Vec, +} + +impl From for DryrunRequest { + fn from(rust_struct: RustDryrunRequest) -> Self { + Self { + txns: rust_struct.txns.into_iter().map(|v| v.into()).collect(), + accounts: rust_struct.accounts.into_iter().map(|v| v.into()).collect(), + apps: rust_struct.apps.into_iter().map(|v| v.into()).collect(), + protocol_version: rust_struct.protocol_version, + round: rust_struct.round, + latest_timestamp: rust_struct.latest_timestamp, + sources: rust_struct.sources.into_iter().map(|v| v.into()).collect(), + } + } +} + +impl TryFrom for RustDryrunRequest { + type Error = crate::apis::Error; + + fn try_from(ffi_struct: DryrunRequest) -> Result { + Ok(Self { + txns: ffi_struct + .txns + .into_iter() + .map(|v| { + v.try_into() + .map_err(|e: algokit_transact_ffi::AlgoKitTransactError| { + crate::apis::Error::Serde { + message: e.to_string(), + } + }) + }) + .collect::>()?, + accounts: ffi_struct.accounts.into_iter().map(|v| v.into()).collect(), + apps: ffi_struct.apps.into_iter().map(|v| v.into()).collect(), + protocol_version: ffi_struct.protocol_version, + round: ffi_struct.round, + latest_timestamp: ffi_struct.latest_timestamp, + sources: ffi_struct.sources.into_iter().map(|v| v.into()).collect(), + }) + } +} diff --git a/crates/algod_client_ffi/src/models/dryrun_source.rs b/crates/algod_client_ffi/src/models/dryrun_source.rs new file mode 100644 index 000000000..24ba3a8e9 --- /dev/null +++ b/crates/algod_client_ffi/src/models/dryrun_source.rs @@ -0,0 +1,45 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::DryrunSource as RustDryrunSource; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into transactions or application state. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct DryrunSource { + /// FieldName is what kind of sources this is. If lsig then it goes into the transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the Approval Program or Clear State Program of application[this.AppIndex]. + pub field_name: String, + pub source: String, + pub txn_index: u64, + pub app_index: u64, +} + +impl From for DryrunSource { + fn from(rust_struct: RustDryrunSource) -> Self { + Self { + field_name: rust_struct.field_name, + source: rust_struct.source, + txn_index: rust_struct.txn_index, + app_index: rust_struct.app_index, + } + } +} + +impl From for RustDryrunSource { + fn from(ffi_struct: DryrunSource) -> Self { + Self { + field_name: ffi_struct.field_name, + source: ffi_struct.source, + txn_index: ffi_struct.txn_index, + app_index: ffi_struct.app_index, + } + } +} diff --git a/crates/algod_client_ffi/src/models/dryrun_state.rs b/crates/algod_client_ffi/src/models/dryrun_state.rs new file mode 100644 index 000000000..b6d880f50 --- /dev/null +++ b/crates/algod_client_ffi/src/models/dryrun_state.rs @@ -0,0 +1,55 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::DryrunState as RustDryrunState; + +use crate::models::TealValue; + +/// Stores the TEAL eval step data +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct DryrunState { + /// Line number + pub line: u64, + /// Program counter + pub pc: u64, + pub stack: Vec, + pub scratch: Option>, + /// Evaluation error if any + pub error: Option, +} + +impl From for DryrunState { + fn from(rust_struct: RustDryrunState) -> Self { + Self { + line: rust_struct.line, + pc: rust_struct.pc, + stack: rust_struct.stack.into_iter().map(|v| v.into()).collect(), + scratch: rust_struct + .scratch + .map(|v| v.into_iter().map(|v| v.into()).collect()), + error: rust_struct.error, + } + } +} + +impl From for RustDryrunState { + fn from(ffi_struct: DryrunState) -> Self { + Self { + line: ffi_struct.line, + pc: ffi_struct.pc, + stack: ffi_struct.stack.into_iter().map(|v| v.into()).collect(), + scratch: ffi_struct + .scratch + .map(|v| v.into_iter().map(|v| v.into()).collect()), + error: ffi_struct.error, + } + } +} diff --git a/crates/algod_client_ffi/src/models/dryrun_txn_result.rs b/crates/algod_client_ffi/src/models/dryrun_txn_result.rs new file mode 100644 index 000000000..34379343a --- /dev/null +++ b/crates/algod_client_ffi/src/models/dryrun_txn_result.rs @@ -0,0 +1,66 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::DryrunTxnResult as RustDryrunTxnResult; + +use crate::models::AccountStateDelta; +use crate::models::DryrunState; +use crate::models::StateDelta; + +/// DryrunTxnResult contains any LogicSig or ApplicationCall program debug information and state updates from a dryrun. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct DryrunTxnResult { + /// Disassembled program line by line. + pub disassembly: Vec, + /// Disassembled lsig program line by line. + pub logic_sig_disassembly: Option>, + pub logic_sig_trace: Option>, + pub logic_sig_messages: Option>, + pub app_call_trace: Option>, + pub app_call_messages: Option>, + pub global_delta: Option, + pub local_deltas: Option>, + pub logs: Option>>, + /// Budget added during execution of app call transaction. + pub budget_added: Option, + /// Budget consumed during execution of app call transaction. + pub budget_consumed: Option, +} + +impl From for DryrunTxnResult { + fn from(rust_struct: RustDryrunTxnResult) -> Self { + Self { + disassembly: rust_struct.disassembly.into_iter().collect(), + logic_sig_disassembly: rust_struct + .logic_sig_disassembly + .map(|v| v.into_iter().collect()), + logic_sig_trace: rust_struct + .logic_sig_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + logic_sig_messages: rust_struct + .logic_sig_messages + .map(|v| v.into_iter().collect()), + app_call_trace: rust_struct + .app_call_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + app_call_messages: rust_struct + .app_call_messages + .map(|v| v.into_iter().collect()), + global_delta: rust_struct.global_delta.map(|v| v.into()), + local_deltas: rust_struct + .local_deltas + .map(|v| v.into_iter().map(|v| v.into()).collect()), + logs: rust_struct.logs.map(|v| v.into_iter().collect()), + budget_added: rust_struct.budget_added, + budget_consumed: rust_struct.budget_consumed, + } + } +} diff --git a/crates/algod_client_ffi/src/models/error_response.rs b/crates/algod_client_ffi/src/models/error_response.rs new file mode 100644 index 000000000..35b21cb96 --- /dev/null +++ b/crates/algod_client_ffi/src/models/error_response.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ErrorResponse as RustErrorResponse; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::UnknownJsonValue; + +/// An error response with optional data field. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ErrorResponse { + pub data: Option, + pub message: String, +} + +impl From for ErrorResponse { + fn from(rust_struct: RustErrorResponse) -> Self { + Self { + data: rust_struct.data.map(|v| v.into()), + message: rust_struct.message, + } + } +} + +impl From for RustErrorResponse { + fn from(ffi_struct: ErrorResponse) -> Self { + Self { + data: ffi_struct.data.map(|v| v.into()), + message: ffi_struct.message, + } + } +} diff --git a/crates/algod_client_ffi/src/models/eval_delta.rs b/crates/algod_client_ffi/src/models/eval_delta.rs new file mode 100644 index 000000000..e32ae3d71 --- /dev/null +++ b/crates/algod_client_ffi/src/models/eval_delta.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::EvalDelta as RustEvalDelta; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// Represents a TEAL value delta. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct EvalDelta { + /// [at] delta action. + pub action: u32, + /// [bs] bytes value. + pub bytes: Option, + /// [ui] uint value. + pub uint: Option, +} + +impl From for EvalDelta { + fn from(rust_struct: RustEvalDelta) -> Self { + Self { + action: rust_struct.action, + bytes: rust_struct.bytes, + uint: rust_struct.uint, + } + } +} + +impl From for RustEvalDelta { + fn from(ffi_struct: EvalDelta) -> Self { + Self { + action: ffi_struct.action, + bytes: ffi_struct.bytes, + uint: ffi_struct.uint, + } + } +} diff --git a/crates/algod_client_ffi/src/models/eval_delta_key_value.rs b/crates/algod_client_ffi/src/models/eval_delta_key_value.rs new file mode 100644 index 000000000..17bc106a2 --- /dev/null +++ b/crates/algod_client_ffi/src/models/eval_delta_key_value.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::EvalDeltaKeyValue as RustEvalDeltaKeyValue; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::EvalDelta; + +/// Key-value pairs for StateDelta. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct EvalDeltaKeyValue { + pub key: String, + pub value: EvalDelta, +} + +impl From for EvalDeltaKeyValue { + fn from(rust_struct: RustEvalDeltaKeyValue) -> Self { + Self { + key: rust_struct.key, + value: rust_struct.value.into(), + } + } +} + +impl From for RustEvalDeltaKeyValue { + fn from(ffi_struct: EvalDeltaKeyValue) -> Self { + Self { + key: ffi_struct.key, + value: ffi_struct.value.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/genesis.rs b/crates/algod_client_ffi/src/models/genesis.rs new file mode 100644 index 000000000..576d295e3 --- /dev/null +++ b/crates/algod_client_ffi/src/models/genesis.rs @@ -0,0 +1,59 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Genesis as RustGenesis; + +use crate::models::GenesisAllocation; + +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Genesis { + pub alloc: Vec, + pub comment: Option, + pub devmode: Option, + pub fees: String, + pub id: String, + pub network: String, + pub proto: String, + pub rwd: String, + pub timestamp: u64, +} + +impl From for Genesis { + fn from(rust_struct: RustGenesis) -> Self { + Self { + alloc: rust_struct.alloc.into_iter().map(|v| v.into()).collect(), + comment: rust_struct.comment, + devmode: rust_struct.devmode, + fees: rust_struct.fees, + id: rust_struct.id, + network: rust_struct.network, + proto: rust_struct.proto, + rwd: rust_struct.rwd, + timestamp: rust_struct.timestamp, + } + } +} + +impl From for RustGenesis { + fn from(ffi_struct: Genesis) -> Self { + Self { + alloc: ffi_struct.alloc.into_iter().map(|v| v.into()).collect(), + comment: ffi_struct.comment, + devmode: ffi_struct.devmode, + fees: ffi_struct.fees, + id: ffi_struct.id, + network: ffi_struct.network, + proto: ffi_struct.proto, + rwd: ffi_struct.rwd, + timestamp: ffi_struct.timestamp, + } + } +} diff --git a/crates/algod_client_ffi/src/models/genesis_allocation.rs b/crates/algod_client_ffi/src/models/genesis_allocation.rs new file mode 100644 index 000000000..c7f4eaecc --- /dev/null +++ b/crates/algod_client_ffi/src/models/genesis_allocation.rs @@ -0,0 +1,41 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GenesisAllocation as RustGenesisAllocation; + +use crate::models::UnknownJsonValue; + +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GenesisAllocation { + pub addr: String, + pub comment: String, + pub state: UnknownJsonValue, +} + +impl From for GenesisAllocation { + fn from(rust_struct: RustGenesisAllocation) -> Self { + Self { + addr: rust_struct.addr, + comment: rust_struct.comment, + state: rust_struct.state.into(), + } + } +} + +impl From for RustGenesisAllocation { + fn from(ffi_struct: GenesisAllocation) -> Self { + Self { + addr: ffi_struct.addr, + comment: ffi_struct.comment, + state: ffi_struct.state.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_application_boxes.rs b/crates/algod_client_ffi/src/models/get_application_boxes.rs new file mode 100644 index 000000000..3d9541e1c --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_application_boxes.rs @@ -0,0 +1,36 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetApplicationBoxes as RustGetApplicationBoxes; + +use crate::models::BoxDescriptor; + +/// Box names of an application +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetApplicationBoxes { + pub boxes: Vec, +} + +impl From for GetApplicationBoxes { + fn from(rust_struct: RustGetApplicationBoxes) -> Self { + Self { + boxes: rust_struct.boxes.into_iter().map(|v| v.into()).collect(), + } + } +} + +impl From for RustGetApplicationBoxes { + fn from(ffi_struct: GetApplicationBoxes) -> Self { + Self { + boxes: ffi_struct.boxes.into_iter().map(|v| v.into()).collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_block.rs b/crates/algod_client_ffi/src/models/get_block.rs new file mode 100644 index 000000000..1d35150b8 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_block.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetBlock as RustGetBlock; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::Block; + +/// Encoded block object. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetBlock { + /// Block data including header and transactions. + pub block: Block, + /// Block certificate (msgpack only). + pub cert: Option>, +} + +impl From for GetBlock { + fn from(rust_struct: RustGetBlock) -> Self { + Self { + block: rust_struct.block.into(), + cert: rust_struct.cert, + } + } +} + +impl TryFrom for RustGetBlock { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: GetBlock) -> Result { + Ok(Self { + block: ffi_struct.block.try_into()?, + cert: ffi_struct.cert, + }) + } +} diff --git a/crates/algod_client_ffi/src/models/get_block_hash.rs b/crates/algod_client_ffi/src/models/get_block_hash.rs new file mode 100644 index 000000000..418472610 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_block_hash.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetBlockHash as RustGetBlockHash; + +/// Hash of a block header. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetBlockHash { + /// Block header hash. + pub block_hash: String, +} + +impl From for GetBlockHash { + fn from(rust_struct: RustGetBlockHash) -> Self { + Self { + block_hash: rust_struct.block_hash, + } + } +} + +impl From for RustGetBlockHash { + fn from(ffi_struct: GetBlockHash) -> Self { + Self { + block_hash: ffi_struct.block_hash, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_block_logs.rs b/crates/algod_client_ffi/src/models/get_block_logs.rs new file mode 100644 index 000000000..b8c083e5e --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_block_logs.rs @@ -0,0 +1,36 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetBlockLogs as RustGetBlockLogs; + +use crate::models::AppCallLogs; + +/// All logs emitted in the given round. Each app call, whether top-level or inner, that contains logs results in a separate AppCallLogs object. Therefore there may be multiple AppCallLogs with the same application ID and outer transaction ID in the event of multiple inner app calls to the same app. App calls with no logs are not included in the response. AppCallLogs are returned in the same order that their corresponding app call appeared in the block (pre-order traversal of inner app calls) +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetBlockLogs { + pub logs: Vec, +} + +impl From for GetBlockLogs { + fn from(rust_struct: RustGetBlockLogs) -> Self { + Self { + logs: rust_struct.logs.into_iter().map(|v| v.into()).collect(), + } + } +} + +impl From for RustGetBlockLogs { + fn from(ffi_struct: GetBlockLogs) -> Self { + Self { + logs: ffi_struct.logs.into_iter().map(|v| v.into()).collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_block_time_stamp_offset.rs b/crates/algod_client_ffi/src/models/get_block_time_stamp_offset.rs new file mode 100644 index 000000000..6d625d76d --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_block_time_stamp_offset.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetBlockTimeStampOffset as RustGetBlockTimeStampOffset; + +/// Response containing the timestamp offset in seconds +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetBlockTimeStampOffset { + /// Timestamp offset in seconds. + pub offset: u64, +} + +impl From for GetBlockTimeStampOffset { + fn from(rust_struct: RustGetBlockTimeStampOffset) -> Self { + Self { + offset: rust_struct.offset, + } + } +} + +impl From for RustGetBlockTimeStampOffset { + fn from(ffi_struct: GetBlockTimeStampOffset) -> Self { + Self { + offset: ffi_struct.offset, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_block_txids.rs b/crates/algod_client_ffi/src/models/get_block_txids.rs new file mode 100644 index 000000000..462db2d9d --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_block_txids.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetBlockTxids as RustGetBlockTxids; + +/// Top level transaction IDs in a block. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetBlockTxids { + /// Block transaction IDs. + pub block_txids: Vec, +} + +impl From for GetBlockTxids { + fn from(rust_struct: RustGetBlockTxids) -> Self { + Self { + block_txids: rust_struct.block_txids.into_iter().collect(), + } + } +} + +impl From for RustGetBlockTxids { + fn from(ffi_struct: GetBlockTxids) -> Self { + Self { + block_txids: ffi_struct.block_txids.into_iter().collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_pending_transactions.rs b/crates/algod_client_ffi/src/models/get_pending_transactions.rs new file mode 100644 index 000000000..0ac5790a3 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_pending_transactions.rs @@ -0,0 +1,37 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetPendingTransactions as RustGetPendingTransactions; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::UnknownJsonValue; + +/// PendingTransactions is an array of signed transactions exactly as they were submitted. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetPendingTransactions { + /// An array of signed transaction objects. + pub top_transactions: Vec, + /// Total number of transactions in the pool. + pub total_transactions: u64, +} + +impl From for GetPendingTransactions { + fn from(rust_struct: RustGetPendingTransactions) -> Self { + Self { + top_transactions: rust_struct + .top_transactions + .into_iter() + .map(|v| v.into()) + .collect(), + total_transactions: rust_struct.total_transactions, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_pending_transactions_by_address.rs b/crates/algod_client_ffi/src/models/get_pending_transactions_by_address.rs new file mode 100644 index 000000000..65eb6ae46 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_pending_transactions_by_address.rs @@ -0,0 +1,37 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetPendingTransactionsByAddress as RustGetPendingTransactionsByAddress; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::UnknownJsonValue; + +/// PendingTransactions is an array of signed transactions exactly as they were submitted. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetPendingTransactionsByAddress { + /// An array of signed transaction objects. + pub top_transactions: Vec, + /// Total number of transactions in the pool. + pub total_transactions: u64, +} + +impl From for GetPendingTransactionsByAddress { + fn from(rust_struct: RustGetPendingTransactionsByAddress) -> Self { + Self { + top_transactions: rust_struct + .top_transactions + .into_iter() + .map(|v| v.into()) + .collect(), + total_transactions: rust_struct.total_transactions, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_status.rs b/crates/algod_client_ffi/src/models/get_status.rs new file mode 100644 index 000000000..6e69a9d76 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_status.rs @@ -0,0 +1,135 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetStatus as RustGetStatus; + +/// NodeStatus contains the information about a node status +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetStatus { + /// CatchupTime in nanoseconds + pub catchup_time: u64, + /// LastRound indicates the last round seen + pub last_round: u64, + /// LastVersion indicates the last consensus version supported + pub last_version: String, + /// NextVersion of consensus protocol to use + pub next_version: String, + /// NextVersionRound is the round at which the next consensus version will apply + pub next_version_round: u64, + /// NextVersionSupported indicates whether the next consensus version is supported by this node + pub next_version_supported: bool, + /// StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress + pub stopped_at_unsupported_round: bool, + /// TimeSinceLastRound in nanoseconds + pub time_since_last_round: u64, + /// The last catchpoint seen by the node + pub last_catchpoint: Option, + /// The current catchpoint that is being caught up to + pub catchpoint: Option, + /// The total number of accounts included in the current catchpoint + pub catchpoint_total_accounts: Option, + /// The number of accounts from the current catchpoint that have been processed so far as part of the catchup + pub catchpoint_processed_accounts: Option, + /// The number of accounts from the current catchpoint that have been verified so far as part of the catchup + pub catchpoint_verified_accounts: Option, + /// The total number of key-values (KVs) included in the current catchpoint + pub catchpoint_total_kvs: Option, + /// The number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup + pub catchpoint_processed_kvs: Option, + /// The number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup + pub catchpoint_verified_kvs: Option, + /// The total number of blocks that are required to complete the current catchpoint catchup + pub catchpoint_total_blocks: Option, + /// The number of blocks that have already been obtained by the node as part of the catchup + pub catchpoint_acquired_blocks: Option, + /// Upgrade delay + pub upgrade_delay: Option, + /// This node's upgrade vote + pub upgrade_node_vote: Option, + /// Yes votes required for consensus upgrade + pub upgrade_votes_required: Option, + /// Total votes cast for consensus upgrade + pub upgrade_votes: Option, + /// Yes votes cast for consensus upgrade + pub upgrade_yes_votes: Option, + /// No votes cast for consensus upgrade + pub upgrade_no_votes: Option, + /// Next protocol round + pub upgrade_next_protocol_vote_before: Option, + /// Total voting rounds for current upgrade + pub upgrade_vote_rounds: Option, +} + +impl From for GetStatus { + fn from(rust_struct: RustGetStatus) -> Self { + Self { + catchup_time: rust_struct.catchup_time, + last_round: rust_struct.last_round, + last_version: rust_struct.last_version, + next_version: rust_struct.next_version, + next_version_round: rust_struct.next_version_round, + next_version_supported: rust_struct.next_version_supported, + stopped_at_unsupported_round: rust_struct.stopped_at_unsupported_round, + time_since_last_round: rust_struct.time_since_last_round, + last_catchpoint: rust_struct.last_catchpoint, + catchpoint: rust_struct.catchpoint, + catchpoint_total_accounts: rust_struct.catchpoint_total_accounts, + catchpoint_processed_accounts: rust_struct.catchpoint_processed_accounts, + catchpoint_verified_accounts: rust_struct.catchpoint_verified_accounts, + catchpoint_total_kvs: rust_struct.catchpoint_total_kvs, + catchpoint_processed_kvs: rust_struct.catchpoint_processed_kvs, + catchpoint_verified_kvs: rust_struct.catchpoint_verified_kvs, + catchpoint_total_blocks: rust_struct.catchpoint_total_blocks, + catchpoint_acquired_blocks: rust_struct.catchpoint_acquired_blocks, + upgrade_delay: rust_struct.upgrade_delay, + upgrade_node_vote: rust_struct.upgrade_node_vote, + upgrade_votes_required: rust_struct.upgrade_votes_required, + upgrade_votes: rust_struct.upgrade_votes, + upgrade_yes_votes: rust_struct.upgrade_yes_votes, + upgrade_no_votes: rust_struct.upgrade_no_votes, + upgrade_next_protocol_vote_before: rust_struct.upgrade_next_protocol_vote_before, + upgrade_vote_rounds: rust_struct.upgrade_vote_rounds, + } + } +} + +impl From for RustGetStatus { + fn from(ffi_struct: GetStatus) -> Self { + Self { + catchup_time: ffi_struct.catchup_time, + last_round: ffi_struct.last_round, + last_version: ffi_struct.last_version, + next_version: ffi_struct.next_version, + next_version_round: ffi_struct.next_version_round, + next_version_supported: ffi_struct.next_version_supported, + stopped_at_unsupported_round: ffi_struct.stopped_at_unsupported_round, + time_since_last_round: ffi_struct.time_since_last_round, + last_catchpoint: ffi_struct.last_catchpoint, + catchpoint: ffi_struct.catchpoint, + catchpoint_total_accounts: ffi_struct.catchpoint_total_accounts, + catchpoint_processed_accounts: ffi_struct.catchpoint_processed_accounts, + catchpoint_verified_accounts: ffi_struct.catchpoint_verified_accounts, + catchpoint_total_kvs: ffi_struct.catchpoint_total_kvs, + catchpoint_processed_kvs: ffi_struct.catchpoint_processed_kvs, + catchpoint_verified_kvs: ffi_struct.catchpoint_verified_kvs, + catchpoint_total_blocks: ffi_struct.catchpoint_total_blocks, + catchpoint_acquired_blocks: ffi_struct.catchpoint_acquired_blocks, + upgrade_delay: ffi_struct.upgrade_delay, + upgrade_node_vote: ffi_struct.upgrade_node_vote, + upgrade_votes_required: ffi_struct.upgrade_votes_required, + upgrade_votes: ffi_struct.upgrade_votes, + upgrade_yes_votes: ffi_struct.upgrade_yes_votes, + upgrade_no_votes: ffi_struct.upgrade_no_votes, + upgrade_next_protocol_vote_before: ffi_struct.upgrade_next_protocol_vote_before, + upgrade_vote_rounds: ffi_struct.upgrade_vote_rounds, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_supply.rs b/crates/algod_client_ffi/src/models/get_supply.rs new file mode 100644 index 000000000..1d3b36a33 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_supply.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetSupply as RustGetSupply; + +/// Supply represents the current supply of MicroAlgos in the system +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetSupply { + /// Round + pub current_round: u64, + /// OnlineMoney + pub online_money: u64, + /// TotalMoney + pub total_money: u64, +} + +impl From for GetSupply { + fn from(rust_struct: RustGetSupply) -> Self { + Self { + current_round: rust_struct.current_round, + online_money: rust_struct.online_money, + total_money: rust_struct.total_money, + } + } +} + +impl From for RustGetSupply { + fn from(ffi_struct: GetSupply) -> Self { + Self { + current_round: ffi_struct.current_round, + online_money: ffi_struct.online_money, + total_money: ffi_struct.total_money, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_sync_round.rs b/crates/algod_client_ffi/src/models/get_sync_round.rs new file mode 100644 index 000000000..30b9b44a6 --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_sync_round.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetSyncRound as RustGetSyncRound; + +/// Response containing the ledger's minimum sync round +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetSyncRound { + /// The minimum sync round for the ledger. + pub round: u64, +} + +impl From for GetSyncRound { + fn from(rust_struct: RustGetSyncRound) -> Self { + Self { + round: rust_struct.round, + } + } +} + +impl From for RustGetSyncRound { + fn from(ffi_struct: GetSyncRound) -> Self { + Self { + round: ffi_struct.round, + } + } +} diff --git a/crates/algod_client_ffi/src/models/get_transaction_group_ledger_state_deltas_for_round.rs b/crates/algod_client_ffi/src/models/get_transaction_group_ledger_state_deltas_for_round.rs new file mode 100644 index 000000000..001eb494a --- /dev/null +++ b/crates/algod_client_ffi/src/models/get_transaction_group_ledger_state_deltas_for_round.rs @@ -0,0 +1,41 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::GetTransactionGroupLedgerStateDeltasForRound as RustGetTransactionGroupLedgerStateDeltasForRound; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::LedgerStateDeltaForTransactionGroup; + +/// Response containing all ledger state deltas for transaction groups, with their associated Ids, in a single round. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct GetTransactionGroupLedgerStateDeltasForRound { + pub deltas: Vec, +} + +impl From + for GetTransactionGroupLedgerStateDeltasForRound +{ + fn from(rust_struct: RustGetTransactionGroupLedgerStateDeltasForRound) -> Self { + Self { + deltas: rust_struct.deltas.into_iter().map(|v| v.into()).collect(), + } + } +} + +impl From + for RustGetTransactionGroupLedgerStateDeltasForRound +{ + fn from(ffi_struct: GetTransactionGroupLedgerStateDeltasForRound) -> Self { + Self { + deltas: ffi_struct.deltas.into_iter().map(|v| v.into()).collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/ledger_state_delta.rs b/crates/algod_client_ffi/src/models/ledger_state_delta.rs new file mode 100644 index 000000000..5e11a3d38 --- /dev/null +++ b/crates/algod_client_ffi/src/models/ledger_state_delta.rs @@ -0,0 +1,29 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::LedgerStateDelta as RustLedgerStateDelta; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// Ledger StateDelta object +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct LedgerStateDelta {} + +impl From for LedgerStateDelta { + fn from(_rust_struct: RustLedgerStateDelta) -> Self { + Self {} + } +} + +impl From for RustLedgerStateDelta { + fn from(_ffi_struct: LedgerStateDelta) -> Self { + Self {} + } +} diff --git a/crates/algod_client_ffi/src/models/ledger_state_delta_for_transaction_group.rs b/crates/algod_client_ffi/src/models/ledger_state_delta_for_transaction_group.rs new file mode 100644 index 000000000..92d9642f0 --- /dev/null +++ b/crates/algod_client_ffi/src/models/ledger_state_delta_for_transaction_group.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::LedgerStateDeltaForTransactionGroup as RustLedgerStateDeltaForTransactionGroup; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::LedgerStateDelta; + +/// Contains a ledger delta for a single transaction group +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct LedgerStateDeltaForTransactionGroup { + pub delta: LedgerStateDelta, + pub ids: Vec, +} + +impl From for LedgerStateDeltaForTransactionGroup { + fn from(rust_struct: RustLedgerStateDeltaForTransactionGroup) -> Self { + Self { + delta: rust_struct.delta.into(), + ids: rust_struct.ids.into_iter().collect(), + } + } +} + +impl From for RustLedgerStateDeltaForTransactionGroup { + fn from(ffi_struct: LedgerStateDeltaForTransactionGroup) -> Self { + Self { + delta: ffi_struct.delta.into(), + ids: ffi_struct.ids.into_iter().collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/light_block_header_proof.rs b/crates/algod_client_ffi/src/models/light_block_header_proof.rs new file mode 100644 index 000000000..0083bc696 --- /dev/null +++ b/crates/algod_client_ffi/src/models/light_block_header_proof.rs @@ -0,0 +1,43 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::LightBlockHeaderProof as RustLightBlockHeaderProof; + +/// Proof of membership and position of a light block header. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct LightBlockHeaderProof { + /// The index of the light block header in the vector commitment tree + pub index: u64, + /// Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root. + pub treedepth: u64, + /// The encoded proof. + pub proof: Vec, +} + +impl From for LightBlockHeaderProof { + fn from(rust_struct: RustLightBlockHeaderProof) -> Self { + Self { + index: rust_struct.index, + treedepth: rust_struct.treedepth, + proof: rust_struct.proof, + } + } +} + +impl From for RustLightBlockHeaderProof { + fn from(ffi_struct: LightBlockHeaderProof) -> Self { + Self { + index: ffi_struct.index, + treedepth: ffi_struct.treedepth, + proof: ffi_struct.proof, + } + } +} diff --git a/crates/algod_client_ffi/src/models/mod.rs b/crates/algod_client_ffi/src/models/mod.rs new file mode 100644 index 000000000..645e7a0e4 --- /dev/null +++ b/crates/algod_client_ffi/src/models/mod.rs @@ -0,0 +1,212 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +#[derive(Clone, Default, Debug, PartialEq)] +pub struct UnknownJsonValue(serde_json::Value); + +uniffi::custom_type!(UnknownJsonValue, String, { + lower: |s| s.0.to_string(), + try_lift: |s| serde_json::from_str(&s).map_err(|e| uniffi::deps::anyhow::Error::msg(e.to_string())).map(UnknownJsonValue), +}); + +impl From for serde_json::Value { + fn from(ffi_struct: UnknownJsonValue) -> Self { + ffi_struct.0 + } +} + +impl From for UnknownJsonValue { + fn from(rust_struct: serde_json::Value) -> Self { + UnknownJsonValue(rust_struct) + } +} + +pub mod genesis_allocation; +pub use self::genesis_allocation::GenesisAllocation; +pub mod genesis; +pub use self::genesis::Genesis; +pub mod ledger_state_delta; +pub use self::ledger_state_delta::LedgerStateDelta; +pub mod ledger_state_delta_for_transaction_group; +pub use self::ledger_state_delta_for_transaction_group::LedgerStateDeltaForTransactionGroup; +pub mod account; +pub use self::account::Account; +pub mod account_asset_holding; +pub use self::account_asset_holding::AccountAssetHolding; +pub mod account_participation; +pub use self::account_participation::AccountParticipation; +pub mod asset; +pub use self::asset::Asset; +pub mod asset_holding; +pub use self::asset_holding::AssetHolding; +pub mod asset_params; +pub use self::asset_params::AssetParams; +pub mod asset_holding_reference; +pub use self::asset_holding_reference::AssetHoldingReference; +pub mod application_local_reference; +pub use self::application_local_reference::ApplicationLocalReference; +pub mod application_state_schema; +pub use self::application_state_schema::ApplicationStateSchema; +pub mod application_local_state; +pub use self::application_local_state::ApplicationLocalState; +pub mod participation_key; +pub use self::participation_key::ParticipationKey; +pub mod teal_key_value_store; +pub use self::teal_key_value_store::TealKeyValueStore; +pub mod teal_key_value; +pub use self::teal_key_value::TealKeyValue; +pub mod teal_value; +pub use self::teal_value::TealValue; +pub mod avm_value; +pub use self::avm_value::AvmValue; +pub mod avm_key_value; +pub use self::avm_key_value::AvmKeyValue; +pub mod state_delta; +pub use self::state_delta::StateDelta; +pub mod account_state_delta; +pub use self::account_state_delta::AccountStateDelta; +pub mod eval_delta_key_value; +pub use self::eval_delta_key_value::EvalDeltaKeyValue; +pub mod eval_delta; +pub use self::eval_delta::EvalDelta; +pub mod application; +pub use self::application::Application; +pub mod application_params; +pub use self::application_params::ApplicationParams; +pub mod dryrun_state; +pub use self::dryrun_state::DryrunState; +pub mod dryrun_txn_result; +pub use self::dryrun_txn_result::DryrunTxnResult; +pub mod error_response; +pub use self::error_response::ErrorResponse; +pub mod dryrun_request; +pub use self::dryrun_request::DryrunRequest; +pub mod dryrun_source; +pub use self::dryrun_source::DryrunSource; +pub mod simulate_request; +pub use self::simulate_request::SimulateRequest; +pub mod simulate_request_transaction_group; +pub use self::simulate_request_transaction_group::SimulateRequestTransactionGroup; +pub mod simulate_trace_config; +pub use self::simulate_trace_config::SimulateTraceConfig; +pub mod box_model; +pub use self::box_model::Box; +pub mod box_descriptor; +pub use self::box_descriptor::BoxDescriptor; +pub mod box_reference; +pub use self::box_reference::BoxReference; +pub mod version; +pub use self::version::Version; +pub mod debug_settings_prof; +pub use self::debug_settings_prof::DebugSettingsProf; +pub mod build_version; +pub use self::build_version::BuildVersion; +pub mod pending_transaction_response; +pub use self::pending_transaction_response::PendingTransactionResponse; +pub mod simulate_transaction_group_result; +pub use self::simulate_transaction_group_result::SimulateTransactionGroupResult; +pub mod simulate_transaction_result; +pub use self::simulate_transaction_result::SimulateTransactionResult; +pub mod state_proof; +pub use self::state_proof::StateProof; +pub mod light_block_header_proof; +pub use self::light_block_header_proof::LightBlockHeaderProof; +pub mod state_proof_message; +pub use self::state_proof_message::StateProofMessage; +pub mod simulation_eval_overrides; +pub use self::simulation_eval_overrides::SimulationEvalOverrides; +pub mod scratch_change; +pub use self::scratch_change::ScratchChange; +pub mod application_state_operation; +pub use self::application_state_operation::ApplicationStateOperation; +pub mod application_kv_storage; +pub use self::application_kv_storage::ApplicationKvStorage; +pub mod application_initial_states; +pub use self::application_initial_states::ApplicationInitialStates; +pub mod simulation_opcode_trace_unit; +pub use self::simulation_opcode_trace_unit::SimulationOpcodeTraceUnit; +pub mod simulation_transaction_exec_trace; +pub use self::simulation_transaction_exec_trace::SimulationTransactionExecTrace; +pub mod simulate_unnamed_resources_accessed; +pub use self::simulate_unnamed_resources_accessed::SimulateUnnamedResourcesAccessed; +pub mod simulate_initial_states; +pub use self::simulate_initial_states::SimulateInitialStates; +pub mod app_call_logs; +pub use self::app_call_logs::AppCallLogs; +pub mod transaction_proof; +pub use self::transaction_proof::TransactionProof; +pub mod account_asset_information; +pub use self::account_asset_information::AccountAssetInformation; +pub mod account_assets_information; +pub use self::account_assets_information::AccountAssetsInformation; +pub mod account_application_information; +pub use self::account_application_information::AccountApplicationInformation; +pub mod get_pending_transactions_by_address; +pub use self::get_pending_transactions_by_address::GetPendingTransactionsByAddress; +pub mod get_block; +pub use self::get_block::GetBlock; +pub mod get_block_txids; +pub use self::get_block_txids::GetBlockTxids; +pub mod get_block_hash; +pub use self::get_block_hash::GetBlockHash; +pub mod get_block_logs; +pub use self::get_block_logs::GetBlockLogs; +pub mod get_supply; +pub use self::get_supply::GetSupply; +pub mod add_participation_key; +pub use self::add_participation_key::AddParticipationKey; +pub mod get_status; +pub use self::get_status::GetStatus; +pub mod wait_for_block; +pub use self::wait_for_block::WaitForBlock; +pub mod raw_transaction; +pub use self::raw_transaction::RawTransaction; +pub mod simulate_transaction; +pub use self::simulate_transaction::SimulateTransaction; +pub mod transaction_params; +pub use self::transaction_params::TransactionParams; +pub mod get_pending_transactions; +pub use self::get_pending_transactions::GetPendingTransactions; +pub mod get_transaction_group_ledger_state_deltas_for_round; +pub use self::get_transaction_group_ledger_state_deltas_for_round::GetTransactionGroupLedgerStateDeltasForRound; +pub mod get_application_boxes; +pub use self::get_application_boxes::GetApplicationBoxes; +pub mod get_sync_round; +pub use self::get_sync_round::GetSyncRound; +pub mod teal_compile; +pub use self::teal_compile::TealCompile; +pub mod teal_disassemble; +pub use self::teal_disassemble::TealDisassemble; +pub mod start_catchup; +pub use self::start_catchup::StartCatchup; +pub mod abort_catchup; +pub use self::abort_catchup::AbortCatchup; +pub mod teal_dryrun; +pub use self::teal_dryrun::TealDryrun; +pub mod get_block_time_stamp_offset; +pub use self::get_block_time_stamp_offset::GetBlockTimeStampOffset; + +// Custom Algod typed block models (Block* to avoid shape collisions) +pub mod block; +pub use self::block::Block; +pub mod signed_txn_in_block; +pub use self::signed_txn_in_block::SignedTxnInBlock; +pub mod block_eval_delta; +pub use self::block_eval_delta::BlockEvalDelta; +pub mod block_state_delta; +pub use self::block_state_delta::BlockStateDelta; +pub mod block_account_state_delta; +pub use self::block_account_state_delta::BlockAccountStateDelta; +pub mod block_app_eval_delta; +pub use self::block_app_eval_delta::BlockAppEvalDelta; +pub mod block_state_proof_tracking_data; +pub use self::block_state_proof_tracking_data::BlockStateProofTrackingData; +pub mod block_state_proof_tracking; +pub use self::block_state_proof_tracking::BlockStateProofTracking; diff --git a/crates/algod_client_ffi/src/models/participation_key.rs b/crates/algod_client_ffi/src/models/participation_key.rs new file mode 100644 index 000000000..dcb558722 --- /dev/null +++ b/crates/algod_client_ffi/src/models/participation_key.rs @@ -0,0 +1,64 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ParticipationKey as RustParticipationKey; + +use crate::models::AccountParticipation; + +/// Represents a participation key used by the node. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ParticipationKey { + /// The key's ParticipationID. + pub id: String, + /// Address the key was generated for. + pub address: String, + /// When registered, this is the first round it may be used. + pub effective_first_valid: Option, + /// When registered, this is the last round it may be used. + pub effective_last_valid: Option, + /// Round when this key was last used to vote. + pub last_vote: Option, + /// Round when this key was last used to propose a block. + pub last_block_proposal: Option, + /// Round when this key was last used to generate a state proof. + pub last_state_proof: Option, + pub key: AccountParticipation, +} + +impl From for ParticipationKey { + fn from(rust_struct: RustParticipationKey) -> Self { + Self { + id: rust_struct.id, + address: rust_struct.address, + effective_first_valid: rust_struct.effective_first_valid, + effective_last_valid: rust_struct.effective_last_valid, + last_vote: rust_struct.last_vote, + last_block_proposal: rust_struct.last_block_proposal, + last_state_proof: rust_struct.last_state_proof, + key: rust_struct.key.into(), + } + } +} + +impl From for RustParticipationKey { + fn from(ffi_struct: ParticipationKey) -> Self { + Self { + id: ffi_struct.id, + address: ffi_struct.address, + effective_first_valid: ffi_struct.effective_first_valid, + effective_last_valid: ffi_struct.effective_last_valid, + last_vote: ffi_struct.last_vote, + last_block_proposal: ffi_struct.last_block_proposal, + last_state_proof: ffi_struct.last_state_proof, + key: ffi_struct.key.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/pending_transaction_response.rs b/crates/algod_client_ffi/src/models/pending_transaction_response.rs new file mode 100644 index 000000000..c9effbdd6 --- /dev/null +++ b/crates/algod_client_ffi/src/models/pending_transaction_response.rs @@ -0,0 +1,74 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::PendingTransactionResponse as RustPendingTransactionResponse; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AccountStateDelta; +use crate::models::StateDelta; +use crate::models::UnknownJsonValue; + +/// Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct PendingTransactionResponse { + /// The asset index if the transaction was found and it created an asset. + pub asset_id: Option, + /// The application index if the transaction was found and it created an application. + pub app_id: Option, + /// Rewards in microalgos applied to the close remainder to account. + pub close_rewards: Option, + /// Closing amount for the transaction. + pub closing_amount: Option, + /// The number of the asset's unit that were transferred to the close-to address. + pub asset_closing_amount: Option, + /// The round where this transaction was confirmed, if present. + pub confirmed_round: Option, + /// Indicates that the transaction was kicked out of this node's transaction pool (and specifies why that happened). An empty string indicates the transaction wasn't kicked out of this node's txpool due to an error. + pub pool_error: String, + /// Rewards in microalgos applied to the receiver account. + pub receiver_rewards: Option, + /// Rewards in microalgos applied to the sender account. + pub sender_rewards: Option, + /// Local state key/value changes for the application being executed by this transaction. + pub local_state_delta: Option>, + pub global_state_delta: Option, + /// Logs for the application being executed by this transaction. + pub logs: Option>>, + /// Inner transactions produced by application execution. + pub inner_txns: Option>, + /// The raw signed transaction. + pub txn: AlgokitSignedTransaction, +} + +impl From for PendingTransactionResponse { + fn from(rust_struct: RustPendingTransactionResponse) -> Self { + Self { + asset_id: rust_struct.asset_id, + app_id: rust_struct.app_id, + close_rewards: rust_struct.close_rewards, + closing_amount: rust_struct.closing_amount, + asset_closing_amount: rust_struct.asset_closing_amount, + confirmed_round: rust_struct.confirmed_round, + pool_error: rust_struct.pool_error, + receiver_rewards: rust_struct.receiver_rewards, + sender_rewards: rust_struct.sender_rewards, + local_state_delta: rust_struct + .local_state_delta + .map(|v| v.into_iter().map(|v| v.into()).collect()), + global_state_delta: rust_struct.global_state_delta.map(|v| v.into()), + logs: rust_struct.logs.map(|v| v.into_iter().collect()), + inner_txns: rust_struct + .inner_txns + .map(|v| v.into_iter().map(|v| v.into()).collect()), + txn: rust_struct.txn.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/raw_transaction.rs b/crates/algod_client_ffi/src/models/raw_transaction.rs new file mode 100644 index 000000000..a00db4633 --- /dev/null +++ b/crates/algod_client_ffi/src/models/raw_transaction.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::RawTransaction as RustRawTransaction; + +/// Transaction ID of the submission. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct RawTransaction { + /// encoding of the transaction hash. + pub tx_id: String, +} + +impl From for RawTransaction { + fn from(rust_struct: RustRawTransaction) -> Self { + Self { + tx_id: rust_struct.tx_id, + } + } +} + +impl From for RustRawTransaction { + fn from(ffi_struct: RawTransaction) -> Self { + Self { + tx_id: ffi_struct.tx_id, + } + } +} diff --git a/crates/algod_client_ffi/src/models/scratch_change.rs b/crates/algod_client_ffi/src/models/scratch_change.rs new file mode 100644 index 000000000..8f8a6481d --- /dev/null +++ b/crates/algod_client_ffi/src/models/scratch_change.rs @@ -0,0 +1,41 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::ScratchChange as RustScratchChange; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::AvmValue; + +/// A write operation into a scratch slot. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct ScratchChange { + /// The scratch slot written. + pub slot: u64, + pub new_value: AvmValue, +} + +impl From for ScratchChange { + fn from(rust_struct: RustScratchChange) -> Self { + Self { + slot: rust_struct.slot, + new_value: rust_struct.new_value.into(), + } + } +} + +impl From for RustScratchChange { + fn from(ffi_struct: ScratchChange) -> Self { + Self { + slot: ffi_struct.slot, + new_value: ffi_struct.new_value.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/signed_txn_in_block.rs b/crates/algod_client_ffi/src/models/signed_txn_in_block.rs new file mode 100644 index 000000000..5c5e0c5ee --- /dev/null +++ b/crates/algod_client_ffi/src/models/signed_txn_in_block.rs @@ -0,0 +1,84 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SignedTxnInBlock as RustSignedTxnInBlock; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::BlockAppEvalDelta; + +/// SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SignedTxnInBlock { + /// SignedTransaction fields (flattened from algokit_transact) + pub signed_transaction: AlgokitSignedTransaction, + /// [lsig] Logic signature (program signature). + pub logic_signature: Option>, + /// [ca] Rewards applied to close-remainder-to account. + pub closing_amount: Option, + /// [aca] Asset closing amount. + pub asset_closing_amount: Option, + /// [rs] Sender rewards. + pub sender_rewards: Option, + /// [rr] Receiver rewards. + pub receiver_rewards: Option, + /// [rc] Close rewards. + pub close_rewards: Option, + /// [dt] State changes from app execution. + pub eval_delta: Option, + /// [caid] Asset ID if created. + pub config_asset: Option, + /// [apid] App ID if created. + pub application_id: Option, + /// [hgi] Has genesis ID flag. + pub has_genesis_id: Option, + /// [hgh] Has genesis hash flag. + pub has_genesis_hash: Option, +} + +impl From for SignedTxnInBlock { + fn from(rust_struct: RustSignedTxnInBlock) -> Self { + Self { + signed_transaction: rust_struct.signed_transaction.into(), + logic_signature: rust_struct.logic_signature, + closing_amount: rust_struct.closing_amount, + asset_closing_amount: rust_struct.asset_closing_amount, + sender_rewards: rust_struct.sender_rewards, + receiver_rewards: rust_struct.receiver_rewards, + close_rewards: rust_struct.close_rewards, + eval_delta: rust_struct.eval_delta.map(|v| v.into()), + config_asset: rust_struct.config_asset, + application_id: rust_struct.application_id, + has_genesis_id: rust_struct.has_genesis_id, + has_genesis_hash: rust_struct.has_genesis_hash, + } + } +} + +impl TryFrom for RustSignedTxnInBlock { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: SignedTxnInBlock) -> Result { + Ok(Self { + signed_transaction: ffi_struct.signed_transaction.try_into()?, + logic_signature: ffi_struct.logic_signature, + closing_amount: ffi_struct.closing_amount, + asset_closing_amount: ffi_struct.asset_closing_amount, + sender_rewards: ffi_struct.sender_rewards, + receiver_rewards: ffi_struct.receiver_rewards, + close_rewards: ffi_struct.close_rewards, + eval_delta: ffi_struct.eval_delta.map(|v| v.try_into()).transpose()?, + config_asset: ffi_struct.config_asset, + application_id: ffi_struct.application_id, + has_genesis_id: ffi_struct.has_genesis_id, + has_genesis_hash: ffi_struct.has_genesis_hash, + }) + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_initial_states.rs b/crates/algod_client_ffi/src/models/simulate_initial_states.rs new file mode 100644 index 000000000..1eb282e1f --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_initial_states.rs @@ -0,0 +1,42 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateInitialStates as RustSimulateInitialStates; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationInitialStates; + +/// Initial states of resources that were accessed during simulation. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateInitialStates { + /// The initial states of accessed application before simulation. The order of this array is arbitrary. + pub app_initial_states: Option>, +} + +impl From for SimulateInitialStates { + fn from(rust_struct: RustSimulateInitialStates) -> Self { + Self { + app_initial_states: rust_struct + .app_initial_states + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} + +impl From for RustSimulateInitialStates { + fn from(ffi_struct: SimulateInitialStates) -> Self { + Self { + app_initial_states: ffi_struct + .app_initial_states + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_request.rs b/crates/algod_client_ffi/src/models/simulate_request.rs new file mode 100644 index 000000000..48188f79e --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_request.rs @@ -0,0 +1,83 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateRequest as RustSimulateRequest; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::SimulateRequestTransactionGroup; +use crate::models::SimulateTraceConfig; + +/// Request type for simulation endpoint. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateRequest { + /// The transaction groups to simulate. + pub txn_groups: Vec, + /// If provided, specifies the round preceding the simulation. State changes through this round will be used to run this simulation. Usually only the 4 most recent rounds will be available (controlled by the node config value MaxAcctLookback). If not specified, defaults to the latest available round. + pub round: Option, + /// Allows transactions without signatures to be simulated as if they had correct signatures. + pub allow_empty_signatures: Option, + /// Lifts limits on log opcode usage during simulation. + pub allow_more_logging: Option, + /// Allows access to unnamed resources during simulation. + pub allow_unnamed_resources: Option, + /// Applies extra opcode budget during simulation for each transaction group. + pub extra_opcode_budget: Option, + pub exec_trace_config: Option, + /// If true, signers for transactions that are missing signatures will be fixed during evaluation. + pub fix_signers: Option, +} + +impl From for SimulateRequest { + fn from(rust_struct: RustSimulateRequest) -> Self { + Self { + txn_groups: rust_struct + .txn_groups + .into_iter() + .map(|v| v.into()) + .collect(), + round: rust_struct.round, + allow_empty_signatures: rust_struct.allow_empty_signatures, + allow_more_logging: rust_struct.allow_more_logging, + allow_unnamed_resources: rust_struct.allow_unnamed_resources, + extra_opcode_budget: rust_struct.extra_opcode_budget, + exec_trace_config: rust_struct.exec_trace_config.map(|v| v.into()), + fix_signers: rust_struct.fix_signers, + } + } +} + +impl TryFrom for RustSimulateRequest { + type Error = crate::apis::Error; + + fn try_from(ffi_struct: SimulateRequest) -> Result { + Ok(Self { + txn_groups: ffi_struct + .txn_groups + .into_iter() + .map(|v| { + v.try_into() + .map_err(|e: algokit_transact_ffi::AlgoKitTransactError| { + crate::apis::Error::Serde { + message: e.to_string(), + } + }) + }) + .collect::>()?, + round: ffi_struct.round, + allow_empty_signatures: ffi_struct.allow_empty_signatures, + allow_more_logging: ffi_struct.allow_more_logging, + allow_unnamed_resources: ffi_struct.allow_unnamed_resources, + extra_opcode_budget: ffi_struct.extra_opcode_budget, + exec_trace_config: ffi_struct.exec_trace_config.map(|v| v.into()), + fix_signers: ffi_struct.fix_signers, + }) + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_request_transaction_group.rs b/crates/algod_client_ffi/src/models/simulate_request_transaction_group.rs new file mode 100644 index 000000000..956f913d2 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_request_transaction_group.rs @@ -0,0 +1,42 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateRequestTransactionGroup as RustSimulateRequestTransactionGroup; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// A transaction group to simulate. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateRequestTransactionGroup { + /// An atomic transaction group. + pub txns: Vec, +} + +impl From for SimulateRequestTransactionGroup { + fn from(rust_struct: RustSimulateRequestTransactionGroup) -> Self { + Self { + txns: rust_struct.txns.into_iter().map(|v| v.into()).collect(), + } + } +} + +impl TryFrom for RustSimulateRequestTransactionGroup { + type Error = algokit_transact_ffi::AlgoKitTransactError; + + fn try_from(ffi_struct: SimulateRequestTransactionGroup) -> Result { + Ok(Self { + txns: ffi_struct + .txns + .into_iter() + .map(|v| v.try_into()) + .collect::>()?, + }) + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_trace_config.rs b/crates/algod_client_ffi/src/models/simulate_trace_config.rs new file mode 100644 index 000000000..bb75d4060 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_trace_config.rs @@ -0,0 +1,48 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateTraceConfig as RustSimulateTraceConfig; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// An object that configures simulation execution trace. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateTraceConfig { + /// A boolean option for opting in execution trace features simulation endpoint. + pub enable: Option, + /// A boolean option enabling returning stack changes together with execution trace during simulation. + pub stack_change: Option, + /// A boolean option enabling returning scratch slot changes together with execution trace during simulation. + pub scratch_change: Option, + /// A boolean option enabling returning application state changes (global, local, and box changes) with the execution trace during simulation. + pub state_change: Option, +} + +impl From for SimulateTraceConfig { + fn from(rust_struct: RustSimulateTraceConfig) -> Self { + Self { + enable: rust_struct.enable, + stack_change: rust_struct.stack_change, + scratch_change: rust_struct.scratch_change, + state_change: rust_struct.state_change, + } + } +} + +impl From for RustSimulateTraceConfig { + fn from(ffi_struct: SimulateTraceConfig) -> Self { + Self { + enable: ffi_struct.enable, + stack_change: ffi_struct.stack_change, + scratch_change: ffi_struct.scratch_change, + state_change: ffi_struct.state_change, + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_transaction.rs b/crates/algod_client_ffi/src/models/simulate_transaction.rs new file mode 100644 index 000000000..4695e5a02 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_transaction.rs @@ -0,0 +1,49 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateTransaction as RustSimulateTransaction; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::SimulateInitialStates; +use crate::models::SimulateTraceConfig; +use crate::models::SimulateTransactionGroupResult; +use crate::models::SimulationEvalOverrides; + +/// Result of a transaction group simulation. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateTransaction { + /// The version of this response object. + pub version: u64, + /// The round immediately preceding this simulation. State changes through this round were used to run this simulation. + pub last_round: u64, + /// A result object for each transaction group that was simulated. + pub txn_groups: Vec, + pub eval_overrides: Option, + pub exec_trace_config: Option, + pub initial_states: Option, +} + +impl From for SimulateTransaction { + fn from(rust_struct: RustSimulateTransaction) -> Self { + Self { + version: rust_struct.version, + last_round: rust_struct.last_round, + txn_groups: rust_struct + .txn_groups + .into_iter() + .map(|v| v.into()) + .collect(), + eval_overrides: rust_struct.eval_overrides.map(|v| v.into()), + exec_trace_config: rust_struct.exec_trace_config.map(|v| v.into()), + initial_states: rust_struct.initial_states.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_transaction_group_result.rs b/crates/algod_client_ffi/src/models/simulate_transaction_group_result.rs new file mode 100644 index 000000000..2bd43ff57 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_transaction_group_result.rs @@ -0,0 +1,49 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateTransactionGroupResult as RustSimulateTransactionGroupResult; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::SimulateTransactionResult; +use crate::models::SimulateUnnamedResourcesAccessed; + +/// Simulation result for an atomic transaction group +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateTransactionGroupResult { + /// Simulation result for individual transactions + pub txn_results: Vec, + /// If present, indicates that the transaction group failed and specifies why that happened + pub failure_message: Option, + /// If present, indicates which transaction in this group caused the failure. This array represents the path to the failing transaction. Indexes are zero based, the first element indicates the top-level transaction, and successive elements indicate deeper inner transactions. + pub failed_at: Option>, + /// Total budget added during execution of app calls in the transaction group. + pub app_budget_added: Option, + /// Total budget consumed during execution of app calls in the transaction group. + pub app_budget_consumed: Option, + pub unnamed_resources_accessed: Option, +} + +impl From for SimulateTransactionGroupResult { + fn from(rust_struct: RustSimulateTransactionGroupResult) -> Self { + Self { + txn_results: rust_struct + .txn_results + .into_iter() + .map(|v| v.into()) + .collect(), + failure_message: rust_struct.failure_message, + failed_at: rust_struct.failed_at.map(|v| v.into_iter().collect()), + app_budget_added: rust_struct.app_budget_added, + app_budget_consumed: rust_struct.app_budget_consumed, + unnamed_resources_accessed: rust_struct.unnamed_resources_accessed.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_transaction_result.rs b/crates/algod_client_ffi/src/models/simulate_transaction_result.rs new file mode 100644 index 000000000..122aad9e6 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_transaction_result.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateTransactionResult as RustSimulateTransactionResult; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::PendingTransactionResponse; +use crate::models::SimulateUnnamedResourcesAccessed; +use crate::models::SimulationTransactionExecTrace; + +/// Simulation result for an individual transaction +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateTransactionResult { + pub txn_result: PendingTransactionResponse, + /// Budget used during execution of an app call transaction. This value includes budged used by inner app calls spawned by this transaction. + pub app_budget_consumed: Option, + /// Budget used during execution of a logic sig transaction. + pub logic_sig_budget_consumed: Option, + pub exec_trace: Option, + pub unnamed_resources_accessed: Option, + /// The account that needed to sign this transaction when no signature was provided and the provided signer was incorrect. + pub fixed_signer: Option, +} + +impl From for SimulateTransactionResult { + fn from(rust_struct: RustSimulateTransactionResult) -> Self { + Self { + txn_result: rust_struct.txn_result.into(), + app_budget_consumed: rust_struct.app_budget_consumed, + logic_sig_budget_consumed: rust_struct.logic_sig_budget_consumed, + exec_trace: rust_struct.exec_trace.map(|v| v.into()), + unnamed_resources_accessed: rust_struct.unnamed_resources_accessed.map(|v| v.into()), + fixed_signer: rust_struct.fixed_signer, + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulate_unnamed_resources_accessed.rs b/crates/algod_client_ffi/src/models/simulate_unnamed_resources_accessed.rs new file mode 100644 index 000000000..d382ad958 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulate_unnamed_resources_accessed.rs @@ -0,0 +1,76 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulateUnnamedResourcesAccessed as RustSimulateUnnamedResourcesAccessed; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationLocalReference; +use crate::models::AssetHoldingReference; +use crate::models::BoxReference; + +/// These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulateUnnamedResourcesAccessed { + /// The unnamed accounts that were referenced. The order of this array is arbitrary. + pub accounts: Option>, + /// The unnamed assets that were referenced. The order of this array is arbitrary. + pub assets: Option>, + /// The unnamed applications that were referenced. The order of this array is arbitrary. + pub apps: Option>, + /// The unnamed boxes that were referenced. The order of this array is arbitrary. + pub boxes: Option>, + /// The number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes. + pub extra_box_refs: Option, + /// The unnamed asset holdings that were referenced. The order of this array is arbitrary. + pub asset_holdings: Option>, + /// The unnamed application local states that were referenced. The order of this array is arbitrary. + pub app_locals: Option>, +} + +impl From for SimulateUnnamedResourcesAccessed { + fn from(rust_struct: RustSimulateUnnamedResourcesAccessed) -> Self { + Self { + accounts: rust_struct.accounts.map(|v| v.into_iter().collect()), + assets: rust_struct.assets.map(|v| v.into_iter().collect()), + apps: rust_struct.apps.map(|v| v.into_iter().collect()), + boxes: rust_struct + .boxes + .map(|v| v.into_iter().map(|v| v.into()).collect()), + extra_box_refs: rust_struct.extra_box_refs, + asset_holdings: rust_struct + .asset_holdings + .map(|v| v.into_iter().map(|v| v.into()).collect()), + app_locals: rust_struct + .app_locals + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} + +impl From for RustSimulateUnnamedResourcesAccessed { + fn from(ffi_struct: SimulateUnnamedResourcesAccessed) -> Self { + Self { + accounts: ffi_struct.accounts.map(|v| v.into_iter().collect()), + assets: ffi_struct.assets.map(|v| v.into_iter().collect()), + apps: ffi_struct.apps.map(|v| v.into_iter().collect()), + boxes: ffi_struct + .boxes + .map(|v| v.into_iter().map(|v| v.into()).collect()), + extra_box_refs: ffi_struct.extra_box_refs, + asset_holdings: ffi_struct + .asset_holdings + .map(|v| v.into_iter().map(|v| v.into()).collect()), + app_locals: ffi_struct + .app_locals + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulation_eval_overrides.rs b/crates/algod_client_ffi/src/models/simulation_eval_overrides.rs new file mode 100644 index 000000000..1678ae3ae --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulation_eval_overrides.rs @@ -0,0 +1,56 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulationEvalOverrides as RustSimulationEvalOverrides; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// The set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulationEvalOverrides { + /// If true, transactions without signatures are allowed and simulated as if they were properly signed. + pub allow_empty_signatures: Option, + /// If true, allows access to unnamed resources during simulation. + pub allow_unnamed_resources: Option, + /// The maximum log calls one can make during simulation + pub max_log_calls: Option, + /// The maximum byte number to log during simulation + pub max_log_size: Option, + /// The extra opcode budget added to each transaction group during simulation + pub extra_opcode_budget: Option, + /// If true, signers for transactions that are missing signatures will be fixed during evaluation. + pub fix_signers: Option, +} + +impl From for SimulationEvalOverrides { + fn from(rust_struct: RustSimulationEvalOverrides) -> Self { + Self { + allow_empty_signatures: rust_struct.allow_empty_signatures, + allow_unnamed_resources: rust_struct.allow_unnamed_resources, + max_log_calls: rust_struct.max_log_calls, + max_log_size: rust_struct.max_log_size, + extra_opcode_budget: rust_struct.extra_opcode_budget, + fix_signers: rust_struct.fix_signers, + } + } +} + +impl From for RustSimulationEvalOverrides { + fn from(ffi_struct: SimulationEvalOverrides) -> Self { + Self { + allow_empty_signatures: ffi_struct.allow_empty_signatures, + allow_unnamed_resources: ffi_struct.allow_unnamed_resources, + max_log_calls: ffi_struct.max_log_calls, + max_log_size: ffi_struct.max_log_size, + extra_opcode_budget: ffi_struct.extra_opcode_budget, + fix_signers: ffi_struct.fix_signers, + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulation_opcode_trace_unit.rs b/crates/algod_client_ffi/src/models/simulation_opcode_trace_unit.rs new file mode 100644 index 000000000..a944d1813 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulation_opcode_trace_unit.rs @@ -0,0 +1,72 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulationOpcodeTraceUnit as RustSimulationOpcodeTraceUnit; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::ApplicationStateOperation; +use crate::models::AvmValue; +use crate::models::ScratchChange; + +/// The set of trace information and effect from evaluating a single opcode. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulationOpcodeTraceUnit { + /// The program counter of the current opcode being evaluated. + pub pc: u64, + /// The writes into scratch slots. + pub scratch_changes: Option>, + /// The operations against the current application's states. + pub state_changes: Option>, + /// The indexes of the traces for inner transactions spawned by this opcode, if any. + pub spawned_inners: Option>, + /// The number of deleted stack values by this opcode. + pub stack_pop_count: Option, + /// The values added by this opcode to the stack. + pub stack_additions: Option>, +} + +impl From for SimulationOpcodeTraceUnit { + fn from(rust_struct: RustSimulationOpcodeTraceUnit) -> Self { + Self { + pc: rust_struct.pc, + scratch_changes: rust_struct + .scratch_changes + .map(|v| v.into_iter().map(|v| v.into()).collect()), + state_changes: rust_struct + .state_changes + .map(|v| v.into_iter().map(|v| v.into()).collect()), + spawned_inners: rust_struct.spawned_inners.map(|v| v.into_iter().collect()), + stack_pop_count: rust_struct.stack_pop_count, + stack_additions: rust_struct + .stack_additions + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} + +impl From for RustSimulationOpcodeTraceUnit { + fn from(ffi_struct: SimulationOpcodeTraceUnit) -> Self { + Self { + pc: ffi_struct.pc, + scratch_changes: ffi_struct + .scratch_changes + .map(|v| v.into_iter().map(|v| v.into()).collect()), + state_changes: ffi_struct + .state_changes + .map(|v| v.into_iter().map(|v| v.into()).collect()), + spawned_inners: ffi_struct.spawned_inners.map(|v| v.into_iter().collect()), + stack_pop_count: ffi_struct.stack_pop_count, + stack_additions: ffi_struct + .stack_additions + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/simulation_transaction_exec_trace.rs b/crates/algod_client_ffi/src/models/simulation_transaction_exec_trace.rs new file mode 100644 index 000000000..2c8abfb80 --- /dev/null +++ b/crates/algod_client_ffi/src/models/simulation_transaction_exec_trace.rs @@ -0,0 +1,86 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::SimulationTransactionExecTrace as RustSimulationTransactionExecTrace; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::SimulationOpcodeTraceUnit; + +/// The execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct SimulationTransactionExecTrace { + /// Program trace that contains a trace of opcode effects in an approval program. + pub approval_program_trace: Option>, + /// SHA512_256 hash digest of the approval program executed in transaction. + pub approval_program_hash: Option>, + /// Program trace that contains a trace of opcode effects in a clear state program. + pub clear_state_program_trace: Option>, + /// SHA512_256 hash digest of the clear state program executed in transaction. + pub clear_state_program_hash: Option>, + /// If true, indicates that the clear state program failed and any persistent state changes it produced should be reverted once the program exits. + pub clear_state_rollback: Option, + /// The error message explaining why the clear state program failed. This field will only be populated if clear-state-rollback is true and the failure was due to an execution error. + pub clear_state_rollback_error: Option, + /// Program trace that contains a trace of opcode effects in a logic sig. + pub logic_sig_trace: Option>, + /// SHA512_256 hash digest of the logic sig executed in transaction. + pub logic_sig_hash: Option>, + /// An array of SimulationTransactionExecTrace representing the execution trace of any inner transactions executed. + pub inner_trace: Option>, +} + +impl From for SimulationTransactionExecTrace { + fn from(rust_struct: RustSimulationTransactionExecTrace) -> Self { + Self { + approval_program_trace: rust_struct + .approval_program_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + approval_program_hash: rust_struct.approval_program_hash, + clear_state_program_trace: rust_struct + .clear_state_program_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + clear_state_program_hash: rust_struct.clear_state_program_hash, + clear_state_rollback: rust_struct.clear_state_rollback, + clear_state_rollback_error: rust_struct.clear_state_rollback_error, + logic_sig_trace: rust_struct + .logic_sig_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + logic_sig_hash: rust_struct.logic_sig_hash, + inner_trace: rust_struct + .inner_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} + +impl From for RustSimulationTransactionExecTrace { + fn from(ffi_struct: SimulationTransactionExecTrace) -> Self { + Self { + approval_program_trace: ffi_struct + .approval_program_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + approval_program_hash: ffi_struct.approval_program_hash, + clear_state_program_trace: ffi_struct + .clear_state_program_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + clear_state_program_hash: ffi_struct.clear_state_program_hash, + clear_state_rollback: ffi_struct.clear_state_rollback, + clear_state_rollback_error: ffi_struct.clear_state_rollback_error, + logic_sig_trace: ffi_struct + .logic_sig_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + logic_sig_hash: ffi_struct.logic_sig_hash, + inner_trace: ffi_struct + .inner_trace + .map(|v| v.into_iter().map(|v| v.into()).collect()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/start_catchup.rs b/crates/algod_client_ffi/src/models/start_catchup.rs new file mode 100644 index 000000000..2316f9207 --- /dev/null +++ b/crates/algod_client_ffi/src/models/start_catchup.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::StartCatchup as RustStartCatchup; + +/// An catchpoint start response. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct StartCatchup { + /// Catchup start response string + pub catchup_message: String, +} + +impl From for StartCatchup { + fn from(rust_struct: RustStartCatchup) -> Self { + Self { + catchup_message: rust_struct.catchup_message, + } + } +} + +impl From for RustStartCatchup { + fn from(ffi_struct: StartCatchup) -> Self { + Self { + catchup_message: ffi_struct.catchup_message, + } + } +} diff --git a/crates/algod_client_ffi/src/models/state_delta.rs b/crates/algod_client_ffi/src/models/state_delta.rs new file mode 100644 index 000000000..fad4c423e --- /dev/null +++ b/crates/algod_client_ffi/src/models/state_delta.rs @@ -0,0 +1,33 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::StateDelta as RustStateDelta; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::EvalDeltaKeyValue; + +/// Application state delta. +#[derive(Clone, Debug, PartialEq)] +pub struct StateDelta(Vec); + +uniffi::custom_newtype!(StateDelta, Vec); + +impl From for StateDelta { + fn from(rust_struct: RustStateDelta) -> Self { + Self(rust_struct.into_iter().map(|v| v.into()).collect()) + } +} + +impl From for RustStateDelta { + fn from(ffi_struct: StateDelta) -> Self { + ffi_struct.0.into_iter().map(|v| v.into()).collect() + } +} diff --git a/crates/algod_client_ffi/src/models/state_proof.rs b/crates/algod_client_ffi/src/models/state_proof.rs new file mode 100644 index 000000000..d4e2570ce --- /dev/null +++ b/crates/algod_client_ffi/src/models/state_proof.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::StateProof as RustStateProof; + +use crate::models::StateProofMessage; + +/// Represents a state proof and its corresponding message +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct StateProof { + pub message: StateProofMessage, + /// The encoded StateProof for the message. + pub state_proof: Vec, +} + +impl From for StateProof { + fn from(rust_struct: RustStateProof) -> Self { + Self { + message: rust_struct.message.into(), + state_proof: rust_struct.state_proof, + } + } +} + +impl From for RustStateProof { + fn from(ffi_struct: StateProof) -> Self { + Self { + message: ffi_struct.message.into(), + state_proof: ffi_struct.state_proof, + } + } +} diff --git a/crates/algod_client_ffi/src/models/state_proof_message.rs b/crates/algod_client_ffi/src/models/state_proof_message.rs new file mode 100644 index 000000000..88fa88880 --- /dev/null +++ b/crates/algod_client_ffi/src/models/state_proof_message.rs @@ -0,0 +1,51 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::StateProofMessage as RustStateProofMessage; + +/// Represents the message that the state proofs are attesting to. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct StateProofMessage { + /// The vector commitment root on all light block headers within a state proof interval. + pub block_headers_commitment: Vec, + /// The vector commitment root of the top N accounts to sign the next StateProof. + pub voters_commitment: Vec, + /// An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. + pub ln_proven_weight: u64, + /// The first round the message attests to. + pub first_attested_round: u64, + /// The last round the message attests to. + pub last_attested_round: u64, +} + +impl From for StateProofMessage { + fn from(rust_struct: RustStateProofMessage) -> Self { + Self { + block_headers_commitment: rust_struct.block_headers_commitment, + voters_commitment: rust_struct.voters_commitment, + ln_proven_weight: rust_struct.ln_proven_weight, + first_attested_round: rust_struct.first_attested_round, + last_attested_round: rust_struct.last_attested_round, + } + } +} + +impl From for RustStateProofMessage { + fn from(ffi_struct: StateProofMessage) -> Self { + Self { + block_headers_commitment: ffi_struct.block_headers_commitment, + voters_commitment: ffi_struct.voters_commitment, + ln_proven_weight: ffi_struct.ln_proven_weight, + first_attested_round: ffi_struct.first_attested_round, + last_attested_round: ffi_struct.last_attested_round, + } + } +} diff --git a/crates/algod_client_ffi/src/models/teal_compile.rs b/crates/algod_client_ffi/src/models/teal_compile.rs new file mode 100644 index 000000000..099c18f18 --- /dev/null +++ b/crates/algod_client_ffi/src/models/teal_compile.rs @@ -0,0 +1,45 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TealCompile as RustTealCompile; + +use crate::models::UnknownJsonValue; + +/// Teal compile Result +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TealCompile { + /// base32 SHA512_256 of program bytes (Address style) + pub hash: String, + /// base64 encoded program bytes + pub result: Vec, + /// JSON of the source map + pub sourcemap: Option, +} + +impl From for TealCompile { + fn from(rust_struct: RustTealCompile) -> Self { + Self { + hash: rust_struct.hash, + result: rust_struct.result, + sourcemap: rust_struct.sourcemap.map(|v| v.into()), + } + } +} + +impl From for RustTealCompile { + fn from(ffi_struct: TealCompile) -> Self { + Self { + hash: ffi_struct.hash, + result: ffi_struct.result, + sourcemap: ffi_struct.sourcemap.map(|v| v.into()), + } + } +} diff --git a/crates/algod_client_ffi/src/models/teal_disassemble.rs b/crates/algod_client_ffi/src/models/teal_disassemble.rs new file mode 100644 index 000000000..ec5f3384c --- /dev/null +++ b/crates/algod_client_ffi/src/models/teal_disassemble.rs @@ -0,0 +1,35 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TealDisassemble as RustTealDisassemble; + +/// Teal disassembly Result +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TealDisassemble { + /// disassembled Teal code + pub result: String, +} + +impl From for TealDisassemble { + fn from(rust_struct: RustTealDisassemble) -> Self { + Self { + result: rust_struct.result, + } + } +} + +impl From for RustTealDisassemble { + fn from(ffi_struct: TealDisassemble) -> Self { + Self { + result: ffi_struct.result, + } + } +} diff --git a/crates/algod_client_ffi/src/models/teal_dryrun.rs b/crates/algod_client_ffi/src/models/teal_dryrun.rs new file mode 100644 index 000000000..04c789680 --- /dev/null +++ b/crates/algod_client_ffi/src/models/teal_dryrun.rs @@ -0,0 +1,33 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TealDryrun as RustTealDryrun; + +use crate::models::DryrunTxnResult; + +/// DryrunResponse contains per-txn debug information from a dryrun. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TealDryrun { + pub txns: Vec, + pub error: String, + /// Protocol version is the protocol version Dryrun was operated under. + pub protocol_version: String, +} + +impl From for TealDryrun { + fn from(rust_struct: RustTealDryrun) -> Self { + Self { + txns: rust_struct.txns.into_iter().map(|v| v.into()).collect(), + error: rust_struct.error, + protocol_version: rust_struct.protocol_version, + } + } +} diff --git a/crates/algod_client_ffi/src/models/teal_key_value.rs b/crates/algod_client_ffi/src/models/teal_key_value.rs new file mode 100644 index 000000000..9bda4ba16 --- /dev/null +++ b/crates/algod_client_ffi/src/models/teal_key_value.rs @@ -0,0 +1,40 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TealKeyValue as RustTealKeyValue; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::TealValue; + +/// Represents a key-value pair in an application store. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TealKeyValue { + pub key: String, + pub value: TealValue, +} + +impl From for TealKeyValue { + fn from(rust_struct: RustTealKeyValue) -> Self { + Self { + key: rust_struct.key, + value: rust_struct.value.into(), + } + } +} + +impl From for RustTealKeyValue { + fn from(ffi_struct: TealKeyValue) -> Self { + Self { + key: ffi_struct.key, + value: ffi_struct.value.into(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/teal_key_value_store.rs b/crates/algod_client_ffi/src/models/teal_key_value_store.rs new file mode 100644 index 000000000..43e14783b --- /dev/null +++ b/crates/algod_client_ffi/src/models/teal_key_value_store.rs @@ -0,0 +1,33 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TealKeyValueStore as RustTealKeyValueStore; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +use crate::models::TealKeyValue; + +/// Represents a key-value store for use in an application. +#[derive(Clone, Debug, PartialEq)] +pub struct TealKeyValueStore(Vec); + +uniffi::custom_newtype!(TealKeyValueStore, Vec); + +impl From for TealKeyValueStore { + fn from(rust_struct: RustTealKeyValueStore) -> Self { + Self(rust_struct.into_iter().map(|v| v.into()).collect()) + } +} + +impl From for RustTealKeyValueStore { + fn from(ffi_struct: TealKeyValueStore) -> Self { + ffi_struct.0.into_iter().map(|v| v.into()).collect() + } +} diff --git a/crates/algod_client_ffi/src/models/teal_value.rs b/crates/algod_client_ffi/src/models/teal_value.rs new file mode 100644 index 000000000..06c33891c --- /dev/null +++ b/crates/algod_client_ffi/src/models/teal_value.rs @@ -0,0 +1,44 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TealValue as RustTealValue; +use algokit_transact_ffi::SignedTransaction as AlgokitSignedTransaction; + +/// Represents a TEAL value. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TealValue { + /// [tt] value type. Value `1` refers to **bytes**, value `2` refers to **uint** + pub r#type: u64, + /// [tb] bytes value. + pub bytes: Vec, + /// [ui] uint value. + pub uint: u64, +} + +impl From for TealValue { + fn from(rust_struct: RustTealValue) -> Self { + Self { + r#type: rust_struct.r#type, + bytes: rust_struct.bytes, + uint: rust_struct.uint, + } + } +} + +impl From for RustTealValue { + fn from(ffi_struct: TealValue) -> Self { + Self { + r#type: ffi_struct.r#type, + bytes: ffi_struct.bytes, + uint: ffi_struct.uint, + } + } +} diff --git a/crates/algod_client_ffi/src/models/transaction_params.rs b/crates/algod_client_ffi/src/models/transaction_params.rs new file mode 100644 index 000000000..bfcf03622 --- /dev/null +++ b/crates/algod_client_ffi/src/models/transaction_params.rs @@ -0,0 +1,61 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TransactionParams as RustTransactionParams; + +/// TransactionParams contains the parameters that help a client construct +/// a new transaction. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TransactionParams { + /// ConsensusVersion indicates the consensus protocol version + /// as of LastRound. + pub consensus_version: String, + /// Fee is the suggested transaction fee + /// Fee is in units of micro-Algos per byte. + /// Fee may fall to zero but transactions must still have a fee of + /// at least MinTxnFee for the current network protocol. + pub fee: u64, + /// GenesisHash is the hash of the genesis block. + pub genesis_hash: Vec, + /// GenesisID is an ID listed in the genesis block. + pub genesis_id: String, + /// LastRound indicates the last round seen + pub last_round: u64, + /// The minimum transaction fee (not per byte) required for the + /// txn to validate for the current network protocol. + pub min_fee: u64, +} + +impl From for TransactionParams { + fn from(rust_struct: RustTransactionParams) -> Self { + Self { + consensus_version: rust_struct.consensus_version, + fee: rust_struct.fee, + genesis_hash: rust_struct.genesis_hash, + genesis_id: rust_struct.genesis_id, + last_round: rust_struct.last_round, + min_fee: rust_struct.min_fee, + } + } +} + +impl From for RustTransactionParams { + fn from(ffi_struct: TransactionParams) -> Self { + Self { + consensus_version: ffi_struct.consensus_version, + fee: ffi_struct.fee, + genesis_hash: ffi_struct.genesis_hash, + genesis_id: ffi_struct.genesis_id, + last_round: ffi_struct.last_round, + min_fee: ffi_struct.min_fee, + } + } +} diff --git a/crates/algod_client_ffi/src/models/transaction_proof.rs b/crates/algod_client_ffi/src/models/transaction_proof.rs new file mode 100644 index 000000000..2c4f6ceae --- /dev/null +++ b/crates/algod_client_ffi/src/models/transaction_proof.rs @@ -0,0 +1,53 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::TransactionProof as RustTransactionProof; + +/// Proof of transaction in a block. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct TransactionProof { + /// Proof of transaction membership. + pub proof: Vec, + /// Hash of SignedTxnInBlock for verifying proof. + pub stibhash: Vec, + /// Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root. + pub treedepth: u64, + /// Index of the transaction in the block's payset. + pub idx: u64, + /// The type of hash function used to create the proof, must be one of: + /// * sha512_256 + /// * sha256 + pub hashtype: String, +} + +impl From for TransactionProof { + fn from(rust_struct: RustTransactionProof) -> Self { + Self { + proof: rust_struct.proof, + stibhash: rust_struct.stibhash, + treedepth: rust_struct.treedepth, + idx: rust_struct.idx, + hashtype: rust_struct.hashtype, + } + } +} + +impl From for RustTransactionProof { + fn from(ffi_struct: TransactionProof) -> Self { + Self { + proof: ffi_struct.proof, + stibhash: ffi_struct.stibhash, + treedepth: ffi_struct.treedepth, + idx: ffi_struct.idx, + hashtype: ffi_struct.hashtype, + } + } +} diff --git a/crates/algod_client_ffi/src/models/version.rs b/crates/algod_client_ffi/src/models/version.rs new file mode 100644 index 000000000..d620a12ac --- /dev/null +++ b/crates/algod_client_ffi/src/models/version.rs @@ -0,0 +1,45 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::Version as RustVersion; + +use crate::models::BuildVersion; + +/// algod version information. +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct Version { + pub build: BuildVersion, + pub genesis_hash_b64: Vec, + pub genesis_id: String, + pub versions: Vec, +} + +impl From for Version { + fn from(rust_struct: RustVersion) -> Self { + Self { + build: rust_struct.build.into(), + genesis_hash_b64: rust_struct.genesis_hash_b64, + genesis_id: rust_struct.genesis_id, + versions: rust_struct.versions.into_iter().collect(), + } + } +} + +impl From for RustVersion { + fn from(ffi_struct: Version) -> Self { + Self { + build: ffi_struct.build.into(), + genesis_hash_b64: ffi_struct.genesis_hash_b64, + genesis_id: ffi_struct.genesis_id, + versions: ffi_struct.versions.into_iter().collect(), + } + } +} diff --git a/crates/algod_client_ffi/src/models/wait_for_block.rs b/crates/algod_client_ffi/src/models/wait_for_block.rs new file mode 100644 index 000000000..7edaa062c --- /dev/null +++ b/crates/algod_client_ffi/src/models/wait_for_block.rs @@ -0,0 +1,135 @@ +/* + * Algod REST API. + * + * API endpoint for algod operations. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: contact@algorand.com + * Generated by: Rust OpenAPI Generator + */ + +use crate::models; +use algod_client::models::WaitForBlock as RustWaitForBlock; + +/// NodeStatus contains the information about a node status +#[derive(Clone, Debug, PartialEq, uniffi::Record)] +pub struct WaitForBlock { + /// CatchupTime in nanoseconds + pub catchup_time: u64, + /// LastRound indicates the last round seen + pub last_round: u64, + /// LastVersion indicates the last consensus version supported + pub last_version: String, + /// NextVersion of consensus protocol to use + pub next_version: String, + /// NextVersionRound is the round at which the next consensus version will apply + pub next_version_round: u64, + /// NextVersionSupported indicates whether the next consensus version is supported by this node + pub next_version_supported: bool, + /// StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress + pub stopped_at_unsupported_round: bool, + /// TimeSinceLastRound in nanoseconds + pub time_since_last_round: u64, + /// The last catchpoint seen by the node + pub last_catchpoint: Option, + /// The current catchpoint that is being caught up to + pub catchpoint: Option, + /// The total number of accounts included in the current catchpoint + pub catchpoint_total_accounts: Option, + /// The number of accounts from the current catchpoint that have been processed so far as part of the catchup + pub catchpoint_processed_accounts: Option, + /// The number of accounts from the current catchpoint that have been verified so far as part of the catchup + pub catchpoint_verified_accounts: Option, + /// The total number of key-values (KVs) included in the current catchpoint + pub catchpoint_total_kvs: Option, + /// The number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup + pub catchpoint_processed_kvs: Option, + /// The number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup + pub catchpoint_verified_kvs: Option, + /// The total number of blocks that are required to complete the current catchpoint catchup + pub catchpoint_total_blocks: Option, + /// The number of blocks that have already been obtained by the node as part of the catchup + pub catchpoint_acquired_blocks: Option, + /// Upgrade delay + pub upgrade_delay: Option, + /// This node's upgrade vote + pub upgrade_node_vote: Option, + /// Yes votes required for consensus upgrade + pub upgrade_votes_required: Option, + /// Total votes cast for consensus upgrade + pub upgrade_votes: Option, + /// Yes votes cast for consensus upgrade + pub upgrade_yes_votes: Option, + /// No votes cast for consensus upgrade + pub upgrade_no_votes: Option, + /// Next protocol round + pub upgrade_next_protocol_vote_before: Option, + /// Total voting rounds for current upgrade + pub upgrade_vote_rounds: Option, +} + +impl From for WaitForBlock { + fn from(rust_struct: RustWaitForBlock) -> Self { + Self { + catchup_time: rust_struct.catchup_time, + last_round: rust_struct.last_round, + last_version: rust_struct.last_version, + next_version: rust_struct.next_version, + next_version_round: rust_struct.next_version_round, + next_version_supported: rust_struct.next_version_supported, + stopped_at_unsupported_round: rust_struct.stopped_at_unsupported_round, + time_since_last_round: rust_struct.time_since_last_round, + last_catchpoint: rust_struct.last_catchpoint, + catchpoint: rust_struct.catchpoint, + catchpoint_total_accounts: rust_struct.catchpoint_total_accounts, + catchpoint_processed_accounts: rust_struct.catchpoint_processed_accounts, + catchpoint_verified_accounts: rust_struct.catchpoint_verified_accounts, + catchpoint_total_kvs: rust_struct.catchpoint_total_kvs, + catchpoint_processed_kvs: rust_struct.catchpoint_processed_kvs, + catchpoint_verified_kvs: rust_struct.catchpoint_verified_kvs, + catchpoint_total_blocks: rust_struct.catchpoint_total_blocks, + catchpoint_acquired_blocks: rust_struct.catchpoint_acquired_blocks, + upgrade_delay: rust_struct.upgrade_delay, + upgrade_node_vote: rust_struct.upgrade_node_vote, + upgrade_votes_required: rust_struct.upgrade_votes_required, + upgrade_votes: rust_struct.upgrade_votes, + upgrade_yes_votes: rust_struct.upgrade_yes_votes, + upgrade_no_votes: rust_struct.upgrade_no_votes, + upgrade_next_protocol_vote_before: rust_struct.upgrade_next_protocol_vote_before, + upgrade_vote_rounds: rust_struct.upgrade_vote_rounds, + } + } +} + +impl From for RustWaitForBlock { + fn from(ffi_struct: WaitForBlock) -> Self { + Self { + catchup_time: ffi_struct.catchup_time, + last_round: ffi_struct.last_round, + last_version: ffi_struct.last_version, + next_version: ffi_struct.next_version, + next_version_round: ffi_struct.next_version_round, + next_version_supported: ffi_struct.next_version_supported, + stopped_at_unsupported_round: ffi_struct.stopped_at_unsupported_round, + time_since_last_round: ffi_struct.time_since_last_round, + last_catchpoint: ffi_struct.last_catchpoint, + catchpoint: ffi_struct.catchpoint, + catchpoint_total_accounts: ffi_struct.catchpoint_total_accounts, + catchpoint_processed_accounts: ffi_struct.catchpoint_processed_accounts, + catchpoint_verified_accounts: ffi_struct.catchpoint_verified_accounts, + catchpoint_total_kvs: ffi_struct.catchpoint_total_kvs, + catchpoint_processed_kvs: ffi_struct.catchpoint_processed_kvs, + catchpoint_verified_kvs: ffi_struct.catchpoint_verified_kvs, + catchpoint_total_blocks: ffi_struct.catchpoint_total_blocks, + catchpoint_acquired_blocks: ffi_struct.catchpoint_acquired_blocks, + upgrade_delay: ffi_struct.upgrade_delay, + upgrade_node_vote: ffi_struct.upgrade_node_vote, + upgrade_votes_required: ffi_struct.upgrade_votes_required, + upgrade_votes: ffi_struct.upgrade_votes, + upgrade_yes_votes: ffi_struct.upgrade_yes_votes, + upgrade_no_votes: ffi_struct.upgrade_no_votes, + upgrade_next_protocol_vote_before: ffi_struct.upgrade_next_protocol_vote_before, + upgrade_vote_rounds: ffi_struct.upgrade_vote_rounds, + } + } +} diff --git a/crates/algokit_utils/src/transactions/composer.rs b/crates/algokit_utils/src/transactions/composer.rs index 78713bbd0..6de1fdfa3 100644 --- a/crates/algokit_utils/src/transactions/composer.rs +++ b/crates/algokit_utils/src/transactions/composer.rs @@ -2149,7 +2149,7 @@ impl TransactionComposer { Ok(self.signed_group.as_ref().unwrap()) } - async fn wait_for_confirmation( + pub async fn wait_for_confirmation( &self, tx_id: &str, max_rounds_to_wait: u32, diff --git a/crates/algokit_utils_ffi/Cargo.toml b/crates/algokit_utils_ffi/Cargo.toml index 69d4899a0..be44fc5bb 100644 --- a/crates/algokit_utils_ffi/Cargo.toml +++ b/crates/algokit_utils_ffi/Cargo.toml @@ -8,6 +8,7 @@ crate-type = ["lib", "cdylib", "staticlib"] [dependencies] algod_client = { version = "0.0.1", path = "../algod_client", default-features = false } +algod_client_ffi = { version = "0.0.1", path = "../algod_client_ffi" } algokit_abi = { version = "0.1.0", path = "../algokit_abi" } algokit_http_client = { version = "0.1.0", path = "../algokit_http_client", features = ["ffi_uniffi"], default-features = false } algokit_transact = { version = "0.1.0", path = "../algokit_transact" } diff --git a/crates/algokit_utils_ffi/src/clients/algod_client.rs b/crates/algokit_utils_ffi/src/clients/algod_client.rs deleted file mode 100644 index 95da5afcd..000000000 --- a/crates/algokit_utils_ffi/src/clients/algod_client.rs +++ /dev/null @@ -1,37 +0,0 @@ -use crate::transactions::common::UtilsError; -use async_trait::async_trait; - -#[derive(uniffi::Record)] -pub struct AccountInfo { - pub balance: u64, - pub min_balance: u64, - pub created_apps: Vec, - pub created_assets: Vec, -} - -#[derive(uniffi::Record)] -pub struct TransactionInfo { - pub tx_id: String, - pub confirmed_round: Option, - pub asset_id: Option, - pub app_id: Option, -} - -#[derive(uniffi::Record)] -pub struct SuggestedParams { - pub fee: u64, - pub first_valid_round: u64, - pub last_valid_round: u64, - pub genesis_hash: Vec, - pub genesis_id: String, -} - -#[uniffi::export(with_foreign)] -#[async_trait] -pub trait AlgodClientTrait: Send + Sync { - async fn send_transaction(&self, txn: Vec) -> Result; - async fn get_account_info(&self, address: String) -> Result; - async fn get_transaction_info(&self, tx_id: String) -> Result; - async fn wait_for_confirmation(&self, tx_id: String) -> Result; - async fn get_suggested_params(&self) -> Result; -} diff --git a/crates/algokit_utils_ffi/src/clients/mod.rs b/crates/algokit_utils_ffi/src/clients/mod.rs deleted file mode 100644 index f9b189e3e..000000000 --- a/crates/algokit_utils_ffi/src/clients/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod algod_client; diff --git a/crates/algokit_utils_ffi/src/lib.rs b/crates/algokit_utils_ffi/src/lib.rs index abbc78765..47414b156 100644 --- a/crates/algokit_utils_ffi/src/lib.rs +++ b/crates/algokit_utils_ffi/src/lib.rs @@ -1,5 +1,4 @@ pub mod abi; -pub mod clients; // TODO: put tests behind a testing feature flag pub mod tests; pub mod transactions; diff --git a/crates/algokit_utils_ffi/src/tests/asset_freeze_tests.rs b/crates/algokit_utils_ffi/src/tests/asset_freeze_tests.rs index c405e0804..07faecfdf 100644 --- a/crates/algokit_utils_ffi/src/tests/asset_freeze_tests.rs +++ b/crates/algokit_utils_ffi/src/tests/asset_freeze_tests.rs @@ -1,5 +1,4 @@ use crate::{ - clients::algod_client::AlgodClientTrait, tests::fixtures::{TestAccount, TestFixture}, transactions::{ asset_freeze::{AssetFreezeParams, AssetUnfreezeParams}, @@ -8,6 +7,7 @@ use crate::{ composer::ComposerFactory, }, }; +use algod_client_ffi::apis::client::AlgodClientTrait; use std::sync::Arc; use std::time::Instant; @@ -150,7 +150,7 @@ async fn run_asset_freeze_and_unfreeze_test( }; let opt_in_composer = fixture.composer_factory.create_composer(); - opt_in_composer.add_asset_opt_in(opt_in_params).await?; + opt_in_composer.add_asset_opt_in(opt_in_params)?; opt_in_composer.build().await?; opt_in_composer.send().await?; @@ -174,9 +174,7 @@ async fn run_asset_freeze_and_unfreeze_test( }; let transfer_composer = fixture.composer_factory.create_composer(); - transfer_composer - .add_asset_transfer(transfer_params) - .await?; + transfer_composer.add_asset_transfer(transfer_params)?; transfer_composer.build().await?; transfer_composer.send().await?; @@ -201,7 +199,7 @@ async fn run_asset_freeze_and_unfreeze_test( }; let freeze_composer = fixture.composer_factory.create_composer(); - freeze_composer.add_asset_freeze(freeze_params).await?; + freeze_composer.add_asset_freeze(freeze_params)?; freeze_composer.build().await?; freeze_composer.send().await?; @@ -224,9 +222,7 @@ async fn run_asset_freeze_and_unfreeze_test( }; let frozen_transfer_composer = fixture.composer_factory.create_composer(); - frozen_transfer_composer - .add_asset_transfer(transfer_from_frozen_params) - .await?; + frozen_transfer_composer.add_asset_transfer(transfer_from_frozen_params)?; frozen_transfer_composer.build().await?; // This should fail because account is frozen @@ -271,9 +267,7 @@ async fn run_asset_freeze_and_unfreeze_test( }; let unfreeze_composer = fixture.composer_factory.create_composer(); - unfreeze_composer - .add_asset_unfreeze(unfreeze_params) - .await?; + unfreeze_composer.add_asset_unfreeze(unfreeze_params)?; unfreeze_composer.build().await?; unfreeze_composer.send().await?; @@ -296,9 +290,7 @@ async fn run_asset_freeze_and_unfreeze_test( }; let unfrozen_transfer_composer = fixture.composer_factory.create_composer(); - unfrozen_transfer_composer - .add_asset_transfer(transfer_after_unfreeze_params) - .await?; + unfrozen_transfer_composer.add_asset_transfer(transfer_after_unfreeze_params)?; unfrozen_transfer_composer.build().await?; unfrozen_transfer_composer.send().await?; diff --git a/crates/algokit_utils_ffi/src/tests/fixtures/test_fixture.rs b/crates/algokit_utils_ffi/src/tests/fixtures/test_fixture.rs index 616ac6dd0..de20f310b 100644 --- a/crates/algokit_utils_ffi/src/tests/fixtures/test_fixture.rs +++ b/crates/algokit_utils_ffi/src/tests/fixtures/test_fixture.rs @@ -1,13 +1,11 @@ use super::{localnet, test_account::TestAccount}; -use crate::{ - clients::algod_client::AlgodClientTrait, - transactions::{ - asset_config::AssetCreateParams, - common::{TransactionSignerGetter, UtilsError}, - composer::ComposerFactory, - payment::PaymentParams, - }, +use crate::transactions::{ + asset_config::AssetCreateParams, + common::{TransactionSignerGetter, UtilsError}, + composer::ComposerFactory, + payment::PaymentParams, }; +use algod_client_ffi::apis::client::AlgodClientTrait; use std::sync::{Arc, Mutex}; /// Test fixture that provides high-level test operations using foreign traits @@ -95,16 +93,17 @@ impl TestFixture { }; // Add payment to composer - composer.add_payment(payment_params).await?; + composer.add_payment(payment_params)?; // Build and send transaction composer.build().await?; - let tx_ids = composer.send().await?; + let result = composer.send().await?; // Return first transaction ID - tx_ids + result + .results .first() - .cloned() + .map(|r| r.transaction_id.clone()) .ok_or_else(|| UtilsError::UtilsError { message: "No transaction ID returned".to_string(), }) @@ -149,21 +148,22 @@ impl TestFixture { }; // Add asset create to composer - composer.add_asset_create(asset_params).await?; + composer.add_asset_create(asset_params)?; // Build and send composer.build().await?; - let tx_ids = composer.send().await?; + let result = composer.send().await?; + + let tx_id = result + .results + .first() + .map(|r| r.transaction_id.clone()) + .ok_or_else(|| UtilsError::UtilsError { + message: "No transaction ID returned".to_string(), + })?; // Wait for confirmation to get asset ID - let tx_id = tx_ids.first().ok_or_else(|| UtilsError::UtilsError { - message: "No transaction ID returned".to_string(), - })?; - - let info = self - .algod_client - .wait_for_confirmation(tx_id.clone()) - .await?; + let info = composer.wait_for_confirmation(tx_id.clone(), 3).await?; info.asset_id.ok_or_else(|| UtilsError::UtilsError { message: "No asset ID in transaction result".to_string(), diff --git a/crates/algokit_utils_ffi/src/transactions/app_call.rs b/crates/algokit_utils_ffi/src/transactions/app_call.rs index 65f38fd6c..cb7032927 100644 --- a/crates/algokit_utils_ffi/src/transactions/app_call.rs +++ b/crates/algokit_utils_ffi/src/transactions/app_call.rs @@ -13,7 +13,7 @@ use crate::create_transaction_params; use algokit_abi::{ ABIMethod as RustABIMethod, ABIMethodArg as RustABIMethodArg, ABIMethodArgType as RustABIMethodArgType, ABIReferenceType as RustABIReferenceType, - ABITransactionType as RustABITransactionType, + ABIReturn as RustABIReturn, ABITransactionType as RustABITransactionType, abi_method::ABIReferenceValue as RustABIReferenceValue, }; @@ -217,6 +217,37 @@ impl From for ABIMethod { } } +#[derive(uniffi::Record)] +pub struct ABIReturn { + /// The method that was called. + pub method: ABIMethod, + /// The raw return value as bytes. + /// + /// This value will be empty if the method does not return a value (return type "void") + pub raw_return_value: Vec, + /// The parsed ABI return value. + /// + /// This value will be undefined if decoding failed or the method does not return a value (return type "void") + pub return_value: Option>, + /// Any error that occurred during decoding, or undefined if decoding was successful + pub decode_error: Option, +} + +impl From for ABIReturn { + fn from(value: RustABIReturn) -> Self { + ABIReturn { + method: value.method.into(), + raw_return_value: value.raw_return_value, + return_value: value + .return_value + .map(|rv| Arc::new(ABIValue { rust_value: rv })), + decode_error: value.decode_error.map(|e| UtilsError::UtilsError { + message: e.to_string(), + }), + } + } +} + #[derive(uniffi::Enum, Debug)] pub enum ABIReferenceValue { /// The address to an Algorand account. diff --git a/crates/algokit_utils_ffi/src/transactions/common.rs b/crates/algokit_utils_ffi/src/transactions/common.rs index ce46d46ab..7864365af 100644 --- a/crates/algokit_utils_ffi/src/transactions/common.rs +++ b/crates/algokit_utils_ffi/src/transactions/common.rs @@ -19,6 +19,14 @@ pub enum UtilsError { UtilsError { message: String }, } +impl From for UtilsError { + fn from(e: uniffi::UnexpectedUniFFICallbackError) -> Self { + UtilsError::UtilsError { + message: format!("Unexpected UniFFI callback error: {}", e), + } + } +} + #[uniffi::export(with_foreign)] #[async_trait] pub trait TransactionSigner: Send + Sync { diff --git a/crates/algokit_utils_ffi/src/transactions/composer.rs b/crates/algokit_utils_ffi/src/transactions/composer.rs index 16692e2f3..c4fa8d040 100644 --- a/crates/algokit_utils_ffi/src/transactions/composer.rs +++ b/crates/algokit_utils_ffi/src/transactions/composer.rs @@ -22,37 +22,54 @@ use crate::transactions::{ // External crate imports // algod_client -use algod_client::AlgodClient as RustAlgodClient; - -// algokit_http_client -use algokit_http_client::HttpClient; +use algod_client_ffi::{AlgodClient, models::PendingTransactionResponse}; // algokit_utils use algokit_utils::transactions::{ - TransactionComposerParams, composer::TransactionComposer as RustComposer, + TransactionComposerParams, TransactionResult as RustTransactionResult, + composer::TransactionComposer as RustComposer, }; -#[derive(uniffi::Object)] -pub struct AlgodClient { - inner_algod_client: Mutex, +use algokit_transact_ffi::Transaction; + +use super::app_call::ABIReturn; + +#[derive(uniffi::Record)] +pub struct TransactionResult { + pub transaction: Transaction, + pub transaction_id: String, + pub confirmation: PendingTransactionResponse, + pub abi_return: Option, } -#[uniffi::export] -impl AlgodClient { - #[uniffi::constructor] - pub fn new(http_client: Arc) -> Self { - let algod_client = RustAlgodClient::new(http_client); - AlgodClient { - inner_algod_client: Mutex::new(algod_client), +impl From for TransactionResult { + fn from(rust_struct: RustTransactionResult) -> Self { + Self { + transaction: rust_struct.transaction.into(), + transaction_id: rust_struct.transaction_id, + confirmation: rust_struct.confirmation.into(), + abi_return: rust_struct.abi_return.map(|r| r.into()), } } } -// NOTE: This struct is a temporary placeholder until we have a proper algod_api_ffi crate with the fully typed response #[derive(uniffi::Record)] -pub struct TempSendResponse { - pub transaction_ids: Vec, - pub app_ids: Vec>, +pub struct TransactionComposerSendResult { + pub group: Option>, + pub results: Vec, +} + +impl From + for TransactionComposerSendResult +{ + fn from( + rust_struct: algokit_utils::transactions::composer::TransactionComposerSendResult, + ) -> Self { + Self { + group: rust_struct.group.map(|g| g.to_vec()), + results: rust_struct.results.into_iter().map(|r| r.into()).collect(), + } + } } #[derive(uniffi::Object)] @@ -72,9 +89,8 @@ impl Composer { }; let rust_composer = { - let rust_algod_client = algod_client.inner_algod_client.blocking_lock(); RustComposer::new(TransactionComposerParams { - algod_client: Arc::new(rust_algod_client.clone()), + algod_client: algod_client.inner_algod_client.clone(), signer_getter: Arc::new(rust_signer_getter), composer_config: None, }) @@ -84,8 +100,12 @@ impl Composer { inner_composer: Mutex::new(rust_composer), } } +} - pub fn add_payment(&self, params: PaymentParams) -> Result<(), UtilsError> { +#[uniffi::export] +#[async_trait] +impl ComposerTrait for Composer { + fn add_payment(&self, params: PaymentParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_payment(params.try_into()?) @@ -94,29 +114,33 @@ impl Composer { }) } - pub async fn send(&self) -> Result { + async fn wait_for_confirmation( + &self, + tx_id: String, + max_rounds_to_wait: u32, + ) -> Result { + let composer = self.inner_composer.blocking_lock(); + composer + .wait_for_confirmation(&tx_id, max_rounds_to_wait) + .await + .map_err(|e| UtilsError::UtilsError { + message: e.to_string(), + }) + .map(|r| r.into()) + } + + async fn send(&self) -> Result { let mut composer = self.inner_composer.blocking_lock(); - let result = composer + composer .send(None) .await .map_err(|e| UtilsError::UtilsError { message: e.to_string(), - })?; - Ok(TempSendResponse { - transaction_ids: result - .results - .iter() - .map(|r| r.transaction_id.clone()) - .collect(), - app_ids: result - .results - .iter() - .map(|r| r.confirmation.app_id) - .collect(), - }) + }) + .map(|r| r.into()) } - pub async fn build(&self) -> Result<(), UtilsError> { + async fn build(&self) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer.build().await.map_err(|e| UtilsError::UtilsError { message: e.to_string(), @@ -125,7 +149,7 @@ impl Composer { Ok(()) } - pub fn add_asset_create(&self, params: AssetCreateParams) -> Result<(), UtilsError> { + fn add_asset_create(&self, params: AssetCreateParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_create(params.try_into()?) @@ -134,7 +158,7 @@ impl Composer { }) } - pub fn add_asset_config(&self, params: AssetConfigParams) -> Result<(), UtilsError> { + fn add_asset_config(&self, params: AssetConfigParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_config(params.try_into()?) @@ -143,7 +167,7 @@ impl Composer { }) } - pub fn add_asset_destroy(&self, params: AssetDestroyParams) -> Result<(), UtilsError> { + fn add_asset_destroy(&self, params: AssetDestroyParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_destroy(params.try_into()?) @@ -152,7 +176,7 @@ impl Composer { }) } - pub fn add_asset_freeze(&self, params: AssetFreezeParams) -> Result<(), UtilsError> { + fn add_asset_freeze(&self, params: AssetFreezeParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_freeze(params.try_into()?) @@ -161,7 +185,7 @@ impl Composer { }) } - pub fn add_asset_unfreeze(&self, params: AssetUnfreezeParams) -> Result<(), UtilsError> { + fn add_asset_unfreeze(&self, params: AssetUnfreezeParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_unfreeze(params.try_into()?) @@ -170,7 +194,7 @@ impl Composer { }) } - pub fn add_asset_transfer(&self, params: AssetTransferParams) -> Result<(), UtilsError> { + fn add_asset_transfer(&self, params: AssetTransferParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_transfer(params.try_into()?) @@ -179,7 +203,7 @@ impl Composer { }) } - pub fn add_asset_opt_in(&self, params: AssetOptInParams) -> Result<(), UtilsError> { + fn add_asset_opt_in(&self, params: AssetOptInParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_opt_in(params.try_into()?) @@ -188,7 +212,7 @@ impl Composer { }) } - pub fn add_asset_opt_out(&self, params: AssetOptOutParams) -> Result<(), UtilsError> { + fn add_asset_opt_out(&self, params: AssetOptOutParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_opt_out(params.try_into()?) @@ -197,7 +221,7 @@ impl Composer { }) } - pub fn add_asset_clawback(&self, params: AssetClawbackParams) -> Result<(), UtilsError> { + fn add_asset_clawback(&self, params: AssetClawbackParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_asset_clawback(params.try_into()?) @@ -206,7 +230,7 @@ impl Composer { }) } - pub fn add_app_create(&self, params: AppCreateParams) -> Result<(), UtilsError> { + fn add_app_create(&self, params: AppCreateParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_app_create(params.try_into()?) @@ -215,7 +239,7 @@ impl Composer { }) } - pub fn add_app_call(&self, params: AppCallParams) -> Result<(), UtilsError> { + fn add_app_call(&self, params: AppCallParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_app_call(params.try_into()?) @@ -224,7 +248,7 @@ impl Composer { }) } - pub fn add_app_update(&self, params: AppUpdateParams) -> Result<(), UtilsError> { + fn add_app_update(&self, params: AppUpdateParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_app_update(params.try_into()?) @@ -233,7 +257,7 @@ impl Composer { }) } - pub fn add_app_delete(&self, params: AppDeleteParams) -> Result<(), UtilsError> { + fn add_app_delete(&self, params: AppDeleteParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_app_delete(params.try_into()?) @@ -242,10 +266,7 @@ impl Composer { }) } - pub fn add_app_call_method_call( - &self, - params: AppCallMethodCallParams, - ) -> Result<(), UtilsError> { + fn add_app_call_method_call(&self, params: AppCallMethodCallParams) -> Result<(), UtilsError> { let mut composer = self.inner_composer.blocking_lock(); composer .add_app_call_method_call(params.try_into()?) @@ -254,7 +275,7 @@ impl Composer { }) } - pub fn add_app_create_method_call( + fn add_app_create_method_call( &self, params: AppCreateMethodCallParams, ) -> Result<(), UtilsError> { @@ -266,7 +287,7 @@ impl Composer { }) } - pub fn add_app_update_method_call( + fn add_app_update_method_call( &self, params: AppUpdateMethodCallParams, ) -> Result<(), UtilsError> { @@ -278,7 +299,7 @@ impl Composer { }) } - pub fn add_app_delete_method_call( + fn add_app_delete_method_call( &self, params: AppDeleteMethodCallParams, ) -> Result<(), UtilsError> { @@ -291,112 +312,6 @@ impl Composer { } } -// Implement ComposerTrait for Composer to keep them in sync -#[async_trait] -impl ComposerTrait for Composer { - async fn build(&self) -> Result<(), UtilsError> { - Composer::build(self).await - } - - async fn send(&self) -> Result, UtilsError> { - let response = Composer::send(self).await?; - Ok(response.transaction_ids) - } - - async fn add_payment(&self, params: super::payment::PaymentParams) -> Result<(), UtilsError> { - Composer::add_payment(self, params) - } - - async fn add_asset_create(&self, params: AssetCreateParams) -> Result<(), UtilsError> { - Composer::add_asset_create(self, params) - } - - async fn add_asset_reconfigure(&self, params: AssetConfigParams) -> Result<(), UtilsError> { - Composer::add_asset_config(self, params) - } - - async fn add_asset_destroy(&self, params: AssetDestroyParams) -> Result<(), UtilsError> { - Composer::add_asset_destroy(self, params) - } - - async fn add_asset_freeze(&self, params: AssetFreezeParams) -> Result<(), UtilsError> { - Composer::add_asset_freeze(self, params) - } - - async fn add_asset_unfreeze(&self, params: AssetUnfreezeParams) -> Result<(), UtilsError> { - Composer::add_asset_unfreeze(self, params) - } - - async fn add_asset_transfer(&self, params: AssetTransferParams) -> Result<(), UtilsError> { - Composer::add_asset_transfer(self, params) - } - - async fn add_asset_opt_in(&self, params: AssetOptInParams) -> Result<(), UtilsError> { - Composer::add_asset_opt_in(self, params) - } - - async fn add_asset_opt_out(&self, params: AssetOptOutParams) -> Result<(), UtilsError> { - Composer::add_asset_opt_out(self, params) - } - - async fn add_asset_clawback(&self, params: AssetClawbackParams) -> Result<(), UtilsError> { - Composer::add_asset_clawback(self, params) - } - - async fn add_app_create( - &self, - params: super::app_call::AppCreateParams, - ) -> Result<(), UtilsError> { - Composer::add_app_create(self, params) - } - - async fn add_app_call(&self, params: super::app_call::AppCallParams) -> Result<(), UtilsError> { - Composer::add_app_call(self, params) - } - - async fn add_app_update( - &self, - params: super::app_call::AppUpdateParams, - ) -> Result<(), UtilsError> { - Composer::add_app_update(self, params) - } - - async fn add_app_delete( - &self, - params: super::app_call::AppDeleteParams, - ) -> Result<(), UtilsError> { - Composer::add_app_delete(self, params) - } - - async fn add_app_call_method_call( - &self, - params: super::app_call::AppCallMethodCallParams, - ) -> Result<(), UtilsError> { - Composer::add_app_call_method_call(self, params) - } - - async fn add_app_create_method_call( - &self, - params: super::app_call::AppCreateMethodCallParams, - ) -> Result<(), UtilsError> { - Composer::add_app_create_method_call(self, params) - } - - async fn add_app_update_method_call( - &self, - params: super::app_call::AppUpdateMethodCallParams, - ) -> Result<(), UtilsError> { - Composer::add_app_update_method_call(self, params) - } - - async fn add_app_delete_method_call( - &self, - params: super::app_call::AppDeleteMethodCallParams, - ) -> Result<(), UtilsError> { - Composer::add_app_delete_method_call(self, params) - } -} - // // Foreign trait for target language testing // This trait is implemented by Python to enable async test orchestration @@ -409,61 +324,57 @@ impl ComposerTrait for Composer { #[async_trait] pub trait ComposerTrait: Send + Sync { async fn build(&self) -> Result<(), UtilsError>; - async fn send(&self) -> Result, UtilsError>; + async fn send(&self) -> Result; + async fn wait_for_confirmation( + &self, + tx_id: String, + max_rounds_to_wait: u32, + ) -> Result; - async fn add_payment(&self, params: super::payment::PaymentParams) -> Result<(), UtilsError>; + fn add_payment(&self, params: super::payment::PaymentParams) -> Result<(), UtilsError>; - async fn add_asset_create(&self, params: AssetCreateParams) -> Result<(), UtilsError>; + fn add_asset_create(&self, params: AssetCreateParams) -> Result<(), UtilsError>; - async fn add_asset_reconfigure(&self, params: AssetConfigParams) -> Result<(), UtilsError>; + fn add_asset_config(&self, params: AssetConfigParams) -> Result<(), UtilsError>; - async fn add_asset_destroy(&self, params: AssetDestroyParams) -> Result<(), UtilsError>; + fn add_asset_destroy(&self, params: AssetDestroyParams) -> Result<(), UtilsError>; - async fn add_asset_freeze(&self, params: AssetFreezeParams) -> Result<(), UtilsError>; + fn add_asset_freeze(&self, params: AssetFreezeParams) -> Result<(), UtilsError>; - async fn add_asset_unfreeze(&self, params: AssetUnfreezeParams) -> Result<(), UtilsError>; + fn add_asset_unfreeze(&self, params: AssetUnfreezeParams) -> Result<(), UtilsError>; - async fn add_asset_transfer(&self, params: AssetTransferParams) -> Result<(), UtilsError>; + fn add_asset_transfer(&self, params: AssetTransferParams) -> Result<(), UtilsError>; - async fn add_asset_opt_in(&self, params: AssetOptInParams) -> Result<(), UtilsError>; + fn add_asset_opt_in(&self, params: AssetOptInParams) -> Result<(), UtilsError>; - async fn add_asset_opt_out(&self, params: AssetOptOutParams) -> Result<(), UtilsError>; + fn add_asset_opt_out(&self, params: AssetOptOutParams) -> Result<(), UtilsError>; - async fn add_asset_clawback(&self, params: AssetClawbackParams) -> Result<(), UtilsError>; + fn add_asset_clawback(&self, params: AssetClawbackParams) -> Result<(), UtilsError>; - async fn add_app_create( - &self, - params: super::app_call::AppCreateParams, - ) -> Result<(), UtilsError>; + fn add_app_create(&self, params: super::app_call::AppCreateParams) -> Result<(), UtilsError>; - async fn add_app_call(&self, params: super::app_call::AppCallParams) -> Result<(), UtilsError>; + fn add_app_call(&self, params: super::app_call::AppCallParams) -> Result<(), UtilsError>; - async fn add_app_update( - &self, - params: super::app_call::AppUpdateParams, - ) -> Result<(), UtilsError>; + fn add_app_update(&self, params: super::app_call::AppUpdateParams) -> Result<(), UtilsError>; - async fn add_app_delete( - &self, - params: super::app_call::AppDeleteParams, - ) -> Result<(), UtilsError>; + fn add_app_delete(&self, params: super::app_call::AppDeleteParams) -> Result<(), UtilsError>; - async fn add_app_call_method_call( + fn add_app_call_method_call( &self, params: super::app_call::AppCallMethodCallParams, ) -> Result<(), UtilsError>; - async fn add_app_create_method_call( + fn add_app_create_method_call( &self, params: super::app_call::AppCreateMethodCallParams, ) -> Result<(), UtilsError>; - async fn add_app_update_method_call( + fn add_app_update_method_call( &self, params: super::app_call::AppUpdateMethodCallParams, ) -> Result<(), UtilsError>; - async fn add_app_delete_method_call( + fn add_app_delete_method_call( &self, params: super::app_call::AppDeleteMethodCallParams, ) -> Result<(), UtilsError>; diff --git a/crates/indexer_client/Cargo.toml b/crates/indexer_client/Cargo.toml index feac837bd..e62ff14fc 100644 --- a/crates/indexer_client/Cargo.toml +++ b/crates/indexer_client/Cargo.toml @@ -9,9 +9,13 @@ edition = "2024" [features] default = ["default_client"] default_client = ["algokit_http_client/default_client"] -ffi_uniffi = ["dep:uniffi", "algokit_http_client/ffi_uniffi", "dep:algokit_transact_ffi"] [dependencies] +serde_json = "^1.0" + +# Error handling +snafu = { workspace = true } + # Core serialization serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = [ @@ -19,26 +23,17 @@ serde_with = { version = "^3.8", default-features = false, features = [ "std", "macros", ] } -serde_json = "^1.0" serde_repr = "^0.1" serde_bytes = "^0.11" # HTTP client -algokit_http_client = { path = "../algokit_http_client", features = ["ffi_uniffi"] } +algokit_http_client = { path = "../algokit_http_client" } url = "^2.5" -# Uniffi for FFI bindings -uniffi = { workspace = true, optional = true } -algokit_transact_ffi = { optional = true, version = "0.1.0", path = "../algokit_transact_ffi" } - - -# Error handling -snafu = { workspace = true } # Utilities base64 = "^0.22" uuid = { version = "^1.0", features = ["v4"] } - [dev-dependencies] tokio = { version = "1.0", features = ["full"] } tokio-test = "^0.4" \ No newline at end of file diff --git a/crates/indexer_client/src/apis/client.rs b/crates/indexer_client/src/apis/client.rs index a04c83e9e..349d534f3 100644 --- a/crates/indexer_client/src/apis/client.rs +++ b/crates/indexer_client/src/apis/client.rs @@ -12,7 +12,7 @@ use super::Error; use super::parameter_enums::*; use crate::models::{ - Block, Box, HealthCheck, LookupAccountAppLocalStates, LookupAccountAssets, LookupAccountById, + Block, HealthCheck, LookupAccountAppLocalStates, LookupAccountAssets, LookupAccountById, LookupAccountCreatedApplications, LookupAccountCreatedAssets, LookupAccountTransactions, LookupApplicationById, LookupApplicationLogsById, LookupAssetBalances, LookupAssetById, LookupAssetTransactions, LookupTransaction, SearchForAccounts, SearchForApplicationBoxes, @@ -28,22 +28,18 @@ use std::sync::Arc; /// It wraps the lower-level endpoint functions with a more ergonomic interface. /// All methods return a unified `Error` type that can represent any endpoint error. #[derive(Clone)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Object))] pub struct IndexerClient { http_client: Arc, } -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] impl IndexerClient { /// Create a new IndexerClient with a custom http client. - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn new(http_client: Arc) -> Self { Self { http_client } } /// Create a new IndexerClient for Algorand TestNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn testnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new( "https://testnet-idx.4160.nodely.dev", @@ -53,7 +49,6 @@ impl IndexerClient { /// Create a new IndexerClient for Algorand MainNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn mainnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new( "https://mainnet-idx.4160.nodely.dev", @@ -63,7 +58,6 @@ impl IndexerClient { /// Create a new IndexerClient for a local localnet environment. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn localnet() -> Self { let http_client = Arc::new( DefaultHttpClient::with_header( @@ -75,106 +69,13 @@ impl IndexerClient { ); Self::new(http_client) } +} +impl IndexerClient { /// Returns 200 if healthy. pub async fn make_health_check(&self) -> Result { - let result = super::make_health_check::make_health_check(self.http_client.as_ref()).await; - - result - } - - /// Lookup account information. - pub async fn lookup_account_by_id( - &self, - account_id: &str, - round: Option, - include_all: Option, - exclude: Option>, - ) -> Result { - let result = super::lookup_account_by_id::lookup_account_by_id( - self.http_client.as_ref(), - account_id, - round, - include_all, - exclude, - ) - .await; - - result - } - - /// Lookup application. - pub async fn lookup_application_by_id( - &self, - application_id: u64, - include_all: Option, - ) -> Result { - let result = super::lookup_application_by_id::lookup_application_by_id( - self.http_client.as_ref(), - application_id, - include_all, - ) - .await; - - result - } - - /// Get box information for a given application. - pub async fn lookup_application_box_by_id_and_name( - &self, - application_id: u64, - name: &str, - ) -> Result { - let result = - super::lookup_application_box_by_id_and_name::lookup_application_box_by_id_and_name( - self.http_client.as_ref(), - application_id, - name, - ) - .await; - - result - } - - /// Lookup asset information. - pub async fn lookup_asset_by_id( - &self, - asset_id: u64, - include_all: Option, - ) -> Result { - let result = super::lookup_asset_by_id::lookup_asset_by_id( - self.http_client.as_ref(), - asset_id, - include_all, - ) - .await; - - result - } - - /// Lookup block. - pub async fn lookup_block( - &self, - round_number: u64, - header_only: Option, - ) -> Result { - let result = - super::lookup_block::lookup_block(self.http_client.as_ref(), round_number, header_only) - .await; - - result - } - - /// Lookup a single transaction. - pub async fn lookup_transaction(&self, txid: &str) -> Result { - let result = - super::lookup_transaction::lookup_transaction(self.http_client.as_ref(), txid).await; - - result + super::make_health_check::make_health_check(self.http_client.as_ref()).await } -} -#[cfg(not(feature = "ffi_uniffi"))] -impl IndexerClient { /// Search for accounts. pub async fn search_for_accounts( &self, @@ -190,7 +91,7 @@ impl IndexerClient { application_id: Option, online_only: Option, ) -> Result { - let result = super::search_for_accounts::search_for_accounts( + super::search_for_accounts::search_for_accounts( self.http_client.as_ref(), asset_id, limit, @@ -204,9 +105,25 @@ impl IndexerClient { application_id, online_only, ) - .await; + .await + } - result + /// Lookup account information. + pub async fn lookup_account_by_id( + &self, + account_id: &str, + round: Option, + include_all: Option, + exclude: Option>, + ) -> Result { + super::lookup_account_by_id::lookup_account_by_id( + self.http_client.as_ref(), + account_id, + round, + include_all, + exclude, + ) + .await } /// Lookup an account's asset holdings, optionally for a specific ID. @@ -218,7 +135,7 @@ impl IndexerClient { limit: Option, next: Option<&str>, ) -> Result { - let result = super::lookup_account_assets::lookup_account_assets( + super::lookup_account_assets::lookup_account_assets( self.http_client.as_ref(), account_id, asset_id, @@ -226,9 +143,7 @@ impl IndexerClient { limit, next, ) - .await; - - result + .await } /// Lookup an account's created asset parameters, optionally for a specific ID. @@ -240,7 +155,7 @@ impl IndexerClient { limit: Option, next: Option<&str>, ) -> Result { - let result = super::lookup_account_created_assets::lookup_account_created_assets( + super::lookup_account_created_assets::lookup_account_created_assets( self.http_client.as_ref(), account_id, asset_id, @@ -248,9 +163,7 @@ impl IndexerClient { limit, next, ) - .await; - - result + .await } /// Lookup an account's asset holdings, optionally for a specific ID. @@ -262,7 +175,7 @@ impl IndexerClient { limit: Option, next: Option<&str>, ) -> Result { - let result = super::lookup_account_app_local_states::lookup_account_app_local_states( + super::lookup_account_app_local_states::lookup_account_app_local_states( self.http_client.as_ref(), account_id, application_id, @@ -270,9 +183,7 @@ impl IndexerClient { limit, next, ) - .await; - - result + .await } /// Lookup an account's created application parameters, optionally for a specific ID. @@ -284,18 +195,15 @@ impl IndexerClient { limit: Option, next: Option<&str>, ) -> Result { - let result = - super::lookup_account_created_applications::lookup_account_created_applications( - self.http_client.as_ref(), - account_id, - application_id, - include_all, - limit, - next, - ) - .await; - - result + super::lookup_account_created_applications::lookup_account_created_applications( + self.http_client.as_ref(), + account_id, + application_id, + include_all, + limit, + next, + ) + .await } /// Lookup account transactions. Transactions are returned newest to oldest. @@ -318,7 +226,7 @@ impl IndexerClient { account_id: &str, rekey_to: Option, ) -> Result { - let result = super::lookup_account_transactions::lookup_account_transactions( + super::lookup_account_transactions::lookup_account_transactions( self.http_client.as_ref(), limit, next, @@ -337,9 +245,7 @@ impl IndexerClient { account_id, rekey_to, ) - .await; - - result + .await } /// Search for applications @@ -351,7 +257,7 @@ impl IndexerClient { limit: Option, next: Option<&str>, ) -> Result { - let result = super::search_for_applications::search_for_applications( + super::search_for_applications::search_for_applications( self.http_client.as_ref(), application_id, creator, @@ -359,9 +265,21 @@ impl IndexerClient { limit, next, ) - .await; + .await + } - result + /// Lookup application. + pub async fn lookup_application_by_id( + &self, + application_id: u64, + include_all: Option, + ) -> Result { + super::lookup_application_by_id::lookup_application_by_id( + self.http_client.as_ref(), + application_id, + include_all, + ) + .await } /// Get box names for a given application. @@ -371,15 +289,27 @@ impl IndexerClient { limit: Option, next: Option<&str>, ) -> Result { - let result = super::search_for_application_boxes::search_for_application_boxes( + super::search_for_application_boxes::search_for_application_boxes( self.http_client.as_ref(), application_id, limit, next, ) - .await; + .await + } - result + /// Get box information for a given application. + pub async fn lookup_application_box_by_id_and_name( + &self, + application_id: u64, + name: &str, + ) -> Result { + super::lookup_application_box_by_id_and_name::lookup_application_box_by_id_and_name( + self.http_client.as_ref(), + application_id, + name, + ) + .await } /// Lookup application logs. @@ -393,7 +323,7 @@ impl IndexerClient { max_round: Option, sender_address: Option<&str>, ) -> Result { - let result = super::lookup_application_logs_by_id::lookup_application_logs_by_id( + super::lookup_application_logs_by_id::lookup_application_logs_by_id( self.http_client.as_ref(), application_id, limit, @@ -403,9 +333,7 @@ impl IndexerClient { max_round, sender_address, ) - .await; - - result + .await } /// Search for assets. @@ -419,7 +347,7 @@ impl IndexerClient { unit: Option<&str>, asset_id: Option, ) -> Result { - let result = super::search_for_assets::search_for_assets( + super::search_for_assets::search_for_assets( self.http_client.as_ref(), include_all, limit, @@ -429,9 +357,21 @@ impl IndexerClient { unit, asset_id, ) - .await; + .await + } - result + /// Lookup asset information. + pub async fn lookup_asset_by_id( + &self, + asset_id: u64, + include_all: Option, + ) -> Result { + super::lookup_asset_by_id::lookup_asset_by_id( + self.http_client.as_ref(), + asset_id, + include_all, + ) + .await } /// Lookup the list of accounts who hold this asset @@ -444,7 +384,7 @@ impl IndexerClient { currency_less_than: Option, asset_id: u64, ) -> Result { - let result = super::lookup_asset_balances::lookup_asset_balances( + super::lookup_asset_balances::lookup_asset_balances( self.http_client.as_ref(), include_all, limit, @@ -453,9 +393,7 @@ impl IndexerClient { currency_less_than, asset_id, ) - .await; - - result + .await } /// Lookup transactions for an asset. Transactions are returned oldest to newest. @@ -480,7 +418,7 @@ impl IndexerClient { asset_id: u64, rekey_to: Option, ) -> Result { - let result = super::lookup_asset_transactions::lookup_asset_transactions( + super::lookup_asset_transactions::lookup_asset_transactions( self.http_client.as_ref(), limit, next, @@ -501,9 +439,7 @@ impl IndexerClient { asset_id, rekey_to, ) - .await; - - result + .await } /// Search for block headers. Block headers are returned in ascending round order. Transactions are not included in the output. @@ -519,7 +455,7 @@ impl IndexerClient { expired: Option>, absent: Option>, ) -> Result { - let result = super::search_for_block_headers::search_for_block_headers( + super::search_for_block_headers::search_for_block_headers( self.http_client.as_ref(), limit, next, @@ -531,9 +467,22 @@ impl IndexerClient { expired, absent, ) - .await; + .await + } - result + /// Lookup block. + pub async fn lookup_block( + &self, + round_number: u64, + header_only: Option, + ) -> Result { + super::lookup_block::lookup_block(self.http_client.as_ref(), round_number, header_only) + .await + } + + /// Lookup a single transaction. + pub async fn lookup_transaction(&self, txid: &str) -> Result { + super::lookup_transaction::lookup_transaction(self.http_client.as_ref(), txid).await } /// Search for transactions. Transactions are returned oldest to newest unless the address parameter is used, in which case results are returned newest to oldest. @@ -560,7 +509,7 @@ impl IndexerClient { rekey_to: Option, application_id: Option, ) -> Result { - let result = super::search_for_transactions::search_for_transactions( + super::search_for_transactions::search_for_transactions( self.http_client.as_ref(), limit, next, @@ -583,425 +532,6 @@ impl IndexerClient { rekey_to, application_id, ) - .await; - - result - } -} - -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] -#[cfg(feature = "ffi_uniffi")] -impl IndexerClient { - /// Search for accounts. - pub async fn search_for_accounts( - &self, - asset_id: Option, - limit: Option, - next: Option, - currency_greater_than: Option, - include_all: Option, - exclude: Option>, - currency_less_than: Option, - auth_addr: Option, - round: Option, - application_id: Option, - online_only: Option, - ) -> Result { - let result = super::search_for_accounts::search_for_accounts( - self.http_client.as_ref(), - asset_id, - limit, - next.as_deref(), - currency_greater_than, - include_all, - exclude, - currency_less_than, - auth_addr.as_deref(), - round, - application_id, - online_only, - ) - .await; - - result - } - - /// Lookup an account's asset holdings, optionally for a specific ID. - pub async fn lookup_account_assets( - &self, - account_id: &str, - asset_id: Option, - include_all: Option, - limit: Option, - next: Option, - ) -> Result { - let result = super::lookup_account_assets::lookup_account_assets( - self.http_client.as_ref(), - account_id, - asset_id, - include_all, - limit, - next.as_deref(), - ) - .await; - - result - } - - /// Lookup an account's created asset parameters, optionally for a specific ID. - pub async fn lookup_account_created_assets( - &self, - account_id: &str, - asset_id: Option, - include_all: Option, - limit: Option, - next: Option, - ) -> Result { - let result = super::lookup_account_created_assets::lookup_account_created_assets( - self.http_client.as_ref(), - account_id, - asset_id, - include_all, - limit, - next.as_deref(), - ) - .await; - - result - } - - /// Lookup an account's asset holdings, optionally for a specific ID. - pub async fn lookup_account_app_local_states( - &self, - account_id: &str, - application_id: Option, - include_all: Option, - limit: Option, - next: Option, - ) -> Result { - let result = super::lookup_account_app_local_states::lookup_account_app_local_states( - self.http_client.as_ref(), - account_id, - application_id, - include_all, - limit, - next.as_deref(), - ) - .await; - - result - } - - /// Lookup an account's created application parameters, optionally for a specific ID. - pub async fn lookup_account_created_applications( - &self, - account_id: &str, - application_id: Option, - include_all: Option, - limit: Option, - next: Option, - ) -> Result { - let result = - super::lookup_account_created_applications::lookup_account_created_applications( - self.http_client.as_ref(), - account_id, - application_id, - include_all, - limit, - next.as_deref(), - ) - .await; - - result - } - - /// Lookup account transactions. Transactions are returned newest to oldest. - pub async fn lookup_account_transactions( - &self, - limit: Option, - next: Option, - note_prefix: Option, - tx_type: Option, - sig_type: Option, - txid: Option, - round: Option, - min_round: Option, - max_round: Option, - asset_id: Option, - before_time: Option, - after_time: Option, - currency_greater_than: Option, - currency_less_than: Option, - account_id: &str, - rekey_to: Option, - ) -> Result { - let result = super::lookup_account_transactions::lookup_account_transactions( - self.http_client.as_ref(), - limit, - next.as_deref(), - note_prefix.as_deref(), - tx_type, - sig_type, - txid.as_deref(), - round, - min_round, - max_round, - asset_id, - before_time.as_deref(), - after_time.as_deref(), - currency_greater_than, - currency_less_than, - account_id, - rekey_to, - ) - .await; - - result - } - - /// Search for applications - pub async fn search_for_applications( - &self, - application_id: Option, - creator: Option, - include_all: Option, - limit: Option, - next: Option, - ) -> Result { - let result = super::search_for_applications::search_for_applications( - self.http_client.as_ref(), - application_id, - creator.as_deref(), - include_all, - limit, - next.as_deref(), - ) - .await; - - result - } - - /// Get box names for a given application. - pub async fn search_for_application_boxes( - &self, - application_id: u64, - limit: Option, - next: Option, - ) -> Result { - let result = super::search_for_application_boxes::search_for_application_boxes( - self.http_client.as_ref(), - application_id, - limit, - next.as_deref(), - ) - .await; - - result - } - - /// Lookup application logs. - pub async fn lookup_application_logs_by_id( - &self, - application_id: u64, - limit: Option, - next: Option, - txid: Option, - min_round: Option, - max_round: Option, - sender_address: Option, - ) -> Result { - let result = super::lookup_application_logs_by_id::lookup_application_logs_by_id( - self.http_client.as_ref(), - application_id, - limit, - next.as_deref(), - txid.as_deref(), - min_round, - max_round, - sender_address.as_deref(), - ) - .await; - - result - } - - /// Search for assets. - pub async fn search_for_assets( - &self, - include_all: Option, - limit: Option, - next: Option, - creator: Option, - name: Option, - unit: Option, - asset_id: Option, - ) -> Result { - let result = super::search_for_assets::search_for_assets( - self.http_client.as_ref(), - include_all, - limit, - next.as_deref(), - creator.as_deref(), - name.as_deref(), - unit.as_deref(), - asset_id, - ) - .await; - - result - } - - /// Lookup the list of accounts who hold this asset - pub async fn lookup_asset_balances( - &self, - include_all: Option, - limit: Option, - next: Option, - currency_greater_than: Option, - currency_less_than: Option, - asset_id: u64, - ) -> Result { - let result = super::lookup_asset_balances::lookup_asset_balances( - self.http_client.as_ref(), - include_all, - limit, - next.as_deref(), - currency_greater_than, - currency_less_than, - asset_id, - ) - .await; - - result - } - - /// Lookup transactions for an asset. Transactions are returned oldest to newest. - pub async fn lookup_asset_transactions( - &self, - limit: Option, - next: Option, - note_prefix: Option, - tx_type: Option, - sig_type: Option, - txid: Option, - round: Option, - min_round: Option, - max_round: Option, - before_time: Option, - after_time: Option, - currency_greater_than: Option, - currency_less_than: Option, - address: Option, - address_role: Option, - exclude_close_to: Option, - asset_id: u64, - rekey_to: Option, - ) -> Result { - let result = super::lookup_asset_transactions::lookup_asset_transactions( - self.http_client.as_ref(), - limit, - next.as_deref(), - note_prefix.as_deref(), - tx_type, - sig_type, - txid.as_deref(), - round, - min_round, - max_round, - before_time.as_deref(), - after_time.as_deref(), - currency_greater_than, - currency_less_than, - address.as_deref(), - address_role, - exclude_close_to, - asset_id, - rekey_to, - ) - .await; - - result - } - - /// Search for block headers. Block headers are returned in ascending round order. Transactions are not included in the output. - pub async fn search_for_block_headers( - &self, - limit: Option, - next: Option, - min_round: Option, - max_round: Option, - before_time: Option, - after_time: Option, - proposers: Option>, - expired: Option>, - absent: Option>, - ) -> Result { - let result = super::search_for_block_headers::search_for_block_headers( - self.http_client.as_ref(), - limit, - next.as_deref(), - min_round, - max_round, - before_time.as_deref(), - after_time.as_deref(), - proposers, - expired, - absent, - ) - .await; - - result - } - - /// Search for transactions. Transactions are returned oldest to newest unless the address parameter is used, in which case results are returned newest to oldest. - pub async fn search_for_transactions( - &self, - limit: Option, - next: Option, - note_prefix: Option, - tx_type: Option, - sig_type: Option, - group_id: Option, - txid: Option, - round: Option, - min_round: Option, - max_round: Option, - asset_id: Option, - before_time: Option, - after_time: Option, - currency_greater_than: Option, - currency_less_than: Option, - address: Option, - address_role: Option, - exclude_close_to: Option, - rekey_to: Option, - application_id: Option, - ) -> Result { - let result = super::search_for_transactions::search_for_transactions( - self.http_client.as_ref(), - limit, - next.as_deref(), - note_prefix.as_deref(), - tx_type, - sig_type, - group_id.as_deref(), - txid.as_deref(), - round, - min_round, - max_round, - asset_id, - before_time.as_deref(), - after_time.as_deref(), - currency_greater_than, - currency_less_than, - address.as_deref(), - address_role, - exclude_close_to, - rekey_to, - application_id, - ) - .await; - - result + .await } } diff --git a/crates/indexer_client/src/apis/lookup_account_app_local_states.rs b/crates/indexer_client/src/apis/lookup_account_app_local_states.rs index 876b5872f..8073b8a4c 100644 --- a/crates/indexer_client/src/apis/lookup_account_app_local_states.rs +++ b/crates/indexer_client/src/apis/lookup_account_app_local_states.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAccountAppLocalStates, UnknownJsonValue}; /// struct for typed errors of method [`lookup_account_app_local_states`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAccountAppLocalStatesError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_account_assets.rs b/crates/indexer_client/src/apis/lookup_account_assets.rs index 29f6372b8..cb87d34c0 100644 --- a/crates/indexer_client/src/apis/lookup_account_assets.rs +++ b/crates/indexer_client/src/apis/lookup_account_assets.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAccountAssets, UnknownJsonValue}; /// struct for typed errors of method [`lookup_account_assets`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAccountAssetsError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_account_by_id.rs b/crates/indexer_client/src/apis/lookup_account_by_id.rs index a516345cb..04c699785 100644 --- a/crates/indexer_client/src/apis/lookup_account_by_id.rs +++ b/crates/indexer_client/src/apis/lookup_account_by_id.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAccountById, UnknownJsonValue}; /// struct for typed errors of method [`lookup_account_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAccountByIdError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_account_created_applications.rs b/crates/indexer_client/src/apis/lookup_account_created_applications.rs index 740351ec7..187ca61d0 100644 --- a/crates/indexer_client/src/apis/lookup_account_created_applications.rs +++ b/crates/indexer_client/src/apis/lookup_account_created_applications.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAccountCreatedApplications, UnknownJsonValue}; /// struct for typed errors of method [`lookup_account_created_applications`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAccountCreatedApplicationsError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_account_created_assets.rs b/crates/indexer_client/src/apis/lookup_account_created_assets.rs index 4ff954d08..f207455e2 100644 --- a/crates/indexer_client/src/apis/lookup_account_created_assets.rs +++ b/crates/indexer_client/src/apis/lookup_account_created_assets.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAccountCreatedAssets, UnknownJsonValue}; /// struct for typed errors of method [`lookup_account_created_assets`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAccountCreatedAssetsError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_account_transactions.rs b/crates/indexer_client/src/apis/lookup_account_transactions.rs index 27b699602..b2bc2a921 100644 --- a/crates/indexer_client/src/apis/lookup_account_transactions.rs +++ b/crates/indexer_client/src/apis/lookup_account_transactions.rs @@ -22,7 +22,6 @@ use crate::models::{LookupAccountTransactions, UnknownJsonValue}; /// struct for typed errors of method [`lookup_account_transactions`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAccountTransactionsError { Status400(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_application_box_by_id_and_name.rs b/crates/indexer_client/src/apis/lookup_application_box_by_id_and_name.rs index 10f3ec345..af5f7e1be 100644 --- a/crates/indexer_client/src/apis/lookup_application_box_by_id_and_name.rs +++ b/crates/indexer_client/src/apis/lookup_application_box_by_id_and_name.rs @@ -21,7 +21,6 @@ use crate::models::{Box, UnknownJsonValue}; /// struct for typed errors of method [`lookup_application_box_by_id_and_name`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupApplicationBoxByIdAndNameError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_application_by_id.rs b/crates/indexer_client/src/apis/lookup_application_by_id.rs index 5f058e42a..592419b46 100644 --- a/crates/indexer_client/src/apis/lookup_application_by_id.rs +++ b/crates/indexer_client/src/apis/lookup_application_by_id.rs @@ -21,7 +21,6 @@ use crate::models::{LookupApplicationById, UnknownJsonValue}; /// struct for typed errors of method [`lookup_application_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupApplicationByIdError { Status404(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_application_logs_by_id.rs b/crates/indexer_client/src/apis/lookup_application_logs_by_id.rs index 0ac7eaed6..61032452b 100644 --- a/crates/indexer_client/src/apis/lookup_application_logs_by_id.rs +++ b/crates/indexer_client/src/apis/lookup_application_logs_by_id.rs @@ -21,7 +21,6 @@ use crate::models::LookupApplicationLogsById; /// struct for typed errors of method [`lookup_application_logs_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupApplicationLogsByIdError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_asset_balances.rs b/crates/indexer_client/src/apis/lookup_asset_balances.rs index db5829485..aa470dfd3 100644 --- a/crates/indexer_client/src/apis/lookup_asset_balances.rs +++ b/crates/indexer_client/src/apis/lookup_asset_balances.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAssetBalances, UnknownJsonValue}; /// struct for typed errors of method [`lookup_asset_balances`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAssetBalancesError { Status400(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_asset_by_id.rs b/crates/indexer_client/src/apis/lookup_asset_by_id.rs index 6f413d0ec..0a902a9b3 100644 --- a/crates/indexer_client/src/apis/lookup_asset_by_id.rs +++ b/crates/indexer_client/src/apis/lookup_asset_by_id.rs @@ -21,7 +21,6 @@ use crate::models::{LookupAssetById, UnknownJsonValue}; /// struct for typed errors of method [`lookup_asset_by_id`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAssetByIdError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_asset_transactions.rs b/crates/indexer_client/src/apis/lookup_asset_transactions.rs index b6ca1d39d..95524b1d3 100644 --- a/crates/indexer_client/src/apis/lookup_asset_transactions.rs +++ b/crates/indexer_client/src/apis/lookup_asset_transactions.rs @@ -22,7 +22,6 @@ use crate::models::{LookupAssetTransactions, UnknownJsonValue}; /// struct for typed errors of method [`lookup_asset_transactions`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupAssetTransactionsError { Status400(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_block.rs b/crates/indexer_client/src/apis/lookup_block.rs index da5649b6e..5e8e11d05 100644 --- a/crates/indexer_client/src/apis/lookup_block.rs +++ b/crates/indexer_client/src/apis/lookup_block.rs @@ -21,7 +21,6 @@ use crate::models::{Block, UnknownJsonValue}; /// struct for typed errors of method [`lookup_block`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupBlockError { Status404(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/lookup_transaction.rs b/crates/indexer_client/src/apis/lookup_transaction.rs index 1125bb730..53eae1b20 100644 --- a/crates/indexer_client/src/apis/lookup_transaction.rs +++ b/crates/indexer_client/src/apis/lookup_transaction.rs @@ -21,7 +21,6 @@ use crate::models::{LookupTransaction, UnknownJsonValue}; /// struct for typed errors of method [`lookup_transaction`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum LookupTransactionError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/make_health_check.rs b/crates/indexer_client/src/apis/make_health_check.rs index bb9c9a1dc..9745b782f 100644 --- a/crates/indexer_client/src/apis/make_health_check.rs +++ b/crates/indexer_client/src/apis/make_health_check.rs @@ -21,7 +21,6 @@ use crate::models::HealthCheck; /// struct for typed errors of method [`make_health_check`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum MakeHealthCheckError { Statusdefault(), DefaultResponse(), diff --git a/crates/indexer_client/src/apis/mod.rs b/crates/indexer_client/src/apis/mod.rs index 216ab5519..99288531c 100644 --- a/crates/indexer_client/src/apis/mod.rs +++ b/crates/indexer_client/src/apis/mod.rs @@ -40,7 +40,6 @@ use snafu::Snafu; /// Unified error type that can represent any API error from any endpoint #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum IndexerApiError { #[snafu(display("Make_health_check error: {error:?}"))] MakeHealthCheck { @@ -266,7 +265,6 @@ impl From for IndexerApiErr /// The main error type for all indexer client operations #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum Error { #[snafu(display("HTTP error: {source}"))] Http { @@ -300,13 +298,13 @@ impl From<&str> for ContentType { } } +// Re-export the consolidated client +pub use client::IndexerClient; + pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } -// Re-export the consolidated client -pub use client::IndexerClient; - // Re-export parameter enums pub use parameter_enums::*; diff --git a/crates/indexer_client/src/apis/parameter_enums.rs b/crates/indexer_client/src/apis/parameter_enums.rs index 8076c6c73..a2f37a056 100644 --- a/crates/indexer_client/src/apis/parameter_enums.rs +++ b/crates/indexer_client/src/apis/parameter_enums.rs @@ -13,7 +13,6 @@ use std::str::FromStr; /// Parameter enum for txtype #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum TxType { /// pay Pay, @@ -73,7 +72,6 @@ impl FromStr for TxType { /// * lsig - LogicSig #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum SigType { /// sig Sig, @@ -110,7 +108,6 @@ impl FromStr for SigType { /// Combine with the address parameter to define what type of address to search for. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum AddressRole { /// sender Sender, diff --git a/crates/indexer_client/src/apis/search_for_accounts.rs b/crates/indexer_client/src/apis/search_for_accounts.rs index bc8bac436..1a6906491 100644 --- a/crates/indexer_client/src/apis/search_for_accounts.rs +++ b/crates/indexer_client/src/apis/search_for_accounts.rs @@ -21,7 +21,6 @@ use crate::models::{SearchForAccounts, UnknownJsonValue}; /// struct for typed errors of method [`search_for_accounts`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SearchForAccountsError { Status400(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/search_for_application_boxes.rs b/crates/indexer_client/src/apis/search_for_application_boxes.rs index f33cc740c..2b4eca77b 100644 --- a/crates/indexer_client/src/apis/search_for_application_boxes.rs +++ b/crates/indexer_client/src/apis/search_for_application_boxes.rs @@ -21,7 +21,6 @@ use crate::models::{SearchForApplicationBoxes, UnknownJsonValue}; /// struct for typed errors of method [`search_for_application_boxes`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SearchForApplicationBoxesError { Status400(UnknownJsonValue), Status404(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/search_for_applications.rs b/crates/indexer_client/src/apis/search_for_applications.rs index 23189913b..75f3c9a03 100644 --- a/crates/indexer_client/src/apis/search_for_applications.rs +++ b/crates/indexer_client/src/apis/search_for_applications.rs @@ -21,7 +21,6 @@ use crate::models::{SearchForApplications, UnknownJsonValue}; /// struct for typed errors of method [`search_for_applications`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SearchForApplicationsError { Status500(UnknownJsonValue), DefaultResponse(), diff --git a/crates/indexer_client/src/apis/search_for_assets.rs b/crates/indexer_client/src/apis/search_for_assets.rs index e26ac5f3a..6a1f559bc 100644 --- a/crates/indexer_client/src/apis/search_for_assets.rs +++ b/crates/indexer_client/src/apis/search_for_assets.rs @@ -21,7 +21,6 @@ use crate::models::{SearchForAssets, UnknownJsonValue}; /// struct for typed errors of method [`search_for_assets`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SearchForAssetsError { Status400(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/search_for_block_headers.rs b/crates/indexer_client/src/apis/search_for_block_headers.rs index bf1bdc707..d6c6f3cf0 100644 --- a/crates/indexer_client/src/apis/search_for_block_headers.rs +++ b/crates/indexer_client/src/apis/search_for_block_headers.rs @@ -21,7 +21,6 @@ use crate::models::{SearchForBlockHeaders, UnknownJsonValue}; /// struct for typed errors of method [`search_for_block_headers`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SearchForBlockHeadersError { Status404(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/apis/search_for_transactions.rs b/crates/indexer_client/src/apis/search_for_transactions.rs index 655f5bbf5..0e59bd507 100644 --- a/crates/indexer_client/src/apis/search_for_transactions.rs +++ b/crates/indexer_client/src/apis/search_for_transactions.rs @@ -22,7 +22,6 @@ use crate::models::{SearchForTransactions, UnknownJsonValue}; /// struct for typed errors of method [`search_for_transactions`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SearchForTransactionsError { Status400(UnknownJsonValue), Status500(UnknownJsonValue), diff --git a/crates/indexer_client/src/lib.rs b/crates/indexer_client/src/lib.rs index a5558835b..8c5031291 100644 --- a/crates/indexer_client/src/lib.rs +++ b/crates/indexer_client/src/lib.rs @@ -1,9 +1,6 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] -#[cfg(feature = "ffi_uniffi")] -uniffi::setup_scaffolding!(); - pub mod apis; pub mod models; diff --git a/crates/indexer_client/src/models/account.rs b/crates/indexer_client/src/models/account.rs index 6a083b622..24ee158a4 100644 --- a/crates/indexer_client/src/models/account.rs +++ b/crates/indexer_client/src/models/account.rs @@ -22,7 +22,6 @@ use crate::models::AssetHolding; /// Definition: /// data/basics/userBalance.go : AccountData #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Account { /// the account public key #[serde(rename = "address")] diff --git a/crates/indexer_client/src/models/account_participation.rs b/crates/indexer_client/src/models/account_participation.rs index 12c477f3a..46be35e4b 100644 --- a/crates/indexer_client/src/models/account_participation.rs +++ b/crates/indexer_client/src/models/account_participation.rs @@ -14,7 +14,6 @@ use serde_with::{Bytes, serde_as}; /// AccountParticipation describes the parameters used by this account in consensus protocol. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountParticipation { /// Selection public key (if any) currently registered for this round. #[serde_as(as = "serde_with::base64::Base64")] diff --git a/crates/indexer_client/src/models/account_state_delta.rs b/crates/indexer_client/src/models/account_state_delta.rs index a51ab5968..f43dbeaf7 100644 --- a/crates/indexer_client/src/models/account_state_delta.rs +++ b/crates/indexer_client/src/models/account_state_delta.rs @@ -14,7 +14,6 @@ use crate::models::StateDelta; /// Application state delta. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AccountStateDelta { #[serde(rename = "address")] pub address: String, diff --git a/crates/indexer_client/src/models/application.rs b/crates/indexer_client/src/models/application.rs index 363aa5af3..17c77fee7 100644 --- a/crates/indexer_client/src/models/application.rs +++ b/crates/indexer_client/src/models/application.rs @@ -14,7 +14,6 @@ use crate::models::ApplicationParams; /// Application index and its parameters #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Application { /// application index. #[serde(rename = "id")] diff --git a/crates/indexer_client/src/models/application_local_state.rs b/crates/indexer_client/src/models/application_local_state.rs index 95afa3e43..b1bd6ee13 100644 --- a/crates/indexer_client/src/models/application_local_state.rs +++ b/crates/indexer_client/src/models/application_local_state.rs @@ -15,7 +15,6 @@ use crate::models::TealKeyValueStore; /// Stores local state associated with an application. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationLocalState { /// The application which this local state is for. #[serde(rename = "id")] diff --git a/crates/indexer_client/src/models/application_log_data.rs b/crates/indexer_client/src/models/application_log_data.rs index 4feb8e4f9..306c99370 100644 --- a/crates/indexer_client/src/models/application_log_data.rs +++ b/crates/indexer_client/src/models/application_log_data.rs @@ -14,7 +14,6 @@ use serde_with::{Bytes, serde_as}; /// Stores the global information associated with an application. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationLogData { /// Transaction ID #[serde(rename = "txid")] diff --git a/crates/indexer_client/src/models/application_params.rs b/crates/indexer_client/src/models/application_params.rs index 494fd6a90..0cd80be3c 100644 --- a/crates/indexer_client/src/models/application_params.rs +++ b/crates/indexer_client/src/models/application_params.rs @@ -17,7 +17,6 @@ use crate::models::TealKeyValueStore; /// Stores the global information associated with an application. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationParams { /// The address that created this application. This is the address where the parameters and global state for this application can be found. #[serde(rename = "creator", skip_serializing_if = "Option::is_none")] diff --git a/crates/indexer_client/src/models/application_state_schema.rs b/crates/indexer_client/src/models/application_state_schema.rs index e2f4bb0f3..789789234 100644 --- a/crates/indexer_client/src/models/application_state_schema.rs +++ b/crates/indexer_client/src/models/application_state_schema.rs @@ -12,7 +12,6 @@ use serde::{Deserialize, Serialize}; /// Specifies maximums on the number of each type that may be stored. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ApplicationStateSchema { /// number of uints. #[serde(rename = "num-uint")] diff --git a/crates/indexer_client/src/models/asset.rs b/crates/indexer_client/src/models/asset.rs index f50836fc7..b11c7d8a8 100644 --- a/crates/indexer_client/src/models/asset.rs +++ b/crates/indexer_client/src/models/asset.rs @@ -14,7 +14,6 @@ use crate::models::AssetParams; /// Specifies both the unique identifier and the parameters for an asset #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Asset { /// unique asset identifier #[serde(rename = "index")] diff --git a/crates/indexer_client/src/models/asset_holding.rs b/crates/indexer_client/src/models/asset_holding.rs index 7e32ab4fa..ecf4333a0 100644 --- a/crates/indexer_client/src/models/asset_holding.rs +++ b/crates/indexer_client/src/models/asset_holding.rs @@ -15,7 +15,6 @@ use serde::{Deserialize, Serialize}; /// Definition: /// data/basics/userBalance.go : AssetHolding #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AssetHolding { /// number of units held. #[serde(rename = "amount")] diff --git a/crates/indexer_client/src/models/asset_params.rs b/crates/indexer_client/src/models/asset_params.rs index 52254266d..fa2ab57b4 100644 --- a/crates/indexer_client/src/models/asset_params.rs +++ b/crates/indexer_client/src/models/asset_params.rs @@ -13,13 +13,12 @@ use serde_with::{Bytes, serde_as}; /// AssetParams specifies the parameters for an asset. /// -/// \[apar\] when part of an AssetConfig transaction. +/// [apar] when part of an AssetConfig transaction. /// /// Definition: /// data/transactions/asset.go : AssetParams #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct AssetParams { /// Address of account used to clawback holdings of this asset. If empty, clawback is not permitted. #[serde(rename = "clawback", skip_serializing_if = "Option::is_none")] diff --git a/crates/indexer_client/src/models/block.rs b/crates/indexer_client/src/models/block.rs index 8d1737a47..a79c1e418 100644 --- a/crates/indexer_client/src/models/block.rs +++ b/crates/indexer_client/src/models/block.rs @@ -24,7 +24,6 @@ use crate::models::Transaction; /// data/bookkeeping/block.go : Block #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Block { /// the proposer of this block. #[serde(rename = "proposer", skip_serializing_if = "Option::is_none")] @@ -38,18 +37,18 @@ pub struct Block { /// the actual amount transferred to the proposer from the fee sink. #[serde(rename = "proposer-payout", skip_serializing_if = "Option::is_none")] pub proposer_payout: Option, - /// \[gh\] hash to which this block belongs. + /// [gh] hash to which this block belongs. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "genesis-hash")] pub genesis_hash: Vec, - /// \[gen\] ID to which this block belongs. + /// [gen] ID to which this block belongs. #[serde(rename = "genesis-id")] pub genesis_id: String, - /// \[prev\] Previous block hash. + /// [prev] Previous block hash. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "previous-block-hash")] pub previous_block_hash: Vec, - /// \[prev512\] Previous block hash, using SHA-512. + /// [prev512] Previous block hash, using SHA-512. #[serde_as(as = "Option")] #[serde( rename = "previous-block-hash-512", @@ -58,10 +57,10 @@ pub struct Block { pub previous_block_hash_512: Option>, #[serde(rename = "rewards", skip_serializing_if = "Option::is_none")] pub rewards: Option, - /// \[rnd\] Current round on which this block was appended to the chain. + /// [rnd] Current round on which this block was appended to the chain. #[serde(rename = "round")] pub round: u64, - /// \[seed\] Sortition seed. + /// [seed] Sortition seed. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "seed")] pub seed: Vec, @@ -71,28 +70,28 @@ pub struct Block { skip_serializing_if = "Option::is_none" )] pub state_proof_tracking: Option>, - /// \[ts\] Block creation timestamp in seconds since epoch + /// [ts] Block creation timestamp in seconds since epoch #[serde(rename = "timestamp")] pub timestamp: u64, - /// \[txns\] list of transactions corresponding to a given round. + /// [txns] list of transactions corresponding to a given round. #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")] pub transactions: Option>, - /// \[txn\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot. + /// [txn] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "transactions-root")] pub transactions_root: Vec, - /// \[txn256\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists. + /// [txn256] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "transactions-root-sha256")] pub transactions_root_sha256: Vec, - /// \[txn512\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256. + /// [txn512] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256. #[serde_as(as = "Option")] #[serde( rename = "transactions-root-sha512", skip_serializing_if = "Option::is_none" )] pub transactions_root_sha512: Option>, - /// \[tc\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced. + /// [tc] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced. /// /// Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported). #[serde(rename = "txn-counter", skip_serializing_if = "Option::is_none")] diff --git a/crates/indexer_client/src/models/block_rewards.rs b/crates/indexer_client/src/models/block_rewards.rs index 82122e237..858e69a5e 100644 --- a/crates/indexer_client/src/models/block_rewards.rs +++ b/crates/indexer_client/src/models/block_rewards.rs @@ -12,24 +12,23 @@ use serde::{Deserialize, Serialize}; /// Fields relating to rewards, #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BlockRewards { - /// \[fees\] accepts transaction fees, it can only spend to the incentive pool. + /// [fees] accepts transaction fees, it can only spend to the incentive pool. #[serde(rename = "fee-sink")] pub fee_sink: String, - /// \[rwcalr\] number of leftover MicroAlgos after the distribution of rewards-rate MicroAlgos for every reward unit in the next round. + /// [rwcalr] number of leftover MicroAlgos after the distribution of rewards-rate MicroAlgos for every reward unit in the next round. #[serde(rename = "rewards-calculation-round")] pub rewards_calculation_round: u64, - /// \[earn\] How many rewards, in MicroAlgos, have been distributed to each RewardUnit of MicroAlgos since genesis. + /// [earn] How many rewards, in MicroAlgos, have been distributed to each RewardUnit of MicroAlgos since genesis. #[serde(rename = "rewards-level")] pub rewards_level: u64, - /// \[rwd\] accepts periodic injections from the fee-sink and continually redistributes them as rewards. + /// [rwd] accepts periodic injections from the fee-sink and continually redistributes them as rewards. #[serde(rename = "rewards-pool")] pub rewards_pool: String, - /// \[rate\] Number of new MicroAlgos added to the participation stake from rewards at the next round. + /// [rate] Number of new MicroAlgos added to the participation stake from rewards at the next round. #[serde(rename = "rewards-rate")] pub rewards_rate: u64, - /// \[frac\] Number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round. + /// [frac] Number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round. #[serde(rename = "rewards-residue")] pub rewards_residue: u64, } diff --git a/crates/indexer_client/src/models/block_upgrade_state.rs b/crates/indexer_client/src/models/block_upgrade_state.rs index a031a5d7f..1ceabe400 100644 --- a/crates/indexer_client/src/models/block_upgrade_state.rs +++ b/crates/indexer_client/src/models/block_upgrade_state.rs @@ -12,27 +12,26 @@ use serde::{Deserialize, Serialize}; /// Fields relating to a protocol upgrade. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BlockUpgradeState { - /// \[proto\] The current protocol version. + /// [proto] The current protocol version. #[serde(rename = "current-protocol")] pub current_protocol: String, - /// \[nextproto\] The next proposed protocol version. + /// [nextproto] The next proposed protocol version. #[serde(rename = "next-protocol", skip_serializing_if = "Option::is_none")] pub next_protocol: Option, - /// \[nextyes\] Number of blocks which approved the protocol upgrade. + /// [nextyes] Number of blocks which approved the protocol upgrade. #[serde( rename = "next-protocol-approvals", skip_serializing_if = "Option::is_none" )] pub next_protocol_approvals: Option, - /// \[nextswitch\] Round on which the protocol upgrade will take effect. + /// [nextswitch] Round on which the protocol upgrade will take effect. #[serde( rename = "next-protocol-switch-on", skip_serializing_if = "Option::is_none" )] pub next_protocol_switch_on: Option, - /// \[nextbefore\] Deadline round for this protocol upgrade (No votes will be consider after this round). + /// [nextbefore] Deadline round for this protocol upgrade (No votes will be consider after this round). #[serde( rename = "next-protocol-vote-before", skip_serializing_if = "Option::is_none" diff --git a/crates/indexer_client/src/models/block_upgrade_vote.rs b/crates/indexer_client/src/models/block_upgrade_vote.rs index 7d5040e05..cf0bebbd6 100644 --- a/crates/indexer_client/src/models/block_upgrade_vote.rs +++ b/crates/indexer_client/src/models/block_upgrade_vote.rs @@ -12,15 +12,14 @@ use serde::{Deserialize, Serialize}; /// Fields relating to voting for a protocol upgrade. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BlockUpgradeVote { - /// \[upgradeyes\] Indicates a yes vote for the current proposal. + /// [upgradeyes] Indicates a yes vote for the current proposal. #[serde(rename = "upgrade-approve", skip_serializing_if = "Option::is_none")] pub upgrade_approve: Option, - /// \[upgradedelay\] Indicates the time between acceptance and execution. + /// [upgradedelay] Indicates the time between acceptance and execution. #[serde(rename = "upgrade-delay", skip_serializing_if = "Option::is_none")] pub upgrade_delay: Option, - /// \[upgradeprop\] Indicates a proposed upgrade. + /// [upgradeprop] Indicates a proposed upgrade. #[serde(rename = "upgrade-propose", skip_serializing_if = "Option::is_none")] pub upgrade_propose: Option, } diff --git a/crates/indexer_client/src/models/box_descriptor.rs b/crates/indexer_client/src/models/box_descriptor.rs index c57a155cd..6083cc9c5 100644 --- a/crates/indexer_client/src/models/box_descriptor.rs +++ b/crates/indexer_client/src/models/box_descriptor.rs @@ -14,7 +14,6 @@ use serde_with::{Bytes, serde_as}; /// Box descriptor describes an app box without a value. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BoxDescriptor { /// Base64 encoded box name #[serde_as(as = "serde_with::base64::Base64")] diff --git a/crates/indexer_client/src/models/box_model.rs b/crates/indexer_client/src/models/box_model.rs index 13ba006e0..7f24e526b 100644 --- a/crates/indexer_client/src/models/box_model.rs +++ b/crates/indexer_client/src/models/box_model.rs @@ -14,16 +14,15 @@ use serde_with::{Bytes, serde_as}; /// Box name and its content. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Box { /// The round for which this information is relevant #[serde(rename = "round")] pub round: u64, - /// \[name\] box name, base64 encoded + /// [name] box name, base64 encoded #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "name")] pub name: Vec, - /// \[value\] box value, base64 encoded. + /// [value] box value, base64 encoded. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "value")] pub value: Vec, diff --git a/crates/indexer_client/src/models/box_reference.rs b/crates/indexer_client/src/models/box_reference.rs index 04094b651..5853655ae 100644 --- a/crates/indexer_client/src/models/box_reference.rs +++ b/crates/indexer_client/src/models/box_reference.rs @@ -14,7 +14,6 @@ use serde_with::{Bytes, serde_as}; /// BoxReference names a box by its name and the application ID it belongs to. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct BoxReference { /// Application ID to which the box belongs, or zero if referring to the called application. #[serde(rename = "app")] diff --git a/crates/indexer_client/src/models/eval_delta.rs b/crates/indexer_client/src/models/eval_delta.rs index d044eb6c9..1ac28428e 100644 --- a/crates/indexer_client/src/models/eval_delta.rs +++ b/crates/indexer_client/src/models/eval_delta.rs @@ -12,15 +12,14 @@ use serde::{Deserialize, Serialize}; /// Represents a TEAL value delta. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct EvalDelta { - /// \[at\] delta action. + /// [at] delta action. #[serde(rename = "action")] pub action: u32, - /// \[bs\] bytes value. + /// [bs] bytes value. #[serde(rename = "bytes", skip_serializing_if = "Option::is_none")] pub bytes: Option, - /// \[ui\] uint value. + /// [ui] uint value. #[serde(rename = "uint", skip_serializing_if = "Option::is_none")] pub uint: Option, } diff --git a/crates/indexer_client/src/models/eval_delta_key_value.rs b/crates/indexer_client/src/models/eval_delta_key_value.rs index 96b1a39e9..65bbee57b 100644 --- a/crates/indexer_client/src/models/eval_delta_key_value.rs +++ b/crates/indexer_client/src/models/eval_delta_key_value.rs @@ -14,7 +14,6 @@ use crate::models::EvalDelta; /// Key-value pairs for StateDelta. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct EvalDeltaKeyValue { #[serde(rename = "key")] pub key: String, diff --git a/crates/indexer_client/src/models/hash_factory.rs b/crates/indexer_client/src/models/hash_factory.rs index 944031e96..5286917aa 100644 --- a/crates/indexer_client/src/models/hash_factory.rs +++ b/crates/indexer_client/src/models/hash_factory.rs @@ -11,9 +11,8 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct HashFactory { - /// \[t\] + /// [t] #[serde(rename = "hash-type", skip_serializing_if = "Option::is_none")] pub hash_type: Option, } diff --git a/crates/indexer_client/src/models/hashtype.rs b/crates/indexer_client/src/models/hashtype.rs index cfd838b0f..a5f3c37af 100644 --- a/crates/indexer_client/src/models/hashtype.rs +++ b/crates/indexer_client/src/models/hashtype.rs @@ -16,7 +16,6 @@ use std::str::FromStr; /// * sha512_256 /// * sha256 #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum Hashtype { /// sha512_256 #[serde(rename = "sha512_256")] diff --git a/crates/indexer_client/src/models/hb_proof_fields.rs b/crates/indexer_client/src/models/hb_proof_fields.rs index 9081d6961..37aec1cc1 100644 --- a/crates/indexer_client/src/models/hb_proof_fields.rs +++ b/crates/indexer_client/src/models/hb_proof_fields.rs @@ -11,28 +11,27 @@ use crate::models; use serde::{Deserialize, Serialize}; use serde_with::{Bytes, serde_as}; -/// \[hbprf\] HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. +/// [hbprf] HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct HbProofFields { - /// \[s\] Signature of the heartbeat message. + /// [s] Signature of the heartbeat message. #[serde_as(as = "Option")] #[serde(rename = "hb-sig", skip_serializing_if = "Option::is_none")] pub hb_sig: Option>, - /// \[p\] Public key of the heartbeat message. + /// [p] Public key of the heartbeat message. #[serde_as(as = "Option")] #[serde(rename = "hb-pk", skip_serializing_if = "Option::is_none")] pub hb_pk: Option>, - /// \[p2\] Key for new-style two-level ephemeral signature. + /// [p2] Key for new-style two-level ephemeral signature. #[serde_as(as = "Option")] #[serde(rename = "hb-pk2", skip_serializing_if = "Option::is_none")] pub hb_pk2: Option>, - /// \[p1s\] Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the key PK2. + /// [p1s] Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the key PK2. #[serde_as(as = "Option")] #[serde(rename = "hb-pk1sig", skip_serializing_if = "Option::is_none")] pub hb_pk1sig: Option>, - /// \[p2s\] Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master key (OneTimeSignatureVerifier). + /// [p2s] Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master key (OneTimeSignatureVerifier). #[serde_as(as = "Option")] #[serde(rename = "hb-pk2sig", skip_serializing_if = "Option::is_none")] pub hb_pk2sig: Option>, diff --git a/crates/indexer_client/src/models/health_check.rs b/crates/indexer_client/src/models/health_check.rs index 0579bad8a..634208692 100644 --- a/crates/indexer_client/src/models/health_check.rs +++ b/crates/indexer_client/src/models/health_check.rs @@ -14,7 +14,6 @@ use crate::models::UnknownJsonValue; /// A health check response. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct HealthCheck { /// Current version. #[serde(rename = "version")] diff --git a/crates/indexer_client/src/models/holding_ref.rs b/crates/indexer_client/src/models/holding_ref.rs index 269ecd90b..0e5039054 100644 --- a/crates/indexer_client/src/models/holding_ref.rs +++ b/crates/indexer_client/src/models/holding_ref.rs @@ -12,12 +12,11 @@ use serde::{Deserialize, Serialize}; /// HoldingRef names a holding by referring to an Address and Asset it belongs to. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct HoldingRef { - /// \[d\] Address in access list, or the sender of the transaction. + /// [d] Address in access list, or the sender of the transaction. #[serde(rename = "address")] pub address: String, - /// \[s\] Asset ID for asset in access list. + /// [s] Asset ID for asset in access list. #[serde(rename = "asset")] pub asset: u64, } diff --git a/crates/indexer_client/src/models/indexer_state_proof_message.rs b/crates/indexer_client/src/models/indexer_state_proof_message.rs index 923c777fe..6ace66dea 100644 --- a/crates/indexer_client/src/models/indexer_state_proof_message.rs +++ b/crates/indexer_client/src/models/indexer_state_proof_message.rs @@ -13,29 +13,28 @@ use serde_with::{Bytes, serde_as}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct IndexerStateProofMessage { - /// \[b\] + /// [b] #[serde_as(as = "Option")] #[serde( rename = "block-headers-commitment", skip_serializing_if = "Option::is_none" )] pub block_headers_commitment: Option>, - /// \[v\] + /// [v] #[serde_as(as = "Option")] #[serde(rename = "voters-commitment", skip_serializing_if = "Option::is_none")] pub voters_commitment: Option>, - /// \[P\] + /// [P] #[serde(rename = "ln-proven-weight", skip_serializing_if = "Option::is_none")] pub ln_proven_weight: Option, - /// \[f\] + /// [f] #[serde( rename = "first-attested-round", skip_serializing_if = "Option::is_none" )] pub first_attested_round: Option, - /// \[l\] + /// [l] #[serde( rename = "latest-attested-round", skip_serializing_if = "Option::is_none" diff --git a/crates/indexer_client/src/models/locals_ref.rs b/crates/indexer_client/src/models/locals_ref.rs index cdee93f79..ae3c0bada 100644 --- a/crates/indexer_client/src/models/locals_ref.rs +++ b/crates/indexer_client/src/models/locals_ref.rs @@ -12,12 +12,11 @@ use serde::{Deserialize, Serialize}; /// LocalsRef names a local state by referring to an Address and App it belongs to. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LocalsRef { - /// \[d\] Address in access list, or the sender of the transaction. + /// [d] Address in access list, or the sender of the transaction. #[serde(rename = "address")] pub address: String, - /// \[p\] Application ID for app in access list, or zero if referring to the called application. + /// [p] Application ID for app in access list, or zero if referring to the called application. #[serde(rename = "app")] pub app: u64, } diff --git a/crates/indexer_client/src/models/lookup_account_app_local_states.rs b/crates/indexer_client/src/models/lookup_account_app_local_states.rs index 0d97f5d1d..1b804e7e6 100644 --- a/crates/indexer_client/src/models/lookup_account_app_local_states.rs +++ b/crates/indexer_client/src/models/lookup_account_app_local_states.rs @@ -14,7 +14,6 @@ use crate::models::ApplicationLocalState; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAccountAppLocalStates { #[serde(rename = "apps-local-states")] pub apps_local_states: Vec, diff --git a/crates/indexer_client/src/models/lookup_account_assets.rs b/crates/indexer_client/src/models/lookup_account_assets.rs index 70a0e30ad..91ac33b6a 100644 --- a/crates/indexer_client/src/models/lookup_account_assets.rs +++ b/crates/indexer_client/src/models/lookup_account_assets.rs @@ -14,7 +14,6 @@ use crate::models::AssetHolding; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAccountAssets { /// Round at which the results were computed. #[serde(rename = "current-round")] diff --git a/crates/indexer_client/src/models/lookup_account_by_id.rs b/crates/indexer_client/src/models/lookup_account_by_id.rs index c06106aa3..dd102b83f 100644 --- a/crates/indexer_client/src/models/lookup_account_by_id.rs +++ b/crates/indexer_client/src/models/lookup_account_by_id.rs @@ -14,7 +14,6 @@ use crate::models::Account; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAccountById { #[serde(rename = "account")] pub account: Account, diff --git a/crates/indexer_client/src/models/lookup_account_created_applications.rs b/crates/indexer_client/src/models/lookup_account_created_applications.rs index ef31ca879..c5d30df2b 100644 --- a/crates/indexer_client/src/models/lookup_account_created_applications.rs +++ b/crates/indexer_client/src/models/lookup_account_created_applications.rs @@ -14,7 +14,6 @@ use crate::models::Application; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAccountCreatedApplications { #[serde(rename = "applications")] pub applications: Vec, diff --git a/crates/indexer_client/src/models/lookup_account_created_assets.rs b/crates/indexer_client/src/models/lookup_account_created_assets.rs index 0247ed98f..fddd07d3b 100644 --- a/crates/indexer_client/src/models/lookup_account_created_assets.rs +++ b/crates/indexer_client/src/models/lookup_account_created_assets.rs @@ -14,7 +14,6 @@ use crate::models::Asset; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAccountCreatedAssets { #[serde(rename = "assets")] pub assets: Vec, diff --git a/crates/indexer_client/src/models/lookup_account_transactions.rs b/crates/indexer_client/src/models/lookup_account_transactions.rs index ee9dc402d..bec4e70c4 100644 --- a/crates/indexer_client/src/models/lookup_account_transactions.rs +++ b/crates/indexer_client/src/models/lookup_account_transactions.rs @@ -14,7 +14,6 @@ use crate::models::Transaction; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAccountTransactions { /// Round at which the results were computed. #[serde(rename = "current-round")] diff --git a/crates/indexer_client/src/models/lookup_application_by_id.rs b/crates/indexer_client/src/models/lookup_application_by_id.rs index 34ab6f219..0980bb99c 100644 --- a/crates/indexer_client/src/models/lookup_application_by_id.rs +++ b/crates/indexer_client/src/models/lookup_application_by_id.rs @@ -14,7 +14,6 @@ use crate::models::Application; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupApplicationById { #[serde(rename = "application", skip_serializing_if = "Option::is_none")] pub application: Option, diff --git a/crates/indexer_client/src/models/lookup_application_logs_by_id.rs b/crates/indexer_client/src/models/lookup_application_logs_by_id.rs index 145aa9856..52cb57197 100644 --- a/crates/indexer_client/src/models/lookup_application_logs_by_id.rs +++ b/crates/indexer_client/src/models/lookup_application_logs_by_id.rs @@ -14,9 +14,8 @@ use crate::models::ApplicationLogData; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupApplicationLogsById { - /// \[appidx\] application index. + /// [appidx] application index. #[serde(rename = "application-id")] pub application_id: u64, /// Round at which the results were computed. diff --git a/crates/indexer_client/src/models/lookup_asset_balances.rs b/crates/indexer_client/src/models/lookup_asset_balances.rs index fa4f448e8..c106cdbcc 100644 --- a/crates/indexer_client/src/models/lookup_asset_balances.rs +++ b/crates/indexer_client/src/models/lookup_asset_balances.rs @@ -14,7 +14,6 @@ use crate::models::MiniAssetHolding; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAssetBalances { #[serde(rename = "balances")] pub balances: Vec, diff --git a/crates/indexer_client/src/models/lookup_asset_by_id.rs b/crates/indexer_client/src/models/lookup_asset_by_id.rs index 59969426a..38f220756 100644 --- a/crates/indexer_client/src/models/lookup_asset_by_id.rs +++ b/crates/indexer_client/src/models/lookup_asset_by_id.rs @@ -14,7 +14,6 @@ use crate::models::Asset; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAssetById { #[serde(rename = "asset")] pub asset: Asset, diff --git a/crates/indexer_client/src/models/lookup_asset_transactions.rs b/crates/indexer_client/src/models/lookup_asset_transactions.rs index 4bd5d656a..f822381b5 100644 --- a/crates/indexer_client/src/models/lookup_asset_transactions.rs +++ b/crates/indexer_client/src/models/lookup_asset_transactions.rs @@ -14,7 +14,6 @@ use crate::models::Transaction; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupAssetTransactions { /// Round at which the results were computed. #[serde(rename = "current-round")] diff --git a/crates/indexer_client/src/models/lookup_transaction.rs b/crates/indexer_client/src/models/lookup_transaction.rs index ca8b13271..64831a711 100644 --- a/crates/indexer_client/src/models/lookup_transaction.rs +++ b/crates/indexer_client/src/models/lookup_transaction.rs @@ -14,7 +14,6 @@ use crate::models::Transaction; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct LookupTransaction { #[serde(rename = "transaction")] pub transaction: Transaction, diff --git a/crates/indexer_client/src/models/merkle_array_proof.rs b/crates/indexer_client/src/models/merkle_array_proof.rs index 67932923d..f6866a9f1 100644 --- a/crates/indexer_client/src/models/merkle_array_proof.rs +++ b/crates/indexer_client/src/models/merkle_array_proof.rs @@ -15,15 +15,14 @@ use crate::models::HashFactory; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct MerkleArrayProof { - /// \[pth\] + /// [pth] #[serde_as(as = "Option>")] #[serde(rename = "path", skip_serializing_if = "Option::is_none")] pub path: Option>>, #[serde(rename = "hash-factory", skip_serializing_if = "Option::is_none")] pub hash_factory: Option, - /// \[td\] + /// [td] #[serde(rename = "tree-depth", skip_serializing_if = "Option::is_none")] pub tree_depth: Option, } diff --git a/crates/indexer_client/src/models/mini_asset_holding.rs b/crates/indexer_client/src/models/mini_asset_holding.rs index 8bbacd1b7..def6001e4 100644 --- a/crates/indexer_client/src/models/mini_asset_holding.rs +++ b/crates/indexer_client/src/models/mini_asset_holding.rs @@ -12,7 +12,6 @@ use serde::{Deserialize, Serialize}; /// A simplified version of AssetHolding #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct MiniAssetHolding { #[serde(rename = "address")] pub address: String, diff --git a/crates/indexer_client/src/models/mod.rs b/crates/indexer_client/src/models/mod.rs index ab7078812..beed54dd0 100644 --- a/crates/indexer_client/src/models/mod.rs +++ b/crates/indexer_client/src/models/mod.rs @@ -7,10 +7,6 @@ * Generated by: Rust OpenAPI Generator */ -#[cfg(feature = "ffi_uniffi")] -pub type UnknownJsonValue = String; - -#[cfg(not(feature = "ffi_uniffi"))] pub type UnknownJsonValue = serde_json::Value; pub mod hashtype; diff --git a/crates/indexer_client/src/models/on_completion.rs b/crates/indexer_client/src/models/on_completion.rs index d672408a0..51b939bda 100644 --- a/crates/indexer_client/src/models/on_completion.rs +++ b/crates/indexer_client/src/models/on_completion.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; use std::str::FromStr; -/// \[apan\] defines the what additional actions occur with the transaction. +/// [apan] defines the what additional actions occur with the transaction. /// /// Valid types: /// * noop @@ -22,7 +22,6 @@ use std::str::FromStr; /// * update /// * delete #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Enum))] pub enum OnCompletion { /// noop #[serde(rename = "noop")] diff --git a/crates/indexer_client/src/models/participation_updates.rs b/crates/indexer_client/src/models/participation_updates.rs index f9409f07f..7913f8b9b 100644 --- a/crates/indexer_client/src/models/participation_updates.rs +++ b/crates/indexer_client/src/models/participation_updates.rs @@ -12,15 +12,14 @@ use serde::{Deserialize, Serialize}; /// Participation account data that needs to be checked/acted on by the network. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ParticipationUpdates { - /// \[partupdrmv\] a list of online accounts that needs to be converted to offline since their participation key expired. + /// [partupdrmv] a list of online accounts that needs to be converted to offline since their participation key expired. #[serde( rename = "expired-participation-accounts", skip_serializing_if = "Option::is_none" )] pub expired_participation_accounts: Option>, - /// \[partupabs\] a list of online accounts that need to be suspended. + /// [partupabs] a list of online accounts that need to be suspended. #[serde( rename = "absent-participation-accounts", skip_serializing_if = "Option::is_none" diff --git a/crates/indexer_client/src/models/resource_ref.rs b/crates/indexer_client/src/models/resource_ref.rs index 122ab8955..2b9f423fb 100644 --- a/crates/indexer_client/src/models/resource_ref.rs +++ b/crates/indexer_client/src/models/resource_ref.rs @@ -16,16 +16,15 @@ use crate::models::LocalsRef; /// ResourceRef names a single resource. Only one of the fields should be set. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ResourceRef { - /// \[d\] Account whose balance record is accessible by the executing ApprovalProgram or ClearStateProgram. + /// [d] Account whose balance record is accessible by the executing ApprovalProgram or ClearStateProgram. #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, - /// \[p\] Application id whose GlobalState may be read by the executing + /// [p] Application id whose GlobalState may be read by the executing /// ApprovalProgram or ClearStateProgram. #[serde(rename = "application-id", skip_serializing_if = "Option::is_none")] pub application_id: Option, - /// \[s\] Asset whose AssetParams may be read by the executing + /// [s] Asset whose AssetParams may be read by the executing /// ApprovalProgram or ClearStateProgram. #[serde(rename = "asset-id", skip_serializing_if = "Option::is_none")] pub asset_id: Option, diff --git a/crates/indexer_client/src/models/search_for_accounts.rs b/crates/indexer_client/src/models/search_for_accounts.rs index 9e27b4feb..10bee28a7 100644 --- a/crates/indexer_client/src/models/search_for_accounts.rs +++ b/crates/indexer_client/src/models/search_for_accounts.rs @@ -14,7 +14,6 @@ use crate::models::Account; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SearchForAccounts { #[serde(rename = "accounts")] pub accounts: Vec, diff --git a/crates/indexer_client/src/models/search_for_application_boxes.rs b/crates/indexer_client/src/models/search_for_application_boxes.rs index 8a4c98325..47882991b 100644 --- a/crates/indexer_client/src/models/search_for_application_boxes.rs +++ b/crates/indexer_client/src/models/search_for_application_boxes.rs @@ -14,9 +14,8 @@ use crate::models::BoxDescriptor; /// Box names of an application #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SearchForApplicationBoxes { - /// \[appidx\] application index. + /// [appidx] application index. #[serde(rename = "application-id")] pub application_id: u64, #[serde(rename = "boxes")] diff --git a/crates/indexer_client/src/models/search_for_applications.rs b/crates/indexer_client/src/models/search_for_applications.rs index bb459fcb0..e31502184 100644 --- a/crates/indexer_client/src/models/search_for_applications.rs +++ b/crates/indexer_client/src/models/search_for_applications.rs @@ -14,7 +14,6 @@ use crate::models::Application; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SearchForApplications { #[serde(rename = "applications")] pub applications: Vec, diff --git a/crates/indexer_client/src/models/search_for_assets.rs b/crates/indexer_client/src/models/search_for_assets.rs index e6a40ec62..3ba01f024 100644 --- a/crates/indexer_client/src/models/search_for_assets.rs +++ b/crates/indexer_client/src/models/search_for_assets.rs @@ -14,7 +14,6 @@ use crate::models::Asset; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SearchForAssets { #[serde(rename = "assets")] pub assets: Vec, diff --git a/crates/indexer_client/src/models/search_for_block_headers.rs b/crates/indexer_client/src/models/search_for_block_headers.rs index 49852df8c..0ecf37f32 100644 --- a/crates/indexer_client/src/models/search_for_block_headers.rs +++ b/crates/indexer_client/src/models/search_for_block_headers.rs @@ -14,7 +14,6 @@ use crate::models::Block; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SearchForBlockHeaders { /// Round at which the results were computed. #[serde(rename = "current-round")] diff --git a/crates/indexer_client/src/models/search_for_transactions.rs b/crates/indexer_client/src/models/search_for_transactions.rs index a2302b5f9..19ad8df0a 100644 --- a/crates/indexer_client/src/models/search_for_transactions.rs +++ b/crates/indexer_client/src/models/search_for_transactions.rs @@ -14,7 +14,6 @@ use crate::models::Transaction; /// (empty) #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SearchForTransactions { /// Round at which the results were computed. #[serde(rename = "current-round")] diff --git a/crates/indexer_client/src/models/state_proof_fields.rs b/crates/indexer_client/src/models/state_proof_fields.rs index 93513bbfe..fd68aa785 100644 --- a/crates/indexer_client/src/models/state_proof_fields.rs +++ b/crates/indexer_client/src/models/state_proof_fields.rs @@ -14,32 +14,31 @@ use serde_with::{Bytes, serde_as}; use crate::models::MerkleArrayProof; use crate::models::StateProofReveal; -/// \[sp\] represents a state proof. +/// [sp] represents a state proof. /// /// Definition: /// crypto/stateproof/structs.go : StateProof #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofFields { - /// \[c\] + /// [c] #[serde_as(as = "Option")] #[serde(rename = "sig-commit", skip_serializing_if = "Option::is_none")] pub sig_commit: Option>, - /// \[w\] + /// [w] #[serde(rename = "signed-weight", skip_serializing_if = "Option::is_none")] pub signed_weight: Option, #[serde(rename = "sig-proofs", skip_serializing_if = "Option::is_none")] pub sig_proofs: Option, #[serde(rename = "part-proofs", skip_serializing_if = "Option::is_none")] pub part_proofs: Option, - /// \[v\] Salt version of the merkle signature. + /// [v] Salt version of the merkle signature. #[serde(rename = "salt-version", skip_serializing_if = "Option::is_none")] pub salt_version: Option, - /// \[r\] Note that this is actually stored as a map[uint64] - Reveal in the actual msgp + /// [r] Note that this is actually stored as a map[uint64] - Reveal in the actual msgp #[serde(rename = "reveals", skip_serializing_if = "Option::is_none")] pub reveals: Option>, - /// \[pr\] Sequence of reveal positions. + /// [pr] Sequence of reveal positions. #[serde( rename = "positions-to-reveal", skip_serializing_if = "Option::is_none" diff --git a/crates/indexer_client/src/models/state_proof_participant.rs b/crates/indexer_client/src/models/state_proof_participant.rs index 813edc0f1..ce317dcc6 100644 --- a/crates/indexer_client/src/models/state_proof_participant.rs +++ b/crates/indexer_client/src/models/state_proof_participant.rs @@ -13,11 +13,10 @@ use serde::{Deserialize, Serialize}; use crate::models::StateProofVerifier; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofParticipant { #[serde(rename = "verifier", skip_serializing_if = "Option::is_none")] pub verifier: Option, - /// \[w\] + /// [w] #[serde(rename = "weight", skip_serializing_if = "Option::is_none")] pub weight: Option, } diff --git a/crates/indexer_client/src/models/state_proof_reveal.rs b/crates/indexer_client/src/models/state_proof_reveal.rs index 7f6d503b5..66fe50cab 100644 --- a/crates/indexer_client/src/models/state_proof_reveal.rs +++ b/crates/indexer_client/src/models/state_proof_reveal.rs @@ -14,7 +14,6 @@ use crate::models::StateProofParticipant; use crate::models::StateProofSigSlot; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofReveal { /// The position in the signature and participants arrays corresponding to this entry. #[serde(rename = "position", skip_serializing_if = "Option::is_none")] diff --git a/crates/indexer_client/src/models/state_proof_sig_slot.rs b/crates/indexer_client/src/models/state_proof_sig_slot.rs index c7e2adae8..4138903a9 100644 --- a/crates/indexer_client/src/models/state_proof_sig_slot.rs +++ b/crates/indexer_client/src/models/state_proof_sig_slot.rs @@ -13,11 +13,10 @@ use serde::{Deserialize, Serialize}; use crate::models::StateProofSignature; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofSigSlot { #[serde(rename = "signature", skip_serializing_if = "Option::is_none")] pub signature: Option, - /// \[l\] The total weight of signatures in the lower-numbered slots. + /// [l] The total weight of signatures in the lower-numbered slots. #[serde(rename = "lower-sig-weight", skip_serializing_if = "Option::is_none")] pub lower_sig_weight: Option, } diff --git a/crates/indexer_client/src/models/state_proof_signature.rs b/crates/indexer_client/src/models/state_proof_signature.rs index b6cb9963c..74d86656a 100644 --- a/crates/indexer_client/src/models/state_proof_signature.rs +++ b/crates/indexer_client/src/models/state_proof_signature.rs @@ -15,7 +15,6 @@ use crate::models::MerkleArrayProof; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofSignature { #[serde_as(as = "Option")] #[serde(rename = "falcon-signature", skip_serializing_if = "Option::is_none")] @@ -24,7 +23,7 @@ pub struct StateProofSignature { pub merkle_array_index: Option, #[serde(rename = "proof", skip_serializing_if = "Option::is_none")] pub proof: Option, - /// \[vkey\] + /// [vkey] #[serde_as(as = "Option")] #[serde(rename = "verifying-key", skip_serializing_if = "Option::is_none")] pub verifying_key: Option>, diff --git a/crates/indexer_client/src/models/state_proof_tracking.rs b/crates/indexer_client/src/models/state_proof_tracking.rs index 6469f09b4..2510a561a 100644 --- a/crates/indexer_client/src/models/state_proof_tracking.rs +++ b/crates/indexer_client/src/models/state_proof_tracking.rs @@ -13,22 +13,21 @@ use serde_with::{Bytes, serde_as}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofTracking { /// State Proof Type. Note the raw object uses map with this as key. #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, - /// \[v\] Root of a vector commitment containing online accounts that will help sign the proof. + /// [v] Root of a vector commitment containing online accounts that will help sign the proof. #[serde_as(as = "Option")] #[serde(rename = "voters-commitment", skip_serializing_if = "Option::is_none")] pub voters_commitment: Option>, - /// \[t\] The total number of microalgos held by the online accounts during the StateProof round. + /// [t] The total number of microalgos held by the online accounts during the StateProof round. #[serde( rename = "online-total-weight", skip_serializing_if = "Option::is_none" )] pub online_total_weight: Option, - /// \[n\] Next round for which we will accept a state proof transaction. + /// [n] Next round for which we will accept a state proof transaction. #[serde(rename = "next-round", skip_serializing_if = "Option::is_none")] pub next_round: Option, } diff --git a/crates/indexer_client/src/models/state_proof_verifier.rs b/crates/indexer_client/src/models/state_proof_verifier.rs index 16fef9b79..64b620ffa 100644 --- a/crates/indexer_client/src/models/state_proof_verifier.rs +++ b/crates/indexer_client/src/models/state_proof_verifier.rs @@ -13,13 +13,12 @@ use serde_with::{Bytes, serde_as}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateProofVerifier { - /// \[cmt\] Represents the root of the vector commitment tree. + /// [cmt] Represents the root of the vector commitment tree. #[serde_as(as = "Option")] #[serde(rename = "commitment", skip_serializing_if = "Option::is_none")] pub commitment: Option>, - /// \[lf\] Key lifetime. + /// [lf] Key lifetime. #[serde(rename = "key-lifetime", skip_serializing_if = "Option::is_none")] pub key_lifetime: Option, } diff --git a/crates/indexer_client/src/models/state_schema.rs b/crates/indexer_client/src/models/state_schema.rs index a603cd776..cf5ae2046 100644 --- a/crates/indexer_client/src/models/state_schema.rs +++ b/crates/indexer_client/src/models/state_schema.rs @@ -10,9 +10,8 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// Represents a \[apls\] local-state or \[apgs\] global-state schema. These schemas determine how much storage may be used in a local-state or global-state for an application. The more space used, the larger minimum balance must be maintained in the account holding the data. +/// Represents a [apls] local-state or [apgs] global-state schema. These schemas determine how much storage may be used in a local-state or global-state for an application. The more space used, the larger minimum balance must be maintained in the account holding the data. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct StateSchema { /// Maximum number of TEAL uints that may be stored in the key/value store. #[serde(rename = "num-uint")] diff --git a/crates/indexer_client/src/models/teal_key_value.rs b/crates/indexer_client/src/models/teal_key_value.rs index 390bd07f6..f4f10eeb9 100644 --- a/crates/indexer_client/src/models/teal_key_value.rs +++ b/crates/indexer_client/src/models/teal_key_value.rs @@ -14,7 +14,6 @@ use crate::models::TealValue; /// Represents a key-value pair in an application store. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealKeyValue { #[serde(rename = "key")] pub key: String, diff --git a/crates/indexer_client/src/models/teal_value.rs b/crates/indexer_client/src/models/teal_value.rs index c5f34712f..de880ea31 100644 --- a/crates/indexer_client/src/models/teal_value.rs +++ b/crates/indexer_client/src/models/teal_value.rs @@ -14,7 +14,6 @@ use serde_with::{Bytes, serde_as}; /// Represents a TEAL value. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TealValue { /// type of the value. Value `1` refers to **bytes**, value `2` refers to **uint** #[serde(rename = "type")] diff --git a/crates/indexer_client/src/models/transaction.rs b/crates/indexer_client/src/models/transaction.rs index eb9bb1aad..f49e709d3 100644 --- a/crates/indexer_client/src/models/transaction.rs +++ b/crates/indexer_client/src/models/transaction.rs @@ -30,7 +30,6 @@ use crate::models::TransactionStateProof; /// data/transactions/transaction.go : Transaction #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Transaction { #[serde( rename = "application-transaction", @@ -62,13 +61,13 @@ pub struct Transaction { skip_serializing_if = "Option::is_none" )] pub heartbeat_transaction: Option, - /// \[sgnr\] this is included with signed transactions when the signing address does not equal the sender. The backend can use this to ensure that auth addr is equal to the accounts auth addr. + /// [sgnr] this is included with signed transactions when the signing address does not equal the sender. The backend can use this to ensure that auth addr is equal to the accounts auth addr. #[serde(rename = "auth-addr", skip_serializing_if = "Option::is_none")] pub auth_addr: Option, - /// \[rc\] rewards applied to close-remainder-to account. + /// [rc] rewards applied to close-remainder-to account. #[serde(rename = "close-rewards", skip_serializing_if = "Option::is_none")] pub close_rewards: Option, - /// \[ca\] closing amount for transaction. + /// [ca] closing amount for transaction. #[serde(rename = "closing-amount", skip_serializing_if = "Option::is_none")] pub closing_amount: Option, /// Round when the transaction was confirmed. @@ -86,20 +85,20 @@ pub struct Transaction { skip_serializing_if = "Option::is_none" )] pub created_asset_index: Option, - /// \[fee\] Transaction fee. + /// [fee] Transaction fee. #[serde(rename = "fee")] pub fee: u64, - /// \[fv\] First valid round for this transaction. + /// [fv] First valid round for this transaction. #[serde(rename = "first-valid")] pub first_valid: u32, - /// \[gh\] Hash of genesis block. + /// [gh] Hash of genesis block. #[serde_as(as = "Option")] #[serde(rename = "genesis-hash", skip_serializing_if = "Option::is_none")] pub genesis_hash: Option>, - /// \[gen\] genesis block ID. + /// [gen] genesis block ID. #[serde(rename = "genesis-id", skip_serializing_if = "Option::is_none")] pub genesis_id: Option, - /// \[grp\] Base64 encoded byte array of a sha512/256 digest. When present indicates that this transaction is part of a transaction group and the value is the sha512/256 hash of the transactions in that group. + /// [grp] Base64 encoded byte array of a sha512/256 digest. When present indicates that this transaction is part of a transaction group and the value is the sha512/256 hash of the transactions in that group. #[serde_as(as = "Option")] #[serde(rename = "group", skip_serializing_if = "Option::is_none")] pub group: Option>, @@ -111,14 +110,14 @@ pub struct Transaction { pub intra_round_offset: Option, #[serde(rename = "keyreg-transaction", skip_serializing_if = "Option::is_none")] pub keyreg_transaction: Option, - /// \[lv\] Last valid round for this transaction. + /// [lv] Last valid round for this transaction. #[serde(rename = "last-valid")] pub last_valid: u32, - /// \[lx\] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes. While this transaction possesses the lease, no other transaction specifying this lease can be confirmed. + /// [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes. While this transaction possesses the lease, no other transaction specifying this lease can be confirmed. #[serde_as(as = "Option")] #[serde(rename = "lease", skip_serializing_if = "Option::is_none")] pub lease: Option>, - /// \[note\] Free form data. + /// [note] Free form data. #[serde_as(as = "Option")] #[serde(rename = "note", skip_serializing_if = "Option::is_none")] pub note: Option>, @@ -127,42 +126,42 @@ pub struct Transaction { skip_serializing_if = "Option::is_none" )] pub payment_transaction: Option, - /// \[rr\] rewards applied to receiver account. + /// [rr] rewards applied to receiver account. #[serde(rename = "receiver-rewards", skip_serializing_if = "Option::is_none")] pub receiver_rewards: Option, - /// \[rekey\] when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address. + /// [rekey] when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address. #[serde(rename = "rekey-to", skip_serializing_if = "Option::is_none")] pub rekey_to: Option, /// Time when the block this transaction is in was confirmed. #[serde(rename = "round-time", skip_serializing_if = "Option::is_none")] pub round_time: Option, - /// \[snd\] Sender's address. + /// [snd] Sender's address. #[serde(rename = "sender")] pub sender: String, - /// \[rs\] rewards applied to sender account. + /// [rs] rewards applied to sender account. #[serde(rename = "sender-rewards", skip_serializing_if = "Option::is_none")] pub sender_rewards: Option, #[serde(rename = "signature", skip_serializing_if = "Option::is_none")] pub signature: Option, - /// \[type\] Indicates what type of transaction this is. Different types have different fields. + /// [type] Indicates what type of transaction this is. Different types have different fields. /// /// Valid types, and where their fields are stored: - /// * \[pay\] payment-transaction - /// * \[keyreg\] keyreg-transaction - /// * \[acfg\] asset-config-transaction - /// * \[axfer\] asset-transfer-transaction - /// * \[afrz\] asset-freeze-transaction - /// * \[appl\] application-transaction - /// * \[stpf\] state-proof-transaction - /// * \[hb\] heartbeat-transaction + /// * [pay] payment-transaction + /// * [keyreg] keyreg-transaction + /// * [acfg] asset-config-transaction + /// * [axfer] asset-transfer-transaction + /// * [afrz] asset-freeze-transaction + /// * [appl] application-transaction + /// * [stpf] state-proof-transaction + /// * [hb] heartbeat-transaction #[serde(rename = "tx-type")] pub tx_type: String, - /// \[ld\] Local state key/value changes for the application being executed by this transaction. + /// [ld] Local state key/value changes for the application being executed by this transaction. #[serde(rename = "local-state-delta", skip_serializing_if = "Option::is_none")] pub local_state_delta: Option>, #[serde(rename = "global-state-delta", skip_serializing_if = "Option::is_none")] pub global_state_delta: Option, - /// \[lg\] Logs for the application being executed by this transaction. + /// [lg] Logs for the application being executed by this transaction. #[serde_as(as = "Option>")] #[serde(rename = "logs", skip_serializing_if = "Option::is_none")] pub logs: Option>>, diff --git a/crates/indexer_client/src/models/transaction_application.rs b/crates/indexer_client/src/models/transaction_application.rs index b1cf7e0ca..cdd007697 100644 --- a/crates/indexer_client/src/models/transaction_application.rs +++ b/crates/indexer_client/src/models/transaction_application.rs @@ -22,29 +22,28 @@ use crate::models::StateSchema; /// data/transactions/application.go : ApplicationCallTxnFields #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionApplication { - /// \[apid\] ID of the application being configured or empty if creating. + /// [apid] ID of the application being configured or empty if creating. #[serde(rename = "application-id")] pub application_id: u64, #[serde(rename = "on-completion")] pub on_completion: OnCompletion, - /// \[apaa\] transaction specific arguments accessed from the application's approval-program and clear-state-program. + /// [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. #[serde(rename = "application-args", skip_serializing_if = "Option::is_none")] pub application_args: Option>, - /// \[al\] Access unifies `accounts`, `foreign-apps`, `foreign-assets`, and `box-references` under a single list. If access is non-empty, these lists must be empty. If access is empty, those lists may be non-empty. + /// [al] Access unifies `accounts`, `foreign-apps`, `foreign-assets`, and `box-references` under a single list. If access is non-empty, these lists must be empty. If access is empty, those lists may be non-empty. #[serde(rename = "access", skip_serializing_if = "Option::is_none")] pub access: Option>, - /// \[apat\] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. + /// [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. #[serde(rename = "accounts", skip_serializing_if = "Option::is_none")] pub accounts: Option>, - /// \[apbx\] the boxes that can be accessed by this transaction (and others in the same group). + /// [apbx] the boxes that can be accessed by this transaction (and others in the same group). #[serde(rename = "box-references", skip_serializing_if = "Option::is_none")] pub box_references: Option>, - /// \[apfa\] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. + /// [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. #[serde(rename = "foreign-apps", skip_serializing_if = "Option::is_none")] pub foreign_apps: Option>, - /// \[apas\] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. + /// [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. #[serde(rename = "foreign-assets", skip_serializing_if = "Option::is_none")] pub foreign_assets: Option>, #[serde(rename = "local-state-schema", skip_serializing_if = "Option::is_none")] @@ -54,24 +53,24 @@ pub struct TransactionApplication { skip_serializing_if = "Option::is_none" )] pub global_state_schema: Option, - /// \[apap\] Logic executed for every application transaction, except when on-completion is set to "clear". It can read and write global state for the application, as well as account-specific local state. Approval programs may reject the transaction. + /// [apap] Logic executed for every application transaction, except when on-completion is set to "clear". It can read and write global state for the application, as well as account-specific local state. Approval programs may reject the transaction. #[serde_as(as = "Option")] #[serde(rename = "approval-program", skip_serializing_if = "Option::is_none")] pub approval_program: Option>, - /// \[apsu\] Logic executed for application transactions with on-completion set to "clear". It can read and write global state for the application, as well as account-specific local state. Clear state programs cannot reject the transaction. + /// [apsu] Logic executed for application transactions with on-completion set to "clear". It can read and write global state for the application, as well as account-specific local state. Clear state programs cannot reject the transaction. #[serde_as(as = "Option")] #[serde( rename = "clear-state-program", skip_serializing_if = "Option::is_none" )] pub clear_state_program: Option>, - /// \[epp\] specifies the additional app program len requested in pages. + /// [epp] specifies the additional app program len requested in pages. #[serde( rename = "extra-program-pages", skip_serializing_if = "Option::is_none" )] pub extra_program_pages: Option, - /// \[aprv\] the lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed. + /// [aprv] the lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed. #[serde(rename = "reject-version", skip_serializing_if = "Option::is_none")] pub reject_version: Option, } diff --git a/crates/indexer_client/src/models/transaction_asset_config.rs b/crates/indexer_client/src/models/transaction_asset_config.rs index 4ee3541c3..d8ea01c0f 100644 --- a/crates/indexer_client/src/models/transaction_asset_config.rs +++ b/crates/indexer_client/src/models/transaction_asset_config.rs @@ -21,9 +21,8 @@ use crate::models::AssetParams; /// Definition: /// data/transactions/asset.go : AssetConfigTxnFields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionAssetConfig { - /// \[xaid\] ID of the asset being configured or empty if creating. + /// [xaid] ID of the asset being configured or empty if creating. #[serde(rename = "asset-id", skip_serializing_if = "Option::is_none")] pub asset_id: Option, #[serde(rename = "params", skip_serializing_if = "Option::is_none")] diff --git a/crates/indexer_client/src/models/transaction_asset_freeze.rs b/crates/indexer_client/src/models/transaction_asset_freeze.rs index 393225afa..dd1bc5ba4 100644 --- a/crates/indexer_client/src/models/transaction_asset_freeze.rs +++ b/crates/indexer_client/src/models/transaction_asset_freeze.rs @@ -15,15 +15,14 @@ use serde::{Deserialize, Serialize}; /// Definition: /// data/transactions/asset.go : AssetFreezeTxnFields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionAssetFreeze { - /// \[fadd\] Address of the account whose asset is being frozen or thawed. + /// [fadd] Address of the account whose asset is being frozen or thawed. #[serde(rename = "address")] pub address: String, - /// \[faid\] ID of the asset being frozen or thawed. + /// [faid] ID of the asset being frozen or thawed. #[serde(rename = "asset-id")] pub asset_id: u64, - /// \[afrz\] The new freeze status. + /// [afrz] The new freeze status. #[serde(rename = "new-freeze-status")] pub new_freeze_status: bool, } diff --git a/crates/indexer_client/src/models/transaction_asset_transfer.rs b/crates/indexer_client/src/models/transaction_asset_transfer.rs index 3c01656e1..43b9507bb 100644 --- a/crates/indexer_client/src/models/transaction_asset_transfer.rs +++ b/crates/indexer_client/src/models/transaction_asset_transfer.rs @@ -15,24 +15,23 @@ use serde::{Deserialize, Serialize}; /// Definition: /// data/transactions/asset.go : AssetTransferTxnFields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionAssetTransfer { - /// \[aamt\] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. + /// [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. #[serde(rename = "amount")] pub amount: u64, - /// \[xaid\] ID of the asset being transferred. + /// [xaid] ID of the asset being transferred. #[serde(rename = "asset-id")] pub asset_id: u64, /// Number of assets transferred to the close-to account as part of the transaction. #[serde(rename = "close-amount", skip_serializing_if = "Option::is_none")] pub close_amount: Option, - /// \[aclose\] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. + /// [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. #[serde(rename = "close-to", skip_serializing_if = "Option::is_none")] pub close_to: Option, - /// \[arcv\] Recipient address of the transfer. + /// [arcv] Recipient address of the transfer. #[serde(rename = "receiver")] pub receiver: String, - /// \[asnd\] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. + /// [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. #[serde(rename = "sender", skip_serializing_if = "Option::is_none")] pub sender: Option, } diff --git a/crates/indexer_client/src/models/transaction_heartbeat.rs b/crates/indexer_client/src/models/transaction_heartbeat.rs index fcecd40fa..018c2dc5a 100644 --- a/crates/indexer_client/src/models/transaction_heartbeat.rs +++ b/crates/indexer_client/src/models/transaction_heartbeat.rs @@ -19,22 +19,21 @@ use crate::models::HbProofFields; /// data/transactions/heartbeat.go : HeartbeatTxnFields #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionHeartbeat { - /// \[hbad\] HbAddress is the account this txn is proving onlineness for. + /// [hbad] HbAddress is the account this txn is proving onlineness for. #[serde(rename = "hb-address")] pub hb_address: String, #[serde(rename = "hb-proof")] pub hb_proof: HbProofFields, - /// \[hbsd\] HbSeed must be the block seed for the this transaction's firstValid block. + /// [hbsd] HbSeed must be the block seed for the this transaction's firstValid block. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "hb-seed")] pub hb_seed: Vec, - /// \[hbvid\] HbVoteID must match the HbAddress account's current VoteID. + /// [hbvid] HbVoteID must match the HbAddress account's current VoteID. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "hb-vote-id")] pub hb_vote_id: Vec, - /// \[hbkd\] HbKeyDilution must match HbAddress account's current KeyDilution. + /// [hbkd] HbKeyDilution must match HbAddress account's current KeyDilution. #[serde(rename = "hb-key-dilution")] pub hb_key_dilution: u64, } diff --git a/crates/indexer_client/src/models/transaction_keyreg.rs b/crates/indexer_client/src/models/transaction_keyreg.rs index f273c8729..24a069be7 100644 --- a/crates/indexer_client/src/models/transaction_keyreg.rs +++ b/crates/indexer_client/src/models/transaction_keyreg.rs @@ -17,35 +17,34 @@ use serde_with::{Bytes, serde_as}; /// data/transactions/keyreg.go : KeyregTxnFields #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionKeyreg { - /// \[nonpart\] Mark the account as participating or non-participating. + /// [nonpart] Mark the account as participating or non-participating. #[serde(rename = "non-participation", skip_serializing_if = "Option::is_none")] pub non_participation: Option, - /// \[selkey\] Public key used with the Verified Random Function (VRF) result during committee selection. + /// [selkey] Public key used with the Verified Random Function (VRF) result during committee selection. #[serde_as(as = "Option")] #[serde( rename = "selection-participation-key", skip_serializing_if = "Option::is_none" )] pub selection_participation_key: Option>, - /// \[votefst\] First round this participation key is valid. + /// [votefst] First round this participation key is valid. #[serde(rename = "vote-first-valid", skip_serializing_if = "Option::is_none")] pub vote_first_valid: Option, - /// \[votekd\] Number of subkeys in each batch of participation keys. + /// [votekd] Number of subkeys in each batch of participation keys. #[serde(rename = "vote-key-dilution", skip_serializing_if = "Option::is_none")] pub vote_key_dilution: Option, - /// \[votelst\] Last round this participation key is valid. + /// [votelst] Last round this participation key is valid. #[serde(rename = "vote-last-valid", skip_serializing_if = "Option::is_none")] pub vote_last_valid: Option, - /// \[votekey\] Participation public key used in key registration transactions. + /// [votekey] Participation public key used in key registration transactions. #[serde_as(as = "Option")] #[serde( rename = "vote-participation-key", skip_serializing_if = "Option::is_none" )] pub vote_participation_key: Option>, - /// \[sprfkey\] State proof key used in key registration transactions. + /// [sprfkey] State proof key used in key registration transactions. #[serde_as(as = "Option")] #[serde(rename = "state-proof-key", skip_serializing_if = "Option::is_none")] pub state_proof_key: Option>, diff --git a/crates/indexer_client/src/models/transaction_payment.rs b/crates/indexer_client/src/models/transaction_payment.rs index e480043eb..aec93906a 100644 --- a/crates/indexer_client/src/models/transaction_payment.rs +++ b/crates/indexer_client/src/models/transaction_payment.rs @@ -15,18 +15,17 @@ use serde::{Deserialize, Serialize}; /// Definition: /// data/transactions/payment.go : PaymentTxnFields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionPayment { - /// \[amt\] number of MicroAlgos intended to be transferred. + /// [amt] number of MicroAlgos intended to be transferred. #[serde(rename = "amount")] pub amount: u64, /// Number of MicroAlgos that were sent to the close-remainder-to address when closing the sender account. #[serde(rename = "close-amount", skip_serializing_if = "Option::is_none")] pub close_amount: Option, - /// \[close\] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. + /// [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. #[serde(rename = "close-remainder-to", skip_serializing_if = "Option::is_none")] pub close_remainder_to: Option, - /// \[rcv\] receiver's address. + /// [rcv] receiver's address. #[serde(rename = "receiver")] pub receiver: String, } diff --git a/crates/indexer_client/src/models/transaction_signature.rs b/crates/indexer_client/src/models/transaction_signature.rs index 02b6dbbac..4a01691fe 100644 --- a/crates/indexer_client/src/models/transaction_signature.rs +++ b/crates/indexer_client/src/models/transaction_signature.rs @@ -17,13 +17,12 @@ use crate::models::TransactionSignatureMultisig; /// Validation signature associated with some data. Only one of the signatures should be provided. #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionSignature { #[serde(rename = "logicsig", skip_serializing_if = "Option::is_none")] pub logicsig: Option, #[serde(rename = "multisig", skip_serializing_if = "Option::is_none")] pub multisig: Option, - /// \[sig\] Standard ed25519 signature. + /// [sig] Standard ed25519 signature. #[serde_as(as = "Option")] #[serde(rename = "sig", skip_serializing_if = "Option::is_none")] pub sig: Option>, diff --git a/crates/indexer_client/src/models/transaction_signature_logicsig.rs b/crates/indexer_client/src/models/transaction_signature_logicsig.rs index e1a9dbec3..45489c9cb 100644 --- a/crates/indexer_client/src/models/transaction_signature_logicsig.rs +++ b/crates/indexer_client/src/models/transaction_signature_logicsig.rs @@ -13,19 +13,18 @@ use serde_with::{Bytes, serde_as}; use crate::models::TransactionSignatureMultisig; -/// \[lsig\] Programatic transaction signature. +/// [lsig] Programatic transaction signature. /// /// Definition: /// data/transactions/logicsig.go #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionSignatureLogicsig { - /// \[arg\] Logic arguments, base64 encoded. + /// [arg] Logic arguments, base64 encoded. #[serde_as(as = "Option")] #[serde(rename = "args", skip_serializing_if = "Option::is_none")] pub args: Option>, - /// \[l\] Program signed by a signature or multi signature, or hashed to be the address of an account. Base64 encoded TEAL program. + /// [l] Program signed by a signature or multi signature, or hashed to be the address of an account. Base64 encoded TEAL program. #[serde_as(as = "serde_with::base64::Base64")] #[serde(rename = "logic")] pub logic: Vec, @@ -36,7 +35,7 @@ pub struct TransactionSignatureLogicsig { skip_serializing_if = "Option::is_none" )] pub logic_multisig_signature: Option, - /// \[sig\] ed25519 signature. + /// [sig] ed25519 signature. #[serde_as(as = "Option")] #[serde(rename = "signature", skip_serializing_if = "Option::is_none")] pub signature: Option>, diff --git a/crates/indexer_client/src/models/transaction_signature_multisig.rs b/crates/indexer_client/src/models/transaction_signature_multisig.rs index 0ff6c3290..ded8a5583 100644 --- a/crates/indexer_client/src/models/transaction_signature_multisig.rs +++ b/crates/indexer_client/src/models/transaction_signature_multisig.rs @@ -17,15 +17,14 @@ use crate::models::TransactionSignatureMultisigSubsignature; /// Definition: /// crypto/multisig.go : MultisigSig #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionSignatureMultisig { - /// \[subsig\] holds pairs of public key and signatures. + /// [subsig] holds pairs of public key and signatures. #[serde(rename = "subsignature", skip_serializing_if = "Option::is_none")] pub subsignature: Option>, - /// \[thr\] + /// [thr] #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] pub threshold: Option, - /// \[v\] + /// [v] #[serde(rename = "version", skip_serializing_if = "Option::is_none")] pub version: Option, } diff --git a/crates/indexer_client/src/models/transaction_signature_multisig_subsignature.rs b/crates/indexer_client/src/models/transaction_signature_multisig_subsignature.rs index 4cef823b3..66baf96c1 100644 --- a/crates/indexer_client/src/models/transaction_signature_multisig_subsignature.rs +++ b/crates/indexer_client/src/models/transaction_signature_multisig_subsignature.rs @@ -13,13 +13,12 @@ use serde_with::{Bytes, serde_as}; #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionSignatureMultisigSubsignature { - /// \[pk\] + /// [pk] #[serde_as(as = "Option")] #[serde(rename = "public-key", skip_serializing_if = "Option::is_none")] pub public_key: Option>, - /// \[s\] + /// [s] #[serde_as(as = "Option")] #[serde(rename = "signature", skip_serializing_if = "Option::is_none")] pub signature: Option>, diff --git a/crates/indexer_client/src/models/transaction_state_proof.rs b/crates/indexer_client/src/models/transaction_state_proof.rs index 811b0f4ba..25aa6221d 100644 --- a/crates/indexer_client/src/models/transaction_state_proof.rs +++ b/crates/indexer_client/src/models/transaction_state_proof.rs @@ -18,9 +18,8 @@ use crate::models::StateProofFields; /// Definition: /// data/transactions/stateproof.go : StateProofTxnFields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct TransactionStateProof { - /// \[sptype\] Type of the state proof. Integer representing an entry defined in protocol/stateproof.go + /// [sptype] Type of the state proof. Integer representing an entry defined in protocol/stateproof.go #[serde(rename = "state-proof-type", skip_serializing_if = "Option::is_none")] pub state_proof_type: Option, #[serde(rename = "state-proof", skip_serializing_if = "Option::is_none")] diff --git a/crates/kmd_client/Cargo.toml b/crates/kmd_client/Cargo.toml index 347490f27..c2ffef31b 100644 --- a/crates/kmd_client/Cargo.toml +++ b/crates/kmd_client/Cargo.toml @@ -9,9 +9,13 @@ edition = "2024" [features] default = ["default_client"] default_client = ["algokit_http_client/default_client"] -ffi_uniffi = ["dep:uniffi", "algokit_http_client/ffi_uniffi", "dep:algokit_transact_ffi"] [dependencies] +serde_json = "^1.0" + +# Error handling +snafu = { workspace = true } + # Core serialization serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = [ @@ -19,26 +23,17 @@ serde_with = { version = "^3.8", default-features = false, features = [ "std", "macros", ] } -serde_json = "^1.0" serde_repr = "^0.1" serde_bytes = "^0.11" # HTTP client -algokit_http_client = { path = "../algokit_http_client", features = ["ffi_uniffi"] } +algokit_http_client = { path = "../algokit_http_client" } url = "^2.5" -# Uniffi for FFI bindings -uniffi = { workspace = true, optional = true } -algokit_transact_ffi = { optional = true, version = "0.1.0", path = "../algokit_transact_ffi" } - - -# Error handling -snafu = { workspace = true } # Utilities base64 = "^0.22" uuid = { version = "^1.0", features = ["v4"] } - [dev-dependencies] tokio = { version = "1.0", features = ["full"] } tokio-test = "^0.4" \ No newline at end of file diff --git a/crates/kmd_client/src/apis/client.rs b/crates/kmd_client/src/apis/client.rs index 6d6204a42..45ef8f53e 100644 --- a/crates/kmd_client/src/apis/client.rs +++ b/crates/kmd_client/src/apis/client.rs @@ -35,22 +35,18 @@ use std::sync::Arc; /// It wraps the lower-level endpoint functions with a more ergonomic interface. /// All methods return a unified `Error` type that can represent any endpoint error. #[derive(Clone)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Object))] pub struct KmdClient { http_client: Arc, } -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] impl KmdClient { /// Create a new KmdClient with a custom http client. - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn new(http_client: Arc) -> Self { Self { http_client } } /// Create a new KmdClient for Algorand TestNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn testnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new("http://localhost:7833")); Self::new(http_client) @@ -58,7 +54,6 @@ impl KmdClient { /// Create a new KmdClient for Algorand MainNet. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn mainnet() -> Self { let http_client = Arc::new(DefaultHttpClient::new("http://localhost:7833")); Self::new(http_client) @@ -66,7 +61,6 @@ impl KmdClient { /// Create a new KmdClient for a local localnet environment. #[cfg(feature = "default_client")] - #[cfg_attr(feature = "ffi_uniffi", uniffi::constructor)] pub fn localnet() -> Self { let http_client = Arc::new( DefaultHttpClient::with_header( @@ -78,11 +72,11 @@ impl KmdClient { ); Self::new(http_client) } +} +impl KmdClient { /// Gets the current swagger spec. pub async fn swagger_handler(&self) -> Result { - let result = super::swagger_handler::swagger_handler(self.http_client.as_ref()).await; - - result + super::swagger_handler::swagger_handler(self.http_client.as_ref()).await } /// Generate a key @@ -90,16 +84,12 @@ impl KmdClient { &self, request: GenerateKeyRequest, ) -> Result { - let result = super::generate_key::generate_key(self.http_client.as_ref(), request).await; - - result + super::generate_key::generate_key(self.http_client.as_ref(), request).await } /// Delete a key pub async fn delete_key(&self) -> Result { - let result = super::delete_key::delete_key(self.http_client.as_ref()).await; - - result + super::delete_key::delete_key(self.http_client.as_ref()).await } /// Export a key @@ -107,9 +97,7 @@ impl KmdClient { &self, request: ExportKeyRequest, ) -> Result { - let result = super::export_key::export_key(self.http_client.as_ref(), request).await; - - result + super::export_key::export_key(self.http_client.as_ref(), request).await } /// Import a key @@ -117,9 +105,7 @@ impl KmdClient { &self, request: ImportKeyRequest, ) -> Result { - let result = super::import_key::import_key(self.http_client.as_ref(), request).await; - - result + super::import_key::import_key(self.http_client.as_ref(), request).await } /// List keys in wallet @@ -127,11 +113,7 @@ impl KmdClient { &self, request: ListKeysRequest, ) -> Result { - let result = - super::list_keys_in_wallet::list_keys_in_wallet(self.http_client.as_ref(), request) - .await; - - result + super::list_keys_in_wallet::list_keys_in_wallet(self.http_client.as_ref(), request).await } /// Export the master derivation key from a wallet @@ -139,17 +121,12 @@ impl KmdClient { &self, request: ExportMasterKeyRequest, ) -> Result { - let result = - super::export_master_key::export_master_key(self.http_client.as_ref(), request).await; - - result + super::export_master_key::export_master_key(self.http_client.as_ref(), request).await } /// Delete a multisig pub async fn delete_multisig(&self) -> Result { - let result = super::delete_multisig::delete_multisig(self.http_client.as_ref()).await; - - result + super::delete_multisig::delete_multisig(self.http_client.as_ref()).await } /// Export multisig address metadata @@ -157,10 +134,7 @@ impl KmdClient { &self, request: ExportMultisigRequest, ) -> Result { - let result = - super::export_multisig::export_multisig(self.http_client.as_ref(), request).await; - - result + super::export_multisig::export_multisig(self.http_client.as_ref(), request).await } /// Import a multisig account @@ -168,10 +142,7 @@ impl KmdClient { &self, request: ImportMultisigRequest, ) -> Result { - let result = - super::import_multisig::import_multisig(self.http_client.as_ref(), request).await; - - result + super::import_multisig::import_multisig(self.http_client.as_ref(), request).await } /// List multisig accounts @@ -179,9 +150,7 @@ impl KmdClient { &self, request: ListMultisigRequest, ) -> Result { - let result = super::list_multisg::list_multisg(self.http_client.as_ref(), request).await; - - result + super::list_multisg::list_multisg(self.http_client.as_ref(), request).await } /// Sign a multisig transaction @@ -189,13 +158,11 @@ impl KmdClient { &self, request: SignMultisigRequest, ) -> Result { - let result = super::sign_multisig_transaction::sign_multisig_transaction( + super::sign_multisig_transaction::sign_multisig_transaction( self.http_client.as_ref(), request, ) - .await; - - result + .await } /// Sign a program for a multisig account @@ -203,11 +170,8 @@ impl KmdClient { &self, request: SignProgramMultisigRequest, ) -> Result { - let result = - super::sign_multisig_program::sign_multisig_program(self.http_client.as_ref(), request) - .await; - - result + super::sign_multisig_program::sign_multisig_program(self.http_client.as_ref(), request) + .await } /// Sign program @@ -215,9 +179,7 @@ impl KmdClient { &self, request: SignProgramRequest, ) -> Result { - let result = super::sign_program::sign_program(self.http_client.as_ref(), request).await; - - result + super::sign_program::sign_program(self.http_client.as_ref(), request).await } /// Sign a transaction @@ -225,10 +187,7 @@ impl KmdClient { &self, request: SignTransactionRequest, ) -> Result { - let result = - super::sign_transaction::sign_transaction(self.http_client.as_ref(), request).await; - - result + super::sign_transaction::sign_transaction(self.http_client.as_ref(), request).await } /// Create a wallet @@ -236,9 +195,7 @@ impl KmdClient { &self, request: CreateWalletRequest, ) -> Result { - let result = super::create_wallet::create_wallet(self.http_client.as_ref(), request).await; - - result + super::create_wallet::create_wallet(self.http_client.as_ref(), request).await } /// Get wallet info @@ -246,10 +203,7 @@ impl KmdClient { &self, request: WalletInfoRequest, ) -> Result { - let result = - super::get_wallet_info::get_wallet_info(self.http_client.as_ref(), request).await; - - result + super::get_wallet_info::get_wallet_info(self.http_client.as_ref(), request).await } /// Initialize a wallet handle token @@ -257,13 +211,11 @@ impl KmdClient { &self, request: InitWalletHandleTokenRequest, ) -> Result { - let result = super::init_wallet_handle_token::init_wallet_handle_token( + super::init_wallet_handle_token::init_wallet_handle_token( self.http_client.as_ref(), request, ) - .await; - - result + .await } /// Release a wallet handle token @@ -271,13 +223,11 @@ impl KmdClient { &self, request: ReleaseWalletHandleTokenRequest, ) -> Result { - let result = super::release_wallet_handle_token::release_wallet_handle_token( + super::release_wallet_handle_token::release_wallet_handle_token( self.http_client.as_ref(), request, ) - .await; - - result + .await } /// Rename a wallet @@ -285,9 +235,7 @@ impl KmdClient { &self, request: RenameWalletRequest, ) -> Result { - let result = super::rename_wallet::rename_wallet(self.http_client.as_ref(), request).await; - - result + super::rename_wallet::rename_wallet(self.http_client.as_ref(), request).await } /// Renew a wallet handle token @@ -295,33 +243,20 @@ impl KmdClient { &self, request: RenewWalletHandleTokenRequest, ) -> Result { - let result = super::renew_wallet_handle_token::renew_wallet_handle_token( + super::renew_wallet_handle_token::renew_wallet_handle_token( self.http_client.as_ref(), request, ) - .await; - - result + .await } /// List wallets pub async fn list_wallets(&self) -> Result { - let result = super::list_wallets::list_wallets(self.http_client.as_ref()).await; - - result + super::list_wallets::list_wallets(self.http_client.as_ref()).await } /// Retrieves the current version pub async fn get_version(&self) -> Result { - let result = super::get_version::get_version(self.http_client.as_ref()).await; - - result + super::get_version::get_version(self.http_client.as_ref()).await } } - -#[cfg(not(feature = "ffi_uniffi"))] -impl KmdClient {} - -#[cfg_attr(feature = "ffi_uniffi", uniffi::export)] -#[cfg(feature = "ffi_uniffi")] -impl KmdClient {} diff --git a/crates/kmd_client/src/apis/create_wallet.rs b/crates/kmd_client/src/apis/create_wallet.rs index 2f9631f1c..ef3fa35c9 100644 --- a/crates/kmd_client/src/apis/create_wallet.rs +++ b/crates/kmd_client/src/apis/create_wallet.rs @@ -23,7 +23,6 @@ use crate::models::CreateWalletRequest; /// struct for typed errors of method [`create_wallet`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum CreateWalletError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/delete_key.rs b/crates/kmd_client/src/apis/delete_key.rs index d2018637d..18a6620f5 100644 --- a/crates/kmd_client/src/apis/delete_key.rs +++ b/crates/kmd_client/src/apis/delete_key.rs @@ -23,7 +23,6 @@ use crate::models::DeleteKeyRequest; /// struct for typed errors of method [`delete_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum DeleteKeyError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/delete_multisig.rs b/crates/kmd_client/src/apis/delete_multisig.rs index 4b2d99766..5e45dbd7b 100644 --- a/crates/kmd_client/src/apis/delete_multisig.rs +++ b/crates/kmd_client/src/apis/delete_multisig.rs @@ -23,7 +23,6 @@ use crate::models::DeleteMultisigRequest; /// struct for typed errors of method [`delete_multisig`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum DeleteMultisigError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/export_key.rs b/crates/kmd_client/src/apis/export_key.rs index c3deb52a5..892cb10b8 100644 --- a/crates/kmd_client/src/apis/export_key.rs +++ b/crates/kmd_client/src/apis/export_key.rs @@ -23,7 +23,6 @@ use crate::models::ExportKeyRequest; /// struct for typed errors of method [`export_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ExportKeyError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/export_master_key.rs b/crates/kmd_client/src/apis/export_master_key.rs index ccdf10647..382c93aa1 100644 --- a/crates/kmd_client/src/apis/export_master_key.rs +++ b/crates/kmd_client/src/apis/export_master_key.rs @@ -23,7 +23,6 @@ use crate::models::ExportMasterKeyRequest; /// struct for typed errors of method [`export_master_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ExportMasterKeyError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/export_multisig.rs b/crates/kmd_client/src/apis/export_multisig.rs index 2e8a47d44..a88ead28a 100644 --- a/crates/kmd_client/src/apis/export_multisig.rs +++ b/crates/kmd_client/src/apis/export_multisig.rs @@ -23,7 +23,6 @@ use crate::models::ExportMultisigRequest; /// struct for typed errors of method [`export_multisig`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ExportMultisigError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/generate_key.rs b/crates/kmd_client/src/apis/generate_key.rs index 58fcda832..deb6b0aa9 100644 --- a/crates/kmd_client/src/apis/generate_key.rs +++ b/crates/kmd_client/src/apis/generate_key.rs @@ -23,7 +23,6 @@ use crate::models::GenerateKeyRequest; /// struct for typed errors of method [`generate_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GenerateKeyError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/get_version.rs b/crates/kmd_client/src/apis/get_version.rs index 1eadf748f..444cde15e 100644 --- a/crates/kmd_client/src/apis/get_version.rs +++ b/crates/kmd_client/src/apis/get_version.rs @@ -23,7 +23,6 @@ use crate::models::VersionsRequest; /// struct for typed errors of method [`get_version`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetVersionError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/get_wallet_info.rs b/crates/kmd_client/src/apis/get_wallet_info.rs index 340f60088..eea389fe4 100644 --- a/crates/kmd_client/src/apis/get_wallet_info.rs +++ b/crates/kmd_client/src/apis/get_wallet_info.rs @@ -23,7 +23,6 @@ use crate::models::WalletInfoRequest; /// struct for typed errors of method [`get_wallet_info`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum GetWalletInfoError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/import_key.rs b/crates/kmd_client/src/apis/import_key.rs index 0984383d6..47ba103d2 100644 --- a/crates/kmd_client/src/apis/import_key.rs +++ b/crates/kmd_client/src/apis/import_key.rs @@ -23,7 +23,6 @@ use crate::models::ImportKeyRequest; /// struct for typed errors of method [`import_key`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ImportKeyError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/import_multisig.rs b/crates/kmd_client/src/apis/import_multisig.rs index 7eb86a13c..43640fb86 100644 --- a/crates/kmd_client/src/apis/import_multisig.rs +++ b/crates/kmd_client/src/apis/import_multisig.rs @@ -23,7 +23,6 @@ use crate::models::ImportMultisigRequest; /// struct for typed errors of method [`import_multisig`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ImportMultisigError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/init_wallet_handle_token.rs b/crates/kmd_client/src/apis/init_wallet_handle_token.rs index 1588ac583..1d226cb8e 100644 --- a/crates/kmd_client/src/apis/init_wallet_handle_token.rs +++ b/crates/kmd_client/src/apis/init_wallet_handle_token.rs @@ -23,7 +23,6 @@ use crate::models::InitWalletHandleTokenRequest; /// struct for typed errors of method [`init_wallet_handle_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum InitWalletHandleTokenError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/list_keys_in_wallet.rs b/crates/kmd_client/src/apis/list_keys_in_wallet.rs index cde78aaa0..81f826705 100644 --- a/crates/kmd_client/src/apis/list_keys_in_wallet.rs +++ b/crates/kmd_client/src/apis/list_keys_in_wallet.rs @@ -23,7 +23,6 @@ use crate::models::ListKeysRequest; /// struct for typed errors of method [`list_keys_in_wallet`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ListKeysInWalletError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/list_multisg.rs b/crates/kmd_client/src/apis/list_multisg.rs index a1cbce03b..9b32fa90e 100644 --- a/crates/kmd_client/src/apis/list_multisg.rs +++ b/crates/kmd_client/src/apis/list_multisg.rs @@ -23,7 +23,6 @@ use crate::models::ListMultisigRequest; /// struct for typed errors of method [`list_multisg`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ListMultisgError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/list_wallets.rs b/crates/kmd_client/src/apis/list_wallets.rs index 1203dc484..b6bbc580b 100644 --- a/crates/kmd_client/src/apis/list_wallets.rs +++ b/crates/kmd_client/src/apis/list_wallets.rs @@ -23,7 +23,6 @@ use crate::models::ListWalletsRequest; /// struct for typed errors of method [`list_wallets`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ListWalletsError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/mod.rs b/crates/kmd_client/src/apis/mod.rs index 2632fdb7b..45eb72b89 100644 --- a/crates/kmd_client/src/apis/mod.rs +++ b/crates/kmd_client/src/apis/mod.rs @@ -40,7 +40,6 @@ use snafu::Snafu; /// Unified error type that can represent any API error from any endpoint #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum KmdApiError { #[snafu(display("Swagger_handler error: {error:?}"))] SwaggerHandler { @@ -270,7 +269,6 @@ impl From for KmdApiError { /// The main error type for all kmd client operations #[derive(Debug, Snafu)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum Error { #[snafu(display("HTTP error: {source}"))] Http { @@ -304,13 +302,13 @@ impl From<&str> for ContentType { } } +// Re-export the consolidated client +pub use client::KmdClient; + pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } -// Re-export the consolidated client -pub use client::KmdClient; - // Re-export all endpoint functions pub use create_wallet::{CreateWalletError, create_wallet}; pub use delete_key::{DeleteKeyError, delete_key}; diff --git a/crates/kmd_client/src/apis/release_wallet_handle_token.rs b/crates/kmd_client/src/apis/release_wallet_handle_token.rs index e40a2bead..f958a6385 100644 --- a/crates/kmd_client/src/apis/release_wallet_handle_token.rs +++ b/crates/kmd_client/src/apis/release_wallet_handle_token.rs @@ -23,7 +23,6 @@ use crate::models::ReleaseWalletHandleTokenRequest; /// struct for typed errors of method [`release_wallet_handle_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum ReleaseWalletHandleTokenError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/rename_wallet.rs b/crates/kmd_client/src/apis/rename_wallet.rs index eda7ec6f0..49162912a 100644 --- a/crates/kmd_client/src/apis/rename_wallet.rs +++ b/crates/kmd_client/src/apis/rename_wallet.rs @@ -23,7 +23,6 @@ use crate::models::RenameWalletRequest; /// struct for typed errors of method [`rename_wallet`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum RenameWalletError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/renew_wallet_handle_token.rs b/crates/kmd_client/src/apis/renew_wallet_handle_token.rs index 2568967ab..426ee6d27 100644 --- a/crates/kmd_client/src/apis/renew_wallet_handle_token.rs +++ b/crates/kmd_client/src/apis/renew_wallet_handle_token.rs @@ -23,7 +23,6 @@ use crate::models::RenewWalletHandleTokenRequest; /// struct for typed errors of method [`renew_wallet_handle_token`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum RenewWalletHandleTokenError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/sign_multisig_program.rs b/crates/kmd_client/src/apis/sign_multisig_program.rs index 8e19814d9..f75c62f21 100644 --- a/crates/kmd_client/src/apis/sign_multisig_program.rs +++ b/crates/kmd_client/src/apis/sign_multisig_program.rs @@ -23,7 +23,6 @@ use crate::models::SignProgramMultisigRequest; /// struct for typed errors of method [`sign_multisig_program`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SignMultisigProgramError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/sign_multisig_transaction.rs b/crates/kmd_client/src/apis/sign_multisig_transaction.rs index f421e8ae3..91de2554b 100644 --- a/crates/kmd_client/src/apis/sign_multisig_transaction.rs +++ b/crates/kmd_client/src/apis/sign_multisig_transaction.rs @@ -23,7 +23,6 @@ use crate::models::SignMultisigRequest; /// struct for typed errors of method [`sign_multisig_transaction`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SignMultisigTransactionError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/sign_program.rs b/crates/kmd_client/src/apis/sign_program.rs index 61eba6b8e..822783945 100644 --- a/crates/kmd_client/src/apis/sign_program.rs +++ b/crates/kmd_client/src/apis/sign_program.rs @@ -23,7 +23,6 @@ use crate::models::SignProgramRequest; /// struct for typed errors of method [`sign_program`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SignProgramError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/sign_transaction.rs b/crates/kmd_client/src/apis/sign_transaction.rs index 5c5cb0e2f..9ecb0f041 100644 --- a/crates/kmd_client/src/apis/sign_transaction.rs +++ b/crates/kmd_client/src/apis/sign_transaction.rs @@ -23,7 +23,6 @@ use crate::models::SignTransactionRequest; /// struct for typed errors of method [`sign_transaction`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SignTransactionError { DefaultResponse(), UnknownValue(crate::models::UnknownJsonValue), diff --git a/crates/kmd_client/src/apis/swagger_handler.rs b/crates/kmd_client/src/apis/swagger_handler.rs index 46e258ab6..f6a8d503c 100644 --- a/crates/kmd_client/src/apis/swagger_handler.rs +++ b/crates/kmd_client/src/apis/swagger_handler.rs @@ -21,7 +21,6 @@ use super::{ContentType, Error, KmdApiError}; /// struct for typed errors of method [`swagger_handler`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Error))] pub enum SwaggerHandlerError { Statusdefault(), DefaultResponse(), diff --git a/crates/kmd_client/src/lib.rs b/crates/kmd_client/src/lib.rs index 8920d62cc..468c2150c 100644 --- a/crates/kmd_client/src/lib.rs +++ b/crates/kmd_client/src/lib.rs @@ -1,9 +1,6 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] -#[cfg(feature = "ffi_uniffi")] -uniffi::setup_scaffolding!(); - pub mod apis; pub mod models; diff --git a/crates/kmd_client/src/models/create_wallet_request.rs b/crates/kmd_client/src/models/create_wallet_request.rs index 89580cfff..8333a1951 100644 --- a/crates/kmd_client/src/models/create_wallet_request.rs +++ b/crates/kmd_client/src/models/create_wallet_request.rs @@ -15,7 +15,6 @@ use crate::models::MasterDerivationKey; /// APIV1POSTWalletRequest is the request for `POST /v1/wallet` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct CreateWalletRequest { #[serde( rename = "master_derivation_key", diff --git a/crates/kmd_client/src/models/delete_key_request.rs b/crates/kmd_client/src/models/delete_key_request.rs index 5d628240b..6df09beaa 100644 --- a/crates/kmd_client/src/models/delete_key_request.rs +++ b/crates/kmd_client/src/models/delete_key_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1DELETEKeyRequest is the request for `DELETE /v1/key` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DeleteKeyRequest { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/delete_key_response.rs b/crates/kmd_client/src/models/delete_key_response.rs index 5d8a97343..cd054c8c9 100644 --- a/crates/kmd_client/src/models/delete_key_response.rs +++ b/crates/kmd_client/src/models/delete_key_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1DELETEKeyResponse is the response to `DELETE /v1/key` /// friendly:DeleteKeyResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DeleteKeyResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/delete_multisig_request.rs b/crates/kmd_client/src/models/delete_multisig_request.rs index 6d3719801..f5cd8dd31 100644 --- a/crates/kmd_client/src/models/delete_multisig_request.rs +++ b/crates/kmd_client/src/models/delete_multisig_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1DELETEMultisigRequest is the request for `DELETE /v1/multisig` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DeleteMultisigRequest { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/delete_multisig_response.rs b/crates/kmd_client/src/models/delete_multisig_response.rs index a9e22f69b..0bc53e350 100644 --- a/crates/kmd_client/src/models/delete_multisig_response.rs +++ b/crates/kmd_client/src/models/delete_multisig_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1DELETEMultisigResponse is the response to POST /v1/multisig/delete` /// friendly:DeleteMultisigResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct DeleteMultisigResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/export_key_request.rs b/crates/kmd_client/src/models/export_key_request.rs index 5052bea26..352d9bd3f 100644 --- a/crates/kmd_client/src/models/export_key_request.rs +++ b/crates/kmd_client/src/models/export_key_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTKeyExportRequest is the request for `POST /v1/key/export` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ExportKeyRequest { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/export_master_key_request.rs b/crates/kmd_client/src/models/export_master_key_request.rs index 2d1746c99..d93d301cc 100644 --- a/crates/kmd_client/src/models/export_master_key_request.rs +++ b/crates/kmd_client/src/models/export_master_key_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTMasterKeyExportRequest is the request for `POST /v1/master-key/export` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ExportMasterKeyRequest { #[serde( rename = "wallet_handle_token", diff --git a/crates/kmd_client/src/models/export_multisig_request.rs b/crates/kmd_client/src/models/export_multisig_request.rs index 64b90fbf0..c64222799 100644 --- a/crates/kmd_client/src/models/export_multisig_request.rs +++ b/crates/kmd_client/src/models/export_multisig_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTMultisigExportRequest is the request for `POST /v1/multisig/export` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ExportMultisigRequest { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/generate_key_request.rs b/crates/kmd_client/src/models/generate_key_request.rs index 935324673..f3f45cb50 100644 --- a/crates/kmd_client/src/models/generate_key_request.rs +++ b/crates/kmd_client/src/models/generate_key_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTKeyRequest is the request for `POST /v1/key` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GenerateKeyRequest { #[serde(rename = "display_mnemonic", skip_serializing_if = "Option::is_none")] pub display_mnemonic: Option, diff --git a/crates/kmd_client/src/models/get_wallets_response.rs b/crates/kmd_client/src/models/get_wallets_response.rs index 87d1c39e9..ef1cbfff9 100644 --- a/crates/kmd_client/src/models/get_wallets_response.rs +++ b/crates/kmd_client/src/models/get_wallets_response.rs @@ -16,7 +16,6 @@ use crate::models::Wallet; /// APIV1GETWalletsResponse is the response to `GET /v1/wallets` /// friendly:ListWalletsResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct GetWalletsResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/import_key_request.rs b/crates/kmd_client/src/models/import_key_request.rs index e649d4c90..9c6d88a01 100644 --- a/crates/kmd_client/src/models/import_key_request.rs +++ b/crates/kmd_client/src/models/import_key_request.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// APIV1POSTKeyImportRequest is the request for `POST /v1/key/import` #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ImportKeyRequest { #[serde_as(as = "Option")] #[serde(rename = "private_key", skip_serializing_if = "Option::is_none")] diff --git a/crates/kmd_client/src/models/import_multisig_request.rs b/crates/kmd_client/src/models/import_multisig_request.rs index 73999919e..259c5befb 100644 --- a/crates/kmd_client/src/models/import_multisig_request.rs +++ b/crates/kmd_client/src/models/import_multisig_request.rs @@ -15,7 +15,6 @@ use crate::models::PublicKey; /// APIV1POSTMultisigImportRequest is the request for `POST /v1/multisig/import` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ImportMultisigRequest { #[serde(rename = "multisig_version", skip_serializing_if = "Option::is_none")] pub multisig_version: Option, diff --git a/crates/kmd_client/src/models/init_wallet_handle_token_request.rs b/crates/kmd_client/src/models/init_wallet_handle_token_request.rs index acfa7db87..2a4fc949b 100644 --- a/crates/kmd_client/src/models/init_wallet_handle_token_request.rs +++ b/crates/kmd_client/src/models/init_wallet_handle_token_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletInitRequest is the request for `POST /v1/wallet/init` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct InitWalletHandleTokenRequest { #[serde(rename = "wallet_id", skip_serializing_if = "Option::is_none")] pub wallet_id: Option, diff --git a/crates/kmd_client/src/models/list_keys_request.rs b/crates/kmd_client/src/models/list_keys_request.rs index 12c57081b..84e0b734c 100644 --- a/crates/kmd_client/src/models/list_keys_request.rs +++ b/crates/kmd_client/src/models/list_keys_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTKeyListRequest is the request for `POST /v1/key/list` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ListKeysRequest { #[serde( rename = "wallet_handle_token", diff --git a/crates/kmd_client/src/models/list_multisig_request.rs b/crates/kmd_client/src/models/list_multisig_request.rs index d540c2eda..b3e8c5dfa 100644 --- a/crates/kmd_client/src/models/list_multisig_request.rs +++ b/crates/kmd_client/src/models/list_multisig_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTMultisigListRequest is the request for `POST /v1/multisig/list` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ListMultisigRequest { #[serde( rename = "wallet_handle_token", diff --git a/crates/kmd_client/src/models/list_wallets_request.rs b/crates/kmd_client/src/models/list_wallets_request.rs index 6f6c49e4f..89c8469e5 100644 --- a/crates/kmd_client/src/models/list_wallets_request.rs +++ b/crates/kmd_client/src/models/list_wallets_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1GETWalletsRequest is the request for `GET /v1/wallets` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ListWalletsRequest {} impl ListWalletsRequest { diff --git a/crates/kmd_client/src/models/mod.rs b/crates/kmd_client/src/models/mod.rs index a3dc7160c..9e7e52617 100644 --- a/crates/kmd_client/src/models/mod.rs +++ b/crates/kmd_client/src/models/mod.rs @@ -8,10 +8,6 @@ * Generated by: Rust OpenAPI Generator */ -#[cfg(feature = "ffi_uniffi")] -pub type UnknownJsonValue = String; - -#[cfg(not(feature = "ffi_uniffi"))] pub type UnknownJsonValue = serde_json::Value; pub mod delete_key_response; diff --git a/crates/kmd_client/src/models/multisig_sig.rs b/crates/kmd_client/src/models/multisig_sig.rs index ac3aa4594..2bd47402a 100644 --- a/crates/kmd_client/src/models/multisig_sig.rs +++ b/crates/kmd_client/src/models/multisig_sig.rs @@ -15,7 +15,6 @@ use crate::models::MultisigSubsig; /// MultisigSig is the structure that holds multiple Subsigs #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct MultisigSig { #[serde(rename = "Subsigs", skip_serializing_if = "Option::is_none")] pub subsigs: Option>, diff --git a/crates/kmd_client/src/models/multisig_subsig.rs b/crates/kmd_client/src/models/multisig_subsig.rs index 54517a679..cf34c644c 100644 --- a/crates/kmd_client/src/models/multisig_subsig.rs +++ b/crates/kmd_client/src/models/multisig_subsig.rs @@ -17,7 +17,6 @@ use crate::models::Signature; /// MultisigSubsig is a struct that holds a pair of public key and signatures /// signatures may be empty #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct MultisigSubsig { #[serde(rename = "Key", skip_serializing_if = "Option::is_none")] pub key: Option, diff --git a/crates/kmd_client/src/models/post_key_export_response.rs b/crates/kmd_client/src/models/post_key_export_response.rs index 54ca1ee04..0ff1847be 100644 --- a/crates/kmd_client/src/models/post_key_export_response.rs +++ b/crates/kmd_client/src/models/post_key_export_response.rs @@ -16,7 +16,6 @@ use serde_with::{Bytes, serde_as}; /// friendly:ExportKeyResponse #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostKeyExportResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_key_import_response.rs b/crates/kmd_client/src/models/post_key_import_response.rs index 3801f7046..381de5956 100644 --- a/crates/kmd_client/src/models/post_key_import_response.rs +++ b/crates/kmd_client/src/models/post_key_import_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTKeyImportResponse is the response to `POST /v1/key/import` /// friendly:ImportKeyResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostKeyImportResponse { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/post_key_list_response.rs b/crates/kmd_client/src/models/post_key_list_response.rs index d58e96202..3012f6316 100644 --- a/crates/kmd_client/src/models/post_key_list_response.rs +++ b/crates/kmd_client/src/models/post_key_list_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTKeyListResponse is the response to `POST /v1/key/list` /// friendly:ListKeysResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostKeyListResponse { #[serde(rename = "addresses", skip_serializing_if = "Option::is_none")] pub addresses: Option>, diff --git a/crates/kmd_client/src/models/post_key_response.rs b/crates/kmd_client/src/models/post_key_response.rs index 89c02af27..f8b570a57 100644 --- a/crates/kmd_client/src/models/post_key_response.rs +++ b/crates/kmd_client/src/models/post_key_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTKeyResponse is the response to `POST /v1/key` /// friendly:GenerateKeyResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostKeyResponse { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/post_master_key_export_response.rs b/crates/kmd_client/src/models/post_master_key_export_response.rs index 57195e854..dc135cb8a 100644 --- a/crates/kmd_client/src/models/post_master_key_export_response.rs +++ b/crates/kmd_client/src/models/post_master_key_export_response.rs @@ -16,7 +16,6 @@ use crate::models::MasterDerivationKey; /// APIV1POSTMasterKeyExportResponse is the response to `POST /v1/master-key/export` /// friendly:ExportMasterKeyResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostMasterKeyExportResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_multisig_export_response.rs b/crates/kmd_client/src/models/post_multisig_export_response.rs index 433a5ff64..8a84d61cd 100644 --- a/crates/kmd_client/src/models/post_multisig_export_response.rs +++ b/crates/kmd_client/src/models/post_multisig_export_response.rs @@ -16,7 +16,6 @@ use crate::models::PublicKey; /// APIV1POSTMultisigExportResponse is the response to `POST /v1/multisig/export` /// friendly:ExportMultisigResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostMultisigExportResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_multisig_import_response.rs b/crates/kmd_client/src/models/post_multisig_import_response.rs index bed2ea2f1..67cf0a93f 100644 --- a/crates/kmd_client/src/models/post_multisig_import_response.rs +++ b/crates/kmd_client/src/models/post_multisig_import_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTMultisigImportResponse is the response to `POST /v1/multisig/import` /// friendly:ImportMultisigResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostMultisigImportResponse { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/post_multisig_list_response.rs b/crates/kmd_client/src/models/post_multisig_list_response.rs index 6f4b1dbf0..afcc22452 100644 --- a/crates/kmd_client/src/models/post_multisig_list_response.rs +++ b/crates/kmd_client/src/models/post_multisig_list_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTMultisigListResponse is the response to `POST /v1/multisig/list` /// friendly:ListMultisigResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostMultisigListResponse { #[serde(rename = "addresses", skip_serializing_if = "Option::is_none")] pub addresses: Option>, diff --git a/crates/kmd_client/src/models/post_multisig_program_sign_response.rs b/crates/kmd_client/src/models/post_multisig_program_sign_response.rs index 75c40813d..73ea16ae3 100644 --- a/crates/kmd_client/src/models/post_multisig_program_sign_response.rs +++ b/crates/kmd_client/src/models/post_multisig_program_sign_response.rs @@ -16,7 +16,6 @@ use serde_with::{Bytes, serde_as}; /// friendly:SignProgramMultisigResponse #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostMultisigProgramSignResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_multisig_transaction_sign_response.rs b/crates/kmd_client/src/models/post_multisig_transaction_sign_response.rs index 10e986bc9..c3ad3fc29 100644 --- a/crates/kmd_client/src/models/post_multisig_transaction_sign_response.rs +++ b/crates/kmd_client/src/models/post_multisig_transaction_sign_response.rs @@ -16,7 +16,6 @@ use serde_with::{Bytes, serde_as}; /// friendly:SignMultisigResponse #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostMultisigTransactionSignResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_program_sign_response.rs b/crates/kmd_client/src/models/post_program_sign_response.rs index 378111f0f..4aa66ef91 100644 --- a/crates/kmd_client/src/models/post_program_sign_response.rs +++ b/crates/kmd_client/src/models/post_program_sign_response.rs @@ -16,7 +16,6 @@ use serde_with::{Bytes, serde_as}; /// friendly:SignProgramResponse #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostProgramSignResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_transaction_sign_response.rs b/crates/kmd_client/src/models/post_transaction_sign_response.rs index 3c82583fe..17163c84f 100644 --- a/crates/kmd_client/src/models/post_transaction_sign_response.rs +++ b/crates/kmd_client/src/models/post_transaction_sign_response.rs @@ -16,7 +16,6 @@ use serde_with::{Bytes, serde_as}; /// friendly:SignTransactionResponse #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostTransactionSignResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_wallet_info_response.rs b/crates/kmd_client/src/models/post_wallet_info_response.rs index 601eb7e7f..ade960956 100644 --- a/crates/kmd_client/src/models/post_wallet_info_response.rs +++ b/crates/kmd_client/src/models/post_wallet_info_response.rs @@ -16,7 +16,6 @@ use crate::models::WalletHandle; /// APIV1POSTWalletInfoResponse is the response to `POST /v1/wallet/info` /// friendly:WalletInfoResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostWalletInfoResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_wallet_init_response.rs b/crates/kmd_client/src/models/post_wallet_init_response.rs index f07526a2d..df3243478 100644 --- a/crates/kmd_client/src/models/post_wallet_init_response.rs +++ b/crates/kmd_client/src/models/post_wallet_init_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletInitResponse is the response to `POST /v1/wallet/init` /// friendly:InitWalletHandleTokenResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostWalletInitResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_wallet_release_response.rs b/crates/kmd_client/src/models/post_wallet_release_response.rs index 38868f826..42cf3e44e 100644 --- a/crates/kmd_client/src/models/post_wallet_release_response.rs +++ b/crates/kmd_client/src/models/post_wallet_release_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletReleaseResponse is the response to `POST /v1/wallet/release` /// friendly:ReleaseWalletHandleTokenResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostWalletReleaseResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_wallet_rename_response.rs b/crates/kmd_client/src/models/post_wallet_rename_response.rs index b8637949a..4e8777cc1 100644 --- a/crates/kmd_client/src/models/post_wallet_rename_response.rs +++ b/crates/kmd_client/src/models/post_wallet_rename_response.rs @@ -16,7 +16,6 @@ use crate::models::Wallet; /// APIV1POSTWalletRenameResponse is the response to `POST /v1/wallet/rename` /// friendly:RenameWalletResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostWalletRenameResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_wallet_renew_response.rs b/crates/kmd_client/src/models/post_wallet_renew_response.rs index 4129342ae..17437633f 100644 --- a/crates/kmd_client/src/models/post_wallet_renew_response.rs +++ b/crates/kmd_client/src/models/post_wallet_renew_response.rs @@ -16,7 +16,6 @@ use crate::models::WalletHandle; /// APIV1POSTWalletRenewResponse is the response to `POST /v1/wallet/renew` /// friendly:RenewWalletHandleTokenResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostWalletRenewResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/post_wallet_response.rs b/crates/kmd_client/src/models/post_wallet_response.rs index 56207344d..c597df64e 100644 --- a/crates/kmd_client/src/models/post_wallet_response.rs +++ b/crates/kmd_client/src/models/post_wallet_response.rs @@ -16,7 +16,6 @@ use crate::models::Wallet; /// APIV1POSTWalletResponse is the response to `POST /v1/wallet` /// friendly:CreateWalletResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct PostWalletResponse { #[serde(rename = "error", skip_serializing_if = "Option::is_none")] pub error: Option, diff --git a/crates/kmd_client/src/models/release_wallet_handle_token_request.rs b/crates/kmd_client/src/models/release_wallet_handle_token_request.rs index 3047396d6..05c79f8af 100644 --- a/crates/kmd_client/src/models/release_wallet_handle_token_request.rs +++ b/crates/kmd_client/src/models/release_wallet_handle_token_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletReleaseRequest is the request for `POST /v1/wallet/release` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct ReleaseWalletHandleTokenRequest { #[serde( rename = "wallet_handle_token", diff --git a/crates/kmd_client/src/models/rename_wallet_request.rs b/crates/kmd_client/src/models/rename_wallet_request.rs index bbfedc9a5..882085c89 100644 --- a/crates/kmd_client/src/models/rename_wallet_request.rs +++ b/crates/kmd_client/src/models/rename_wallet_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletRenameRequest is the request for `POST /v1/wallet/rename` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct RenameWalletRequest { #[serde(rename = "wallet_id", skip_serializing_if = "Option::is_none")] pub wallet_id: Option, diff --git a/crates/kmd_client/src/models/renew_wallet_handle_token_request.rs b/crates/kmd_client/src/models/renew_wallet_handle_token_request.rs index 59f50026f..29928dc48 100644 --- a/crates/kmd_client/src/models/renew_wallet_handle_token_request.rs +++ b/crates/kmd_client/src/models/renew_wallet_handle_token_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletRenewRequest is the request for `POST /v1/wallet/renew` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct RenewWalletHandleTokenRequest { #[serde( rename = "wallet_handle_token", diff --git a/crates/kmd_client/src/models/sign_multisig_request.rs b/crates/kmd_client/src/models/sign_multisig_request.rs index 20fb1af4b..4b418470b 100644 --- a/crates/kmd_client/src/models/sign_multisig_request.rs +++ b/crates/kmd_client/src/models/sign_multisig_request.rs @@ -19,7 +19,6 @@ use crate::models::PublicKey; /// APIV1POSTMultisigTransactionSignRequest is the request for `POST /v1/multisig/sign` #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SignMultisigRequest { #[serde(rename = "partial_multisig", skip_serializing_if = "Option::is_none")] pub partial_multisig: Option, diff --git a/crates/kmd_client/src/models/sign_program_multisig_request.rs b/crates/kmd_client/src/models/sign_program_multisig_request.rs index 074168046..54274c279 100644 --- a/crates/kmd_client/src/models/sign_program_multisig_request.rs +++ b/crates/kmd_client/src/models/sign_program_multisig_request.rs @@ -18,7 +18,6 @@ use crate::models::PublicKey; /// APIV1POSTMultisigProgramSignRequest is the request for `POST /v1/multisig/signprogram` #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SignProgramMultisigRequest { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/sign_program_request.rs b/crates/kmd_client/src/models/sign_program_request.rs index a282f2fc6..48e66f311 100644 --- a/crates/kmd_client/src/models/sign_program_request.rs +++ b/crates/kmd_client/src/models/sign_program_request.rs @@ -15,7 +15,6 @@ use serde_with::{Bytes, serde_as}; /// APIV1POSTProgramSignRequest is the request for `POST /v1/program/sign` #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SignProgramRequest { #[serde(rename = "address", skip_serializing_if = "Option::is_none")] pub address: Option, diff --git a/crates/kmd_client/src/models/sign_transaction_request.rs b/crates/kmd_client/src/models/sign_transaction_request.rs index b439f02dc..7d72549af 100644 --- a/crates/kmd_client/src/models/sign_transaction_request.rs +++ b/crates/kmd_client/src/models/sign_transaction_request.rs @@ -17,7 +17,6 @@ use crate::models::PublicKey; /// APIV1POSTTransactionSignRequest is the request for `POST /v1/transaction/sign` #[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct SignTransactionRequest { #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")] pub public_key: Option, diff --git a/crates/kmd_client/src/models/versions_request.rs b/crates/kmd_client/src/models/versions_request.rs index 2359dba21..d69dd6709 100644 --- a/crates/kmd_client/src/models/versions_request.rs +++ b/crates/kmd_client/src/models/versions_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// VersionsRequest is the request for `GET /versions` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct VersionsRequest {} impl VersionsRequest { diff --git a/crates/kmd_client/src/models/versions_response.rs b/crates/kmd_client/src/models/versions_response.rs index cc68c3dd6..e2b938059 100644 --- a/crates/kmd_client/src/models/versions_response.rs +++ b/crates/kmd_client/src/models/versions_response.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; /// VersionsResponse is the response to `GET /versions` /// friendly:VersionsResponse #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct VersionsResponse { #[serde(rename = "versions", skip_serializing_if = "Option::is_none")] pub versions: Option>, diff --git a/crates/kmd_client/src/models/wallet.rs b/crates/kmd_client/src/models/wallet.rs index 098761d74..bb3f4e428 100644 --- a/crates/kmd_client/src/models/wallet.rs +++ b/crates/kmd_client/src/models/wallet.rs @@ -15,7 +15,6 @@ use crate::models::TxType; /// APIV1Wallet is the API's representation of a wallet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct Wallet { #[serde(rename = "driver_name", skip_serializing_if = "Option::is_none")] pub driver_name: Option, diff --git a/crates/kmd_client/src/models/wallet_handle.rs b/crates/kmd_client/src/models/wallet_handle.rs index eee2a664a..4b9b3b562 100644 --- a/crates/kmd_client/src/models/wallet_handle.rs +++ b/crates/kmd_client/src/models/wallet_handle.rs @@ -16,7 +16,6 @@ use crate::models::Wallet; /// APIV1WalletHandle includes the wallet the handle corresponds to /// and the number of number of seconds to expiration #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct WalletHandle { #[serde(rename = "expires_seconds", skip_serializing_if = "Option::is_none")] pub expires_seconds: Option, diff --git a/crates/kmd_client/src/models/wallet_info_request.rs b/crates/kmd_client/src/models/wallet_info_request.rs index 7572083fd..6262434eb 100644 --- a/crates/kmd_client/src/models/wallet_info_request.rs +++ b/crates/kmd_client/src/models/wallet_info_request.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; /// APIV1POSTWalletInfoRequest is the request for `POST /v1/wallet/info` #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -#[cfg_attr(feature = "ffi_uniffi", derive(uniffi::Record))] pub struct WalletInfoRequest { #[serde( rename = "wallet_handle_token", diff --git a/packages/python/algokit_transact/algokit_transact/__init__.py b/packages/python/algokit_transact/algokit_transact/__init__.py index e8fab9b01..d5085a355 100644 --- a/packages/python/algokit_transact/algokit_transact/__init__.py +++ b/packages/python/algokit_transact/algokit_transact/__init__.py @@ -4,5 +4,9 @@ # Import all symbols from the Rust extension module and re-export them from .algokit_transact_ffi import * +from .algokit_transact_ffi import _UniffiRustBuffer, _UniffiFfiConverterTypeTransaction, _UniffiFfiConverterTypeSignedTransaction, _UniffiFfiConverterTypeOnApplicationComplete # Add any additional exports or initialization here + +__all__ = ["_UniffiRustBuffer", "_UniffiFfiConverterTypeTransaction", "_UniffiFfiConverterTypeSignedTransaction", + "_UniffiFfiConverterTypeOnApplicationComplete"] diff --git a/packages/python/algokit_utils/algokit_utils/algod_client_ffi.py b/packages/python/algokit_utils/algokit_utils/algod_client_ffi.py new file mode 100644 index 000000000..0169d1cac --- /dev/null +++ b/packages/python/algokit_utils/algokit_utils/algod_client_ffi.py @@ -0,0 +1,25635 @@ +# This file was autogenerated by some hot garbage in the `uniffi` crate. +# Trust me, you don't want to mess with it! + +# Common helper code. +# +# Ideally this would live in a separate .py file where it can be unittested etc +# in isolation, and perhaps even published as a re-useable package. +# +# However, it's important that the details of how this helper code works (e.g. the +# way that different builtin types are passed across the FFI) exactly match what's +# expected by the rust code on the other side of the interface. In practice right +# now that means coming from the exact some version of `uniffi` that was used to +# compile the rust component. The easiest way to ensure this is to bundle the Python +# helpers directly inline like we're doing here. + +from __future__ import annotations +import os +import sys +import ctypes +from dataclasses import dataclass +import enum +import struct +import contextlib +import datetime +import threading +import itertools +import traceback +import typing +import asyncio +import platform +from . import algokit_transact_ffi +from . import algokit_http_client + + +# Used for default argument values +_DEFAULT = object() # type: typing.Any + + +class _UniffiRustBuffer(ctypes.Structure): + _fields_ = [ + ("capacity", ctypes.c_uint64), + ("len", ctypes.c_uint64), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + @staticmethod + def default(): + return _UniffiRustBuffer(0, 0, None) + + @staticmethod + def alloc(size): + return _uniffi_rust_call(_UniffiLib.ffi_algod_client_ffi_rustbuffer_alloc, size) + + @staticmethod + def reserve(rbuf, additional): + return _uniffi_rust_call(_UniffiLib.ffi_algod_client_ffi_rustbuffer_reserve, rbuf, additional) + + def free(self): + return _uniffi_rust_call(_UniffiLib.ffi_algod_client_ffi_rustbuffer_free, self) + + def __str__(self): + return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( + self.capacity, + self.len, + self.data[0:self.len] + ) + + @contextlib.contextmanager + def alloc_with_builder(*args): + """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. + + The allocated buffer will be automatically freed if an error occurs, ensuring that + we don't accidentally leak it. + """ + builder = _UniffiRustBufferBuilder() + try: + yield builder + except: + builder.discard() + raise + + @contextlib.contextmanager + def consume_with_stream(self): + """Context-manager to consume a buffer using a _UniffiRustBufferStream. + + The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't + leak it even if an error occurs. + """ + try: + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of consume_with_stream {s.remaining()}") + finally: + self.free() + + @contextlib.contextmanager + def read_with_stream(self): + """Context-manager to read a buffer using a _UniffiRustBufferStream. + + This is like consume_with_stream, but doesn't free the buffer afterwards. + It should only be used with borrowed `_UniffiRustBuffer` data. + """ + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of read_with_stream {s.remaining()}") + +class _UniffiForeignBytes(ctypes.Structure): + _fields_ = [ + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + def __str__(self): + return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) + + +class _UniffiRustBufferStream: + """ + Helper for structured reading of bytes from a _UniffiRustBuffer + """ + + def __init__(self, data, len): + self.data = data + self.len = len + self.offset = 0 + + @classmethod + def from_rust_buffer(cls, buf): + return cls(buf.data, buf.len) + + def remaining(self): + return self.len - self.offset + + def _unpack_from(self, size, format): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] + self.offset += size + return value + + def read(self, size): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + data = self.data[self.offset:self.offset+size] + self.offset += size + return data + + def read_i8(self): + return self._unpack_from(1, ">b") + + def read_u8(self): + return self._unpack_from(1, ">B") + + def read_i16(self): + return self._unpack_from(2, ">h") + + def read_u16(self): + return self._unpack_from(2, ">H") + + def read_i32(self): + return self._unpack_from(4, ">i") + + def read_u32(self): + return self._unpack_from(4, ">I") + + def read_i64(self): + return self._unpack_from(8, ">q") + + def read_u64(self): + return self._unpack_from(8, ">Q") + + def read_float(self): + v = self._unpack_from(4, ">f") + return v + + def read_double(self): + return self._unpack_from(8, ">d") + +class _UniffiRustBufferBuilder: + """ + Helper for structured writing of bytes into a _UniffiRustBuffer. + """ + + def __init__(self): + self.rbuf = _UniffiRustBuffer.alloc(16) + self.rbuf.len = 0 + + def finalize(self): + rbuf = self.rbuf + self.rbuf = None + return rbuf + + def discard(self): + if self.rbuf is not None: + rbuf = self.finalize() + rbuf.free() + + @contextlib.contextmanager + def _reserve(self, num_bytes): + if self.rbuf.len + num_bytes > self.rbuf.capacity: + self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) + yield None + self.rbuf.len += num_bytes + + def _pack_into(self, size, format, value): + with self._reserve(size): + # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. + for i, byte in enumerate(struct.pack(format, value)): + self.rbuf.data[self.rbuf.len + i] = byte + + def write(self, value): + with self._reserve(len(value)): + for i, byte in enumerate(value): + self.rbuf.data[self.rbuf.len + i] = byte + + def write_i8(self, v): + self._pack_into(1, ">b", v) + + def write_u8(self, v): + self._pack_into(1, ">B", v) + + def write_i16(self, v): + self._pack_into(2, ">h", v) + + def write_u16(self, v): + self._pack_into(2, ">H", v) + + def write_i32(self, v): + self._pack_into(4, ">i", v) + + def write_u32(self, v): + self._pack_into(4, ">I", v) + + def write_i64(self, v): + self._pack_into(8, ">q", v) + + def write_u64(self, v): + self._pack_into(8, ">Q", v) + + def write_float(self, v): + self._pack_into(4, ">f", v) + + def write_double(self, v): + self._pack_into(8, ">d", v) + + def write_c_size_t(self, v): + self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) +# A handful of classes and functions to support the generated data structures. +# This would be a good candidate for isolating in its own ffi-support lib. + +class InternalError(Exception): + pass + +class _UniffiRustCallStatus(ctypes.Structure): + """ + Error runtime. + """ + _fields_ = [ + ("code", ctypes.c_int8), + ("error_buf", _UniffiRustBuffer), + ] + + # These match the values from the uniffi::rustcalls module + CALL_SUCCESS = 0 + CALL_ERROR = 1 + CALL_UNEXPECTED_ERROR = 2 + + @staticmethod + def default(): + return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default()) + + def __str__(self): + if self.code == _UniffiRustCallStatus.CALL_SUCCESS: + return "_UniffiRustCallStatus(CALL_SUCCESS)" + elif self.code == _UniffiRustCallStatus.CALL_ERROR: + return "_UniffiRustCallStatus(CALL_ERROR)" + elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)" + else: + return "_UniffiRustCallStatus()" + +def _uniffi_rust_call(fn, *args): + # Call a rust function + return _uniffi_rust_call_with_error(None, fn, *args) + +def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args): + # Call a rust function and handle any errors + # + # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. + # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. + call_status = _UniffiRustCallStatus.default() + + args_with_error = args + (ctypes.byref(call_status),) + result = fn(*args_with_error) + _uniffi_check_call_status(error_ffi_converter, call_status) + return result + +def _uniffi_check_call_status(error_ffi_converter, call_status): + if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: + pass + elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: + if error_ffi_converter is None: + call_status.error_buf.free() + raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") + else: + raise error_ffi_converter.lift(call_status.error_buf) + elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer + # with the message. But if that code panics, then it just sends back + # an empty buffer. + if call_status.error_buf.len > 0: + msg = _UniffiFfiConverterString.lift(call_status.error_buf) + else: + msg = "Unknown rust panic" + raise InternalError(msg) + else: + raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( + call_status.code)) + +def _uniffi_trait_interface_call(call_status, make_call, write_return_value): + try: + return write_return_value(make_call()) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) + +def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error): + try: + try: + return write_return_value(make_call()) + except error_type as e: + call_status.code = _UniffiRustCallStatus.CALL_ERROR + call_status.error_buf = lower_error(e) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) +# Initial value and increment amount for handles. +# These ensure that Python-generated handles always have the lowest bit set +_UNIFFI_HANDLEMAP_INITIAL = 1 +_UNIFFI_HANDLEMAP_DELTA = 2 + +class _UniffiHandleMap: + """ + A map where inserting, getting and removing data is synchronized with a lock. + """ + + def __init__(self): + # type Handle = int + self._map = {} # type: Dict[Handle, Any] + self._lock = threading.Lock() + self._counter = _UNIFFI_HANDLEMAP_INITIAL + + def insert(self, obj): + with self._lock: + return self._insert(obj) + + """Low-level insert, this assumes `self._lock` is held.""" + def _insert(self, obj): + handle = self._counter + self._counter += _UNIFFI_HANDLEMAP_DELTA + self._map[handle] = obj + return handle + + def get(self, handle): + try: + with self._lock: + return self._map[handle] + except KeyError: + raise InternalError(f"_UniffiHandleMap.get: Invalid handle {handle}") + + def clone(self, handle): + try: + with self._lock: + obj = self._map[handle] + return self._insert(obj) + except KeyError: + raise InternalError(f"_UniffiHandleMap.clone: Invalid handle {handle}") + + def remove(self, handle): + try: + with self._lock: + return self._map.pop(handle) + except KeyError: + raise InternalError(f"_UniffiHandleMap.remove: Invalid handle: {handle}") + + def __len__(self): + return len(self._map) +# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. +class _UniffiConverterPrimitive: + @classmethod + def lift(cls, value): + return value + + @classmethod + def lower(cls, value): + return value + +class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__index__() + except Exception: + raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) + if not isinstance(value, int): + raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) + if not cls.VALUE_MIN <= value < cls.VALUE_MAX: + raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) + +class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__float__() + except Exception: + raise TypeError("must be real number, not {}".format(type(value).__name__)) + if not isinstance(value, float): + raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) + +# Helper class for wrapper types that will always go through a _UniffiRustBuffer. +# Classes should inherit from this and implement the `read` and `write` static methods. +class _UniffiConverterRustBuffer: + @classmethod + def lift(cls, rbuf): + with rbuf.consume_with_stream() as stream: + return cls.read(stream) + + @classmethod + def lower(cls, value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + cls.write(value, builder) + return builder.finalize() + +# Contains loading, initialization code, and the FFI Function declarations. +# Define some ctypes FFI types that we use in the library + +""" +Function pointer for a Rust task, which a callback function that takes a opaque pointer +""" +_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) + +def _uniffi_future_callback_t(return_type): + """ + Factory function to create callback function types for async functions + """ + return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus) + +def _uniffi_load_indirect(): + """ + This is how we find and load the dynamic library provided by the component. + For now we just look it up by name. + """ + if sys.platform == "darwin": + libname = "lib{}.dylib" + elif sys.platform.startswith("win"): + # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. + # We could use `os.add_dll_directory` to configure the search path, but + # it doesn't feel right to mess with application-wide settings. Let's + # assume that the `.dll` is next to the `.py` file and load by full path. + libname = os.path.join( + os.path.dirname(__file__), + "{}.dll", + ) + else: + # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos + libname = "lib{}.so" + + libname = libname.format("algokit_utils_ffi") + path = os.path.join(os.path.dirname(__file__), libname) + lib = ctypes.cdll.LoadLibrary(path) + return lib + +def _uniffi_check_contract_api_version(lib): + # Get the bindings contract version from our ComponentInterface + bindings_contract_version = 30 + # Get the scaffolding contract version by calling the into the dylib + scaffolding_contract_version = lib.ffi_algod_client_ffi_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version: + raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + +def _uniffi_check_api_checksums(lib): + if lib.uniffi_algod_client_ffi_checksum_constructor_algodclient_new() != 43657: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_abort_catchup() != 56060: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_account_application_information() != 29999: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_account_asset_information() != 24166: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_account_assets_information() != 6555: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_account_information() != 54762: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_add_participation_key() != 2657: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_append_keys() != 48948: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_delete_participation_key_by_id() != 62766: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_experimental_check() != 47498: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_generate_participation_keys() != 30110: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_box_by_name() != 29997: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_boxes() != 28673: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_by_id() != 35236: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_asset_by_id() != 36064: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block() != 14702: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_hash() != 23974: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_logs() != 21016: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_time_stamp_offset() != 1839: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_txids() != 19980: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_config() != 2: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_debug_settings_prof() != 44636: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_genesis() != 33262: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ledger_state_delta() != 21627: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ledger_state_delta_for_transaction_group() != 213: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_light_block_header_proof() != 32109: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_participation_key_by_id() != 48636: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_participation_keys() != 50810: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_pending_transactions() != 49188: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_pending_transactions_by_address() != 21459: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ready() != 35284: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_state_proof() != 24973: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_status() != 37010: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_supply() != 55012: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_sync_round() != 48802: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_transaction_group_ledger_state_deltas_for_round() != 34053: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_transaction_proof() != 2103: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_get_version() != 7973: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_health_check() != 34211: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_metrics() != 58727: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_pending_transaction_information() != 31441: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_put_debug_settings_prof() != 38244: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_raw_transaction() != 44873: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_raw_transaction_async() != 22542: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_set_block_time_stamp_offset() != 53790: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_set_sync_round() != 65075: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_shutdown_node() != 63713: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_simulate_transaction() != 5767: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_start_catchup() != 36866: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_swagger_json() != 56396: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_compile() != 27269: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_disassemble() != 50305: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_dryrun() != 34333: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_transaction_params() != 21810: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_unset_sync_round() != 61657: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclient_wait_for_block() != 9675: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_health_check() != 31004: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ready() != 32153: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_metrics() != 54504: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_genesis() != 53872: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_swagger_json() != 33786: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_version() != 48136: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_debug_settings_prof() != 8719: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_put_debug_settings_prof() != 11478: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_config() != 36751: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_information() != 36494: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_asset_information() != 35829: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_assets_information() != 7523: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_application_information() != 32643: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_pending_transactions_by_address() != 5346: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block() != 26342: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_txids() != 18606: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_hash() != 42932: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_transaction_proof() != 55680: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_logs() != 64461: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_supply() != 56575: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_participation_keys() != 33821: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_add_participation_key() != 1010: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_generate_participation_keys() != 11293: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_participation_key_by_id() != 57044: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_append_keys() != 22678: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_delete_participation_key_by_id() != 739: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_shutdown_node() != 65060: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_status() != 12650: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_wait_for_block() != 9950: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_raw_transaction() != 11416: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_raw_transaction_async() != 58915: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_simulate_transaction() != 34397: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_transaction_params() != 5378: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_pending_transactions() != 8557: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_pending_transaction_information() != 60795: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ledger_state_delta() != 13642: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_transaction_group_ledger_state_deltas_for_round() != 20230: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ledger_state_delta_for_transaction_group() != 60990: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_state_proof() != 11069: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_light_block_header_proof() != 50214: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_by_id() != 30187: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_boxes() != 45910: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_box_by_name() != 152: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_asset_by_id() != 54171: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_sync_round() != 7287: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_unset_sync_round() != 39382: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_set_sync_round() != 19078: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_compile() != 12414: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_disassemble() != 44847: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_start_catchup() != 48197: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_abort_catchup() != 1545: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_dryrun() != 23321: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_experimental_check() != 65217: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_time_stamp_offset() != 46373: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_set_block_time_stamp_offset() != 3361: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +# A ctypes library to expose the extern-C FFI definitions. +# This is an implementation detail which will be called internally by the public API. + +_UniffiLib = _uniffi_load_indirect() +_UniffiLib.ffi_algod_client_ffi_rustbuffer_alloc.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rustbuffer_alloc.restype = _UniffiRustBuffer +_UniffiLib.ffi_algod_client_ffi_rustbuffer_from_bytes.argtypes = ( + _UniffiForeignBytes, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rustbuffer_from_bytes.restype = _UniffiRustBuffer +_UniffiLib.ffi_algod_client_ffi_rustbuffer_free.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rustbuffer_free.restype = None +_UniffiLib.ffi_algod_client_ffi_rustbuffer_reserve.argtypes = ( + _UniffiRustBuffer, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rustbuffer_reserve.restype = _UniffiRustBuffer +_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8, +) +_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure): + _fields_ = [ + ("handle", ctypes.c_uint64), + ("free", _UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK), + ] +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u8.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u8.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u8.restype = ctypes.c_uint8 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u8.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i8.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i8.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i8.restype = ctypes.c_int8 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i8.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u16.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u16.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u16.restype = ctypes.c_uint16 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u16.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i16.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i16.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i16.restype = ctypes.c_int16 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i16.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u32.restype = ctypes.c_uint32 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i32.restype = ctypes.c_int32 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_u64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_u64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_u64.restype = ctypes.c_uint64 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_u64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_i64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_i64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_i64.restype = ctypes.c_int64 +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_i64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_f32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_f32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_f32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_f32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_f32.restype = ctypes.c_float +_UniffiLib.ffi_algod_client_ffi_rust_future_free_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_f32.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_f64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_f64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_f64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_f64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_f64.restype = ctypes.c_double +_UniffiLib.ffi_algod_client_ffi_rust_future_free_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_f64.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_rust_buffer.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer +_UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_void.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_poll_void.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_cancel_void.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_void.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algod_client_ffi_rust_future_complete_void.restype = None +_UniffiLib.ffi_algod_client_ffi_rust_future_free_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algod_client_ffi_rust_future_free_void.restype = None +_UniffiLib.uniffi_algod_client_ffi_fn_clone_algodclient.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algod_client_ffi_fn_clone_algodclient.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_free_algodclient.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algod_client_ffi_fn_free_algodclient.restype = None +_UniffiLib.uniffi_algod_client_ffi_fn_clone_algodclienttrait.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algod_client_ffi_fn_clone_algodclienttrait.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_free_algodclienttrait.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algod_client_ffi_fn_free_algodclienttrait.restype = None +class _UniffiForeignFutureResultVoid(ctypes.Structure): + _fields_ = [ + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultVoid, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +class _UniffiForeignFutureResultRustBuffer(ctypes.Structure): + _fields_ = [ + ("return_value", _UniffiRustBuffer), + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultRustBuffer, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD4 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD5 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD6 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD7 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD8 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD9 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD10 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD11 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD12 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD13 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD14 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD15 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD16 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD17 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD18 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD19 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD20 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD21 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD22 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD23 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD24 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD25 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD26 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD27 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD28 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD29 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD30 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD31 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD32 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD33 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD34 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD35 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD36 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD37 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD38 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD39 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD40 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD41 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD42 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD43 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD44 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD45 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD46 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD47 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD48 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD49 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD50 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD51 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD52 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD53 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD54 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64, +) +_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiVTableCallbackInterfaceAlgodClientFfiAlgodClientTrait(ctypes.Structure): + _fields_ = [ + ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT), + ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT), + ("health_check", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD0), + ("get_ready", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD1), + ("metrics", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD2), + ("get_genesis", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD3), + ("swagger_json", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD4), + ("get_version", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD5), + ("get_debug_settings_prof", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD6), + ("put_debug_settings_prof", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD7), + ("get_config", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD8), + ("account_information", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD9), + ("account_asset_information", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD10), + ("account_assets_information", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD11), + ("account_application_information", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD12), + ("get_pending_transactions_by_address", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD13), + ("get_block", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD14), + ("get_block_txids", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD15), + ("get_block_hash", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD16), + ("get_transaction_proof", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD17), + ("get_block_logs", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD18), + ("get_supply", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD19), + ("get_participation_keys", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD20), + ("add_participation_key", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD21), + ("generate_participation_keys", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD22), + ("get_participation_key_by_id", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD23), + ("append_keys", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD24), + ("delete_participation_key_by_id", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD25), + ("shutdown_node", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD26), + ("get_status", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD27), + ("wait_for_block", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD28), + ("raw_transaction", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD29), + ("raw_transaction_async", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD30), + ("simulate_transaction", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD31), + ("transaction_params", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD32), + ("get_pending_transactions", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD33), + ("pending_transaction_information", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD34), + ("get_ledger_state_delta", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD35), + ("get_transaction_group_ledger_state_deltas_for_round", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD36), + ("get_ledger_state_delta_for_transaction_group", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD37), + ("get_state_proof", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD38), + ("get_light_block_header_proof", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD39), + ("get_application_by_id", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD40), + ("get_application_boxes", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD41), + ("get_application_box_by_name", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD42), + ("get_asset_by_id", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD43), + ("get_sync_round", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD44), + ("unset_sync_round", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD45), + ("set_sync_round", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD46), + ("teal_compile", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD47), + ("teal_disassemble", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD48), + ("start_catchup", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD49), + ("abort_catchup", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD50), + ("teal_dryrun", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD51), + ("experimental_check", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD52), + ("get_block_time_stamp_offset", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD53), + ("set_block_time_stamp_offset", _UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD54), + ] +_UniffiLib.uniffi_algod_client_ffi_fn_init_callback_vtable_algodclienttrait.argtypes = ( + ctypes.POINTER(_UniffiVTableCallbackInterfaceAlgodClientFfiAlgodClientTrait), +) +_UniffiLib.uniffi_algod_client_ffi_fn_init_callback_vtable_algodclienttrait.restype = None +_UniffiLib.uniffi_algod_client_ffi_fn_constructor_algodclient_new.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algod_client_ffi_fn_constructor_algodclient_new.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_abort_catchup.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_abort_catchup.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_application_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_application_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_asset_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_asset_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_assets_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_assets_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_add_participation_key.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_add_participation_key.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_append_keys.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_append_keys.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_delete_participation_key_by_id.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_delete_participation_key_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_experimental_check.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_experimental_check.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_generate_participation_keys.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_generate_participation_keys.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_box_by_name.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_box_by_name.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_boxes.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_boxes.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_by_id.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_asset_by_id.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_asset_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_hash.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_hash.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_logs.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_logs.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_time_stamp_offset.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_time_stamp_offset.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_txids.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_txids.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_config.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_config.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_debug_settings_prof.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_debug_settings_prof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_genesis.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_genesis.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ledger_state_delta.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ledger_state_delta.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ledger_state_delta_for_transaction_group.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ledger_state_delta_for_transaction_group.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_light_block_header_proof.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_light_block_header_proof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_participation_key_by_id.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_participation_key_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_participation_keys.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_participation_keys.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_pending_transactions.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_pending_transactions.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_pending_transactions_by_address.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_pending_transactions_by_address.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ready.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ready.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_state_proof.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_state_proof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_status.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_status.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_supply.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_supply.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_sync_round.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_sync_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_transaction_group_ledger_state_deltas_for_round.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_transaction_group_ledger_state_deltas_for_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_transaction_proof.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_transaction_proof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_version.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_version.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_health_check.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_health_check.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_metrics.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_metrics.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_pending_transaction_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_pending_transaction_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_put_debug_settings_prof.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_put_debug_settings_prof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_raw_transaction.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_raw_transaction.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_raw_transaction_async.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_raw_transaction_async.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_set_block_time_stamp_offset.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_set_block_time_stamp_offset.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_set_sync_round.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_set_sync_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_shutdown_node.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_shutdown_node.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_simulate_transaction.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_simulate_transaction.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_start_catchup.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_start_catchup.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_swagger_json.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_swagger_json.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_compile.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_compile.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_disassemble.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_disassemble.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_dryrun.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_dryrun.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_transaction_params.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_transaction_params.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_unset_sync_round.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_unset_sync_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_wait_for_block.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_wait_for_block.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_health_check.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_health_check.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ready.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ready.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_metrics.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_metrics.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_genesis.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_genesis.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_swagger_json.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_swagger_json.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_version.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_version.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_debug_settings_prof.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_debug_settings_prof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_put_debug_settings_prof.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_put_debug_settings_prof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_config.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_config.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_asset_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_asset_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_assets_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_assets_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_application_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_application_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_pending_transactions_by_address.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_pending_transactions_by_address.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_txids.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_txids.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_hash.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_hash.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_transaction_proof.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_transaction_proof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_logs.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_logs.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_supply.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_supply.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_participation_keys.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_participation_keys.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_add_participation_key.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_add_participation_key.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_generate_participation_keys.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_generate_participation_keys.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_participation_key_by_id.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_participation_key_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_append_keys.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_append_keys.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_delete_participation_key_by_id.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_delete_participation_key_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_shutdown_node.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_shutdown_node.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_status.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_status.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_wait_for_block.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_wait_for_block.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_raw_transaction.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_raw_transaction.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_raw_transaction_async.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_raw_transaction_async.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_simulate_transaction.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_simulate_transaction.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_transaction_params.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_transaction_params.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_pending_transactions.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_pending_transactions.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_pending_transaction_information.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_pending_transaction_information.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ledger_state_delta.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ledger_state_delta.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_transaction_group_ledger_state_deltas_for_round.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_transaction_group_ledger_state_deltas_for_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ledger_state_delta_for_transaction_group.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ledger_state_delta_for_transaction_group.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_state_proof.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_state_proof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_light_block_header_proof.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_light_block_header_proof.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_by_id.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_boxes.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_boxes.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_box_by_name.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_box_by_name.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_asset_by_id.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_asset_by_id.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_sync_round.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_sync_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_unset_sync_round.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_unset_sync_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_set_sync_round.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_set_sync_round.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_compile.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_compile.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_disassemble.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_disassemble.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_start_catchup.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_start_catchup.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_abort_catchup.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_abort_catchup.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_dryrun.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_dryrun.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_experimental_check.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_experimental_check.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_time_stamp_offset.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_time_stamp_offset.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_set_block_time_stamp_offset.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_set_block_time_stamp_offset.restype = ctypes.c_uint64 +_UniffiLib.ffi_algod_client_ffi_uniffi_contract_version.argtypes = ( +) +_UniffiLib.ffi_algod_client_ffi_uniffi_contract_version.restype = ctypes.c_uint32 +_UniffiLib.uniffi_algod_client_ffi_checksum_constructor_algodclient_new.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_constructor_algodclient_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_abort_catchup.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_abort_catchup.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_application_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_application_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_asset_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_asset_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_assets_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_assets_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_account_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_add_participation_key.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_add_participation_key.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_append_keys.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_append_keys.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_delete_participation_key_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_delete_participation_key_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_experimental_check.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_experimental_check.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_generate_participation_keys.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_generate_participation_keys.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_box_by_name.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_box_by_name.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_boxes.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_boxes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_application_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_asset_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_asset_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_hash.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_hash.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_logs.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_logs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_time_stamp_offset.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_time_stamp_offset.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_txids.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_block_txids.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_config.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_config.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_debug_settings_prof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_debug_settings_prof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_genesis.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_genesis.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ledger_state_delta.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ledger_state_delta.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ledger_state_delta_for_transaction_group.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ledger_state_delta_for_transaction_group.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_light_block_header_proof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_light_block_header_proof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_participation_key_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_participation_key_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_participation_keys.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_participation_keys.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_pending_transactions.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_pending_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_pending_transactions_by_address.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_pending_transactions_by_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ready.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_ready.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_state_proof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_state_proof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_status.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_status.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_supply.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_supply.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_sync_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_sync_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_transaction_group_ledger_state_deltas_for_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_transaction_group_ledger_state_deltas_for_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_transaction_proof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_transaction_proof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_version.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_get_version.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_health_check.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_health_check.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_metrics.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_metrics.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_pending_transaction_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_pending_transaction_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_put_debug_settings_prof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_put_debug_settings_prof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_raw_transaction.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_raw_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_raw_transaction_async.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_raw_transaction_async.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_set_block_time_stamp_offset.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_set_block_time_stamp_offset.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_set_sync_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_set_sync_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_shutdown_node.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_shutdown_node.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_simulate_transaction.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_simulate_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_start_catchup.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_start_catchup.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_swagger_json.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_swagger_json.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_compile.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_compile.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_disassemble.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_disassemble.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_dryrun.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_teal_dryrun.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_transaction_params.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_transaction_params.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_unset_sync_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_unset_sync_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_wait_for_block.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclient_wait_for_block.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_health_check.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_health_check.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ready.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ready.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_metrics.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_metrics.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_genesis.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_genesis.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_swagger_json.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_swagger_json.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_version.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_version.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_debug_settings_prof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_debug_settings_prof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_put_debug_settings_prof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_put_debug_settings_prof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_config.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_config.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_asset_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_asset_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_assets_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_assets_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_application_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_account_application_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_pending_transactions_by_address.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_pending_transactions_by_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_txids.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_txids.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_hash.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_hash.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_transaction_proof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_transaction_proof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_logs.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_logs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_supply.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_supply.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_participation_keys.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_participation_keys.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_add_participation_key.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_add_participation_key.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_generate_participation_keys.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_generate_participation_keys.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_participation_key_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_participation_key_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_append_keys.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_append_keys.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_delete_participation_key_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_delete_participation_key_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_shutdown_node.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_shutdown_node.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_status.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_status.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_wait_for_block.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_wait_for_block.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_raw_transaction.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_raw_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_raw_transaction_async.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_raw_transaction_async.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_simulate_transaction.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_simulate_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_transaction_params.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_transaction_params.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_pending_transactions.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_pending_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_pending_transaction_information.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_pending_transaction_information.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ledger_state_delta.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ledger_state_delta.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_transaction_group_ledger_state_deltas_for_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_transaction_group_ledger_state_deltas_for_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ledger_state_delta_for_transaction_group.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_ledger_state_delta_for_transaction_group.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_state_proof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_state_proof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_light_block_header_proof.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_light_block_header_proof.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_boxes.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_boxes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_box_by_name.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_application_box_by_name.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_asset_by_id.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_asset_by_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_sync_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_sync_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_unset_sync_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_unset_sync_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_set_sync_round.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_set_sync_round.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_compile.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_compile.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_disassemble.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_disassemble.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_start_catchup.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_start_catchup.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_abort_catchup.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_abort_catchup.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_dryrun.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_teal_dryrun.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_experimental_check.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_experimental_check.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_time_stamp_offset.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_get_block_time_stamp_offset.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_set_block_time_stamp_offset.argtypes = ( +) +_UniffiLib.uniffi_algod_client_ffi_checksum_method_algodclienttrait_set_block_time_stamp_offset.restype = ctypes.c_uint16 + +_uniffi_check_contract_api_version(_UniffiLib) +# _uniffi_check_api_checksums(_UniffiLib) + +# RustFuturePoll values +_UNIFFI_RUST_FUTURE_POLL_READY = 0 +_UNIFFI_RUST_FUTURE_POLL_WAKE = 1 + +# Stores futures for _uniffi_continuation_callback +_UniffiContinuationHandleMap = _UniffiHandleMap() + +_UNIFFI_GLOBAL_EVENT_LOOP = None + +""" +Set the event loop to use for async functions + +This is needed if some async functions run outside of the eventloop, for example: + - A non-eventloop thread is spawned, maybe from `EventLoop.run_in_executor` or maybe from the + Rust code spawning its own thread. + - The Rust code calls an async callback method from a sync callback function, using something + like `pollster` to block on the async call. + +In this case, we need an event loop to run the Python async function, but there's no eventloop set +for the thread. Use `uniffi_set_event_loop` to force an eventloop to be used in this case. +""" +def uniffi_set_event_loop(eventloop: asyncio.BaseEventLoop): + global _UNIFFI_GLOBAL_EVENT_LOOP + _UNIFFI_GLOBAL_EVENT_LOOP = eventloop + +def _uniffi_get_event_loop(): + if _UNIFFI_GLOBAL_EVENT_LOOP is not None: + return _UNIFFI_GLOBAL_EVENT_LOOP + else: + return asyncio.get_running_loop() + +# Continuation callback for async functions +# lift the return value or error and resolve the future, causing the async function to resume. +@_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK +def _uniffi_continuation_callback(future_ptr, poll_code): + (eventloop, future) = _UniffiContinuationHandleMap.remove(future_ptr) + eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code) + +def _uniffi_set_future_result(future, poll_code): + if not future.cancelled(): + future.set_result(poll_code) + +async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter): + try: + eventloop = _uniffi_get_event_loop() + + # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value + while True: + future = eventloop.create_future() + ffi_poll( + rust_future, + _uniffi_continuation_callback, + _UniffiContinuationHandleMap.insert((eventloop, future)), + ) + poll_code = await future + if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY: + break + + return lift_func( + _uniffi_rust_call_with_error(error_ffi_converter, ffi_complete, rust_future) + ) + finally: + ffi_free(rust_future) +def _uniffi_trait_interface_call_async(make_call, uniffi_out_dropped_callback, handle_success, handle_error): + async def make_call_and_call_callback(): + try: + handle_success(await make_call()) + except Exception as e: + print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + handle_error( + _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR, + _UniffiFfiConverterString.lower(repr(e)), + ) + eventloop = _uniffi_get_event_loop() + task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop) + handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task)) + uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback) + +def _uniffi_trait_interface_call_async_with_error(make_call, uniffi_out_dropped_callback, handle_success, handle_error, error_type, lower_error): + async def make_call_and_call_callback(): + try: + try: + handle_success(await make_call()) + except error_type as e: + handle_error( + _UniffiRustCallStatus.CALL_ERROR, + lower_error(e), + ) + except Exception as e: + print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + handle_error( + _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR, + _UniffiFfiConverterString.lower(repr(e)), + ) + eventloop = _uniffi_get_event_loop() + task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop) + handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task)) + uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback) + +_UNIFFI_FOREIGN_FUTURE_HANDLE_MAP = _UniffiHandleMap() + +@_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK +def _uniffi_future_dropped_callback(handle): + (eventloop, task) = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.remove(handle) + eventloop.call_soon(_uniffi_cancel_task, task) + +def _uniffi_cancel_task(task): + if not task.done(): + task.cancel() + +# Public interface members begin here. + + +class _UniffiFfiConverterString: + @staticmethod + def check_lower(value): + if not isinstance(value, str): + raise TypeError("argument must be str, not {}".format(type(value).__name__)) + return value + + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative string length") + utf8_bytes = buf.read(size) + return utf8_bytes.decode("utf-8") + + @staticmethod + def write(value, buf): + utf8_bytes = value.encode("utf-8") + buf.write_i32(len(utf8_bytes)) + buf.write(utf8_bytes) + + @staticmethod + def lift(buf): + with buf.consume_with_stream() as stream: + return stream.read(stream.remaining()).decode("utf-8") + + @staticmethod + def lower(value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + builder.write(value.encode("utf-8")) + return builder.finalize() + +@dataclass +class AbortCatchup: + """ + An catchpoint abort response. +""" + def __init__(self, *, catchup_message:str): + self.catchup_message = catchup_message + + + + + def __str__(self): + return "AbortCatchup(catchup_message={})".format(self.catchup_message) + def __eq__(self, other): + if self.catchup_message != other.catchup_message: + return False + return True + +class _UniffiFfiConverterTypeAbortCatchup(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AbortCatchup( + catchup_message=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.catchup_message) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.catchup_message, buf) + +class _UniffiFfiConverterUInt64(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u64" + VALUE_MIN = 0 + VALUE_MAX = 2**64 + + @staticmethod + def read(buf): + return buf.read_u64() + + @staticmethod + def write(value, buf): + buf.write_u64(value) + +class _UniffiFfiConverterUInt32(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u32" + VALUE_MIN = 0 + VALUE_MAX = 2**32 + + @staticmethod + def read(buf): + return buf.read_u32() + + @staticmethod + def write(value, buf): + buf.write_u32(value) + +@dataclass +class ApplicationStateSchema: + """ + Specifies maximums on the number of each type that may be stored. +""" + def __init__(self, *, num_uint:int, num_byte_slice:int): + self.num_uint = num_uint + self.num_byte_slice = num_byte_slice + + + + + def __str__(self): + return "ApplicationStateSchema(num_uint={}, num_byte_slice={})".format(self.num_uint, self.num_byte_slice) + def __eq__(self, other): + if self.num_uint != other.num_uint: + return False + if self.num_byte_slice != other.num_byte_slice: + return False + return True + +class _UniffiFfiConverterTypeApplicationStateSchema(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationStateSchema( + num_uint=_UniffiFfiConverterUInt32.read(buf), + num_byte_slice=_UniffiFfiConverterUInt32.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt32.check_lower(value.num_uint) + _UniffiFfiConverterUInt32.check_lower(value.num_byte_slice) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt32.write(value.num_uint, buf) + _UniffiFfiConverterUInt32.write(value.num_byte_slice, buf) + +class _UniffiFfiConverterBytes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative byte string length") + return buf.read(size) + + @staticmethod + def check_lower(value): + try: + memoryview(value) + except TypeError: + raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) + + @staticmethod + def write(value, buf): + buf.write_i32(len(value)) + buf.write(value) + +@dataclass +class TealValue: + """ + Represents a TEAL value. +""" + def __init__(self, *, type:int, bytes:bytes, uint:int): + self.type = type + self.bytes = bytes + self.uint = uint + + + + + def __str__(self): + return "TealValue(type={}, bytes={}, uint={})".format(self.type, self.bytes, self.uint) + def __eq__(self, other): + if self.type != other.type: + return False + if self.bytes != other.bytes: + return False + if self.uint != other.uint: + return False + return True + +class _UniffiFfiConverterTypeTealValue(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TealValue( + type=_UniffiFfiConverterUInt64.read(buf), + bytes=_UniffiFfiConverterBytes.read(buf), + uint=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.type) + _UniffiFfiConverterBytes.check_lower(value.bytes) + _UniffiFfiConverterUInt64.check_lower(value.uint) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.type, buf) + _UniffiFfiConverterBytes.write(value.bytes, buf) + _UniffiFfiConverterUInt64.write(value.uint, buf) + +@dataclass +class TealKeyValue: + """ + Represents a key-value pair in an application store. +""" + def __init__(self, *, key:str, value:TealValue): + self.key = key + self.value = value + + + + + def __str__(self): + return "TealKeyValue(key={}, value={})".format(self.key, self.value) + def __eq__(self, other): + if self.key != other.key: + return False + if self.value != other.value: + return False + return True + +class _UniffiFfiConverterTypeTealKeyValue(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TealKeyValue( + key=_UniffiFfiConverterString.read(buf), + value=_UniffiFfiConverterTypeTealValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.key) + _UniffiFfiConverterTypeTealValue.check_lower(value.value) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.key, buf) + _UniffiFfiConverterTypeTealValue.write(value.value, buf) + +class _UniffiFfiConverterSequenceTypeTealKeyValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeTealKeyValue.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeTealKeyValue.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeTealKeyValue.read(buf) for i in range(count) + ] + + +class _UniffiFfiConverterTypeTealKeyValueStore: + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeTealKeyValue.write(value, buf) + + @staticmethod + def read(buf): + return _UniffiFfiConverterSequenceTypeTealKeyValue.read(buf) + + @staticmethod + def lift(value): + return _UniffiFfiConverterSequenceTypeTealKeyValue.lift(value) + + @staticmethod + def check_lower(value): + return _UniffiFfiConverterSequenceTypeTealKeyValue.check_lower(value) + + @staticmethod + def lower(value): + return _UniffiFfiConverterSequenceTypeTealKeyValue.lower(value) + + +TealKeyValueStore = typing.List[TealKeyValue] + +class _UniffiFfiConverterOptionalTypeTealKeyValueStore(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeTealKeyValueStore.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeTealKeyValueStore.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeTealKeyValueStore.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class ApplicationLocalState: + """ + Stores local state associated with an application. +""" + def __init__(self, *, id:int, schema:ApplicationStateSchema, key_value:typing.Optional[TealKeyValueStore]): + self.id = id + self.schema = schema + self.key_value = key_value + + + + + def __str__(self): + return "ApplicationLocalState(id={}, schema={}, key_value={})".format(self.id, self.schema, self.key_value) + def __eq__(self, other): + if self.id != other.id: + return False + if self.schema != other.schema: + return False + if self.key_value != other.key_value: + return False + return True + +class _UniffiFfiConverterTypeApplicationLocalState(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationLocalState( + id=_UniffiFfiConverterUInt64.read(buf), + schema=_UniffiFfiConverterTypeApplicationStateSchema.read(buf), + key_value=_UniffiFfiConverterOptionalTypeTealKeyValueStore.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.id) + _UniffiFfiConverterTypeApplicationStateSchema.check_lower(value.schema) + _UniffiFfiConverterOptionalTypeTealKeyValueStore.check_lower(value.key_value) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.id, buf) + _UniffiFfiConverterTypeApplicationStateSchema.write(value.schema, buf) + _UniffiFfiConverterOptionalTypeTealKeyValueStore.write(value.key_value, buf) + +class _UniffiFfiConverterSequenceTypeApplicationLocalState(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeApplicationLocalState.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeApplicationLocalState.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeApplicationLocalState.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeApplicationLocalState(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeApplicationLocalState.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeApplicationLocalState.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeApplicationLocalState.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeApplicationStateSchema(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeApplicationStateSchema.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeApplicationStateSchema.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeApplicationStateSchema.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterBoolean: + @classmethod + def check_lower(cls, value): + return not not value + + @classmethod + def lower(cls, value): + return 1 if value else 0 + + @staticmethod + def lift(value): + return value != 0 + + @classmethod + def read(cls, buf): + return cls.lift(buf.read_u8()) + + @classmethod + def write(cls, value, buf): + buf.write_u8(value) + +@dataclass +class AssetHolding: + """ + Describes an asset held by an account. + + Definition: + data/basics/userBalance.go : AssetHolding +""" + def __init__(self, *, amount:int, asset_id:int, is_frozen:bool): + self.amount = amount + self.asset_id = asset_id + self.is_frozen = is_frozen + + + + + def __str__(self): + return "AssetHolding(amount={}, asset_id={}, is_frozen={})".format(self.amount, self.asset_id, self.is_frozen) + def __eq__(self, other): + if self.amount != other.amount: + return False + if self.asset_id != other.asset_id: + return False + if self.is_frozen != other.is_frozen: + return False + return True + +class _UniffiFfiConverterTypeAssetHolding(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetHolding( + amount=_UniffiFfiConverterUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + is_frozen=_UniffiFfiConverterBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.amount) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterBoolean.check_lower(value.is_frozen) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.amount, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterBoolean.write(value.is_frozen, buf) + +class _UniffiFfiConverterSequenceTypeAssetHolding(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAssetHolding.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAssetHolding.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAssetHolding.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeAssetHolding(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeAssetHolding.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeAssetHolding.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeAssetHolding.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalUInt32(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterUInt32.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterUInt32.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterUInt32.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class ApplicationParams: + """ + Stores the global information associated with an application. +""" + def __init__(self, *, creator:str, approval_program:bytes, clear_state_program:bytes, extra_program_pages:typing.Optional[int], local_state_schema:typing.Optional[ApplicationStateSchema], global_state_schema:typing.Optional[ApplicationStateSchema], global_state:typing.Optional[TealKeyValueStore], version:typing.Optional[int]): + self.creator = creator + self.approval_program = approval_program + self.clear_state_program = clear_state_program + self.extra_program_pages = extra_program_pages + self.local_state_schema = local_state_schema + self.global_state_schema = global_state_schema + self.global_state = global_state + self.version = version + + + + + def __str__(self): + return "ApplicationParams(creator={}, approval_program={}, clear_state_program={}, extra_program_pages={}, local_state_schema={}, global_state_schema={}, global_state={}, version={})".format(self.creator, self.approval_program, self.clear_state_program, self.extra_program_pages, self.local_state_schema, self.global_state_schema, self.global_state, self.version) + def __eq__(self, other): + if self.creator != other.creator: + return False + if self.approval_program != other.approval_program: + return False + if self.clear_state_program != other.clear_state_program: + return False + if self.extra_program_pages != other.extra_program_pages: + return False + if self.local_state_schema != other.local_state_schema: + return False + if self.global_state_schema != other.global_state_schema: + return False + if self.global_state != other.global_state: + return False + if self.version != other.version: + return False + return True + +class _UniffiFfiConverterTypeApplicationParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationParams( + creator=_UniffiFfiConverterString.read(buf), + approval_program=_UniffiFfiConverterBytes.read(buf), + clear_state_program=_UniffiFfiConverterBytes.read(buf), + extra_program_pages=_UniffiFfiConverterOptionalUInt32.read(buf), + local_state_schema=_UniffiFfiConverterOptionalTypeApplicationStateSchema.read(buf), + global_state_schema=_UniffiFfiConverterOptionalTypeApplicationStateSchema.read(buf), + global_state=_UniffiFfiConverterOptionalTypeTealKeyValueStore.read(buf), + version=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.creator) + _UniffiFfiConverterBytes.check_lower(value.approval_program) + _UniffiFfiConverterBytes.check_lower(value.clear_state_program) + _UniffiFfiConverterOptionalUInt32.check_lower(value.extra_program_pages) + _UniffiFfiConverterOptionalTypeApplicationStateSchema.check_lower(value.local_state_schema) + _UniffiFfiConverterOptionalTypeApplicationStateSchema.check_lower(value.global_state_schema) + _UniffiFfiConverterOptionalTypeTealKeyValueStore.check_lower(value.global_state) + _UniffiFfiConverterOptionalUInt64.check_lower(value.version) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.creator, buf) + _UniffiFfiConverterBytes.write(value.approval_program, buf) + _UniffiFfiConverterBytes.write(value.clear_state_program, buf) + _UniffiFfiConverterOptionalUInt32.write(value.extra_program_pages, buf) + _UniffiFfiConverterOptionalTypeApplicationStateSchema.write(value.local_state_schema, buf) + _UniffiFfiConverterOptionalTypeApplicationStateSchema.write(value.global_state_schema, buf) + _UniffiFfiConverterOptionalTypeTealKeyValueStore.write(value.global_state, buf) + _UniffiFfiConverterOptionalUInt64.write(value.version, buf) + +@dataclass +class Application: + """ + Application index and its parameters +""" + def __init__(self, *, id:int, params:ApplicationParams): + self.id = id + self.params = params + + + + + def __str__(self): + return "Application(id={}, params={})".format(self.id, self.params) + def __eq__(self, other): + if self.id != other.id: + return False + if self.params != other.params: + return False + return True + +class _UniffiFfiConverterTypeApplication(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Application( + id=_UniffiFfiConverterUInt64.read(buf), + params=_UniffiFfiConverterTypeApplicationParams.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.id) + _UniffiFfiConverterTypeApplicationParams.check_lower(value.params) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.id, buf) + _UniffiFfiConverterTypeApplicationParams.write(value.params, buf) + +class _UniffiFfiConverterSequenceTypeApplication(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeApplication.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeApplication.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeApplication.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeApplication(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeApplication.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeApplication.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeApplication.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBoolean.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBoolean.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBoolean.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AssetParams: + """ + AssetParams specifies the parameters for an asset. + + [apar] when part of an AssetConfig transaction. + + Definition: + data/transactions/asset.go : AssetParams +""" + def __init__(self, *, clawback:typing.Optional[str], creator:str, decimals:int, default_frozen:typing.Optional[bool], freeze:typing.Optional[str], manager:typing.Optional[str], metadata_hash:typing.Optional[bytes], name:typing.Optional[str], name_b64:typing.Optional[bytes], reserve:typing.Optional[str], total:int, unit_name:typing.Optional[str], unit_name_b64:typing.Optional[bytes], url:typing.Optional[str], url_b64:typing.Optional[bytes]): + self.clawback = clawback + self.creator = creator + self.decimals = decimals + self.default_frozen = default_frozen + self.freeze = freeze + self.manager = manager + self.metadata_hash = metadata_hash + self.name = name + self.name_b64 = name_b64 + self.reserve = reserve + self.total = total + self.unit_name = unit_name + self.unit_name_b64 = unit_name_b64 + self.url = url + self.url_b64 = url_b64 + + + + + def __str__(self): + return "AssetParams(clawback={}, creator={}, decimals={}, default_frozen={}, freeze={}, manager={}, metadata_hash={}, name={}, name_b64={}, reserve={}, total={}, unit_name={}, unit_name_b64={}, url={}, url_b64={})".format(self.clawback, self.creator, self.decimals, self.default_frozen, self.freeze, self.manager, self.metadata_hash, self.name, self.name_b64, self.reserve, self.total, self.unit_name, self.unit_name_b64, self.url, self.url_b64) + def __eq__(self, other): + if self.clawback != other.clawback: + return False + if self.creator != other.creator: + return False + if self.decimals != other.decimals: + return False + if self.default_frozen != other.default_frozen: + return False + if self.freeze != other.freeze: + return False + if self.manager != other.manager: + return False + if self.metadata_hash != other.metadata_hash: + return False + if self.name != other.name: + return False + if self.name_b64 != other.name_b64: + return False + if self.reserve != other.reserve: + return False + if self.total != other.total: + return False + if self.unit_name != other.unit_name: + return False + if self.unit_name_b64 != other.unit_name_b64: + return False + if self.url != other.url: + return False + if self.url_b64 != other.url_b64: + return False + return True + +class _UniffiFfiConverterTypeAssetParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetParams( + clawback=_UniffiFfiConverterOptionalString.read(buf), + creator=_UniffiFfiConverterString.read(buf), + decimals=_UniffiFfiConverterUInt64.read(buf), + default_frozen=_UniffiFfiConverterOptionalBoolean.read(buf), + freeze=_UniffiFfiConverterOptionalString.read(buf), + manager=_UniffiFfiConverterOptionalString.read(buf), + metadata_hash=_UniffiFfiConverterOptionalBytes.read(buf), + name=_UniffiFfiConverterOptionalString.read(buf), + name_b64=_UniffiFfiConverterOptionalBytes.read(buf), + reserve=_UniffiFfiConverterOptionalString.read(buf), + total=_UniffiFfiConverterUInt64.read(buf), + unit_name=_UniffiFfiConverterOptionalString.read(buf), + unit_name_b64=_UniffiFfiConverterOptionalBytes.read(buf), + url=_UniffiFfiConverterOptionalString.read(buf), + url_b64=_UniffiFfiConverterOptionalBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalString.check_lower(value.clawback) + _UniffiFfiConverterString.check_lower(value.creator) + _UniffiFfiConverterUInt64.check_lower(value.decimals) + _UniffiFfiConverterOptionalBoolean.check_lower(value.default_frozen) + _UniffiFfiConverterOptionalString.check_lower(value.freeze) + _UniffiFfiConverterOptionalString.check_lower(value.manager) + _UniffiFfiConverterOptionalBytes.check_lower(value.metadata_hash) + _UniffiFfiConverterOptionalString.check_lower(value.name) + _UniffiFfiConverterOptionalBytes.check_lower(value.name_b64) + _UniffiFfiConverterOptionalString.check_lower(value.reserve) + _UniffiFfiConverterUInt64.check_lower(value.total) + _UniffiFfiConverterOptionalString.check_lower(value.unit_name) + _UniffiFfiConverterOptionalBytes.check_lower(value.unit_name_b64) + _UniffiFfiConverterOptionalString.check_lower(value.url) + _UniffiFfiConverterOptionalBytes.check_lower(value.url_b64) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalString.write(value.clawback, buf) + _UniffiFfiConverterString.write(value.creator, buf) + _UniffiFfiConverterUInt64.write(value.decimals, buf) + _UniffiFfiConverterOptionalBoolean.write(value.default_frozen, buf) + _UniffiFfiConverterOptionalString.write(value.freeze, buf) + _UniffiFfiConverterOptionalString.write(value.manager, buf) + _UniffiFfiConverterOptionalBytes.write(value.metadata_hash, buf) + _UniffiFfiConverterOptionalString.write(value.name, buf) + _UniffiFfiConverterOptionalBytes.write(value.name_b64, buf) + _UniffiFfiConverterOptionalString.write(value.reserve, buf) + _UniffiFfiConverterUInt64.write(value.total, buf) + _UniffiFfiConverterOptionalString.write(value.unit_name, buf) + _UniffiFfiConverterOptionalBytes.write(value.unit_name_b64, buf) + _UniffiFfiConverterOptionalString.write(value.url, buf) + _UniffiFfiConverterOptionalBytes.write(value.url_b64, buf) + +@dataclass +class Asset: + """ + Specifies both the unique identifier and the parameters for an asset +""" + def __init__(self, *, index:int, params:AssetParams): + self.index = index + self.params = params + + + + + def __str__(self): + return "Asset(index={}, params={})".format(self.index, self.params) + def __eq__(self, other): + if self.index != other.index: + return False + if self.params != other.params: + return False + return True + +class _UniffiFfiConverterTypeAsset(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Asset( + index=_UniffiFfiConverterUInt64.read(buf), + params=_UniffiFfiConverterTypeAssetParams.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.index) + _UniffiFfiConverterTypeAssetParams.check_lower(value.params) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.index, buf) + _UniffiFfiConverterTypeAssetParams.write(value.params, buf) + +class _UniffiFfiConverterSequenceTypeAsset(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAsset.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAsset.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAsset.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeAsset(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeAsset.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeAsset.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeAsset.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AccountParticipation: + """ + AccountParticipation describes the parameters used by this account in consensus protocol. +""" + def __init__(self, *, selection_participation_key:bytes, vote_first_valid:int, vote_key_dilution:int, vote_last_valid:int, vote_participation_key:bytes, state_proof_key:typing.Optional[bytes]): + self.selection_participation_key = selection_participation_key + self.vote_first_valid = vote_first_valid + self.vote_key_dilution = vote_key_dilution + self.vote_last_valid = vote_last_valid + self.vote_participation_key = vote_participation_key + self.state_proof_key = state_proof_key + + + + + def __str__(self): + return "AccountParticipation(selection_participation_key={}, vote_first_valid={}, vote_key_dilution={}, vote_last_valid={}, vote_participation_key={}, state_proof_key={})".format(self.selection_participation_key, self.vote_first_valid, self.vote_key_dilution, self.vote_last_valid, self.vote_participation_key, self.state_proof_key) + def __eq__(self, other): + if self.selection_participation_key != other.selection_participation_key: + return False + if self.vote_first_valid != other.vote_first_valid: + return False + if self.vote_key_dilution != other.vote_key_dilution: + return False + if self.vote_last_valid != other.vote_last_valid: + return False + if self.vote_participation_key != other.vote_participation_key: + return False + if self.state_proof_key != other.state_proof_key: + return False + return True + +class _UniffiFfiConverterTypeAccountParticipation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountParticipation( + selection_participation_key=_UniffiFfiConverterBytes.read(buf), + vote_first_valid=_UniffiFfiConverterUInt64.read(buf), + vote_key_dilution=_UniffiFfiConverterUInt64.read(buf), + vote_last_valid=_UniffiFfiConverterUInt64.read(buf), + vote_participation_key=_UniffiFfiConverterBytes.read(buf), + state_proof_key=_UniffiFfiConverterOptionalBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.selection_participation_key) + _UniffiFfiConverterUInt64.check_lower(value.vote_first_valid) + _UniffiFfiConverterUInt64.check_lower(value.vote_key_dilution) + _UniffiFfiConverterUInt64.check_lower(value.vote_last_valid) + _UniffiFfiConverterBytes.check_lower(value.vote_participation_key) + _UniffiFfiConverterOptionalBytes.check_lower(value.state_proof_key) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.selection_participation_key, buf) + _UniffiFfiConverterUInt64.write(value.vote_first_valid, buf) + _UniffiFfiConverterUInt64.write(value.vote_key_dilution, buf) + _UniffiFfiConverterUInt64.write(value.vote_last_valid, buf) + _UniffiFfiConverterBytes.write(value.vote_participation_key, buf) + _UniffiFfiConverterOptionalBytes.write(value.state_proof_key, buf) + +class _UniffiFfiConverterOptionalTypeAccountParticipation(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAccountParticipation.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAccountParticipation.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAccountParticipation.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class Account: + """ + Account information at a given round. + + Definition: + data/basics/userBalance.go : AccountData +""" + def __init__(self, *, address:str, amount:int, min_balance:int, amount_without_pending_rewards:int, apps_local_state:typing.Optional[typing.List[ApplicationLocalState]], total_apps_opted_in:int, apps_total_schema:typing.Optional[ApplicationStateSchema], apps_total_extra_pages:typing.Optional[int], assets:typing.Optional[typing.List[AssetHolding]], total_assets_opted_in:int, created_apps:typing.Optional[typing.List[Application]], total_created_apps:int, created_assets:typing.Optional[typing.List[Asset]], total_created_assets:int, total_boxes:typing.Optional[int], total_box_bytes:typing.Optional[int], participation:typing.Optional[AccountParticipation], incentive_eligible:typing.Optional[bool], pending_rewards:int, reward_base:typing.Optional[int], rewards:int, round:int, status:str, sig_type:typing.Optional[str], auth_addr:typing.Optional[str], last_proposed:typing.Optional[int], last_heartbeat:typing.Optional[int]): + self.address = address + self.amount = amount + self.min_balance = min_balance + self.amount_without_pending_rewards = amount_without_pending_rewards + self.apps_local_state = apps_local_state + self.total_apps_opted_in = total_apps_opted_in + self.apps_total_schema = apps_total_schema + self.apps_total_extra_pages = apps_total_extra_pages + self.assets = assets + self.total_assets_opted_in = total_assets_opted_in + self.created_apps = created_apps + self.total_created_apps = total_created_apps + self.created_assets = created_assets + self.total_created_assets = total_created_assets + self.total_boxes = total_boxes + self.total_box_bytes = total_box_bytes + self.participation = participation + self.incentive_eligible = incentive_eligible + self.pending_rewards = pending_rewards + self.reward_base = reward_base + self.rewards = rewards + self.round = round + self.status = status + self.sig_type = sig_type + self.auth_addr = auth_addr + self.last_proposed = last_proposed + self.last_heartbeat = last_heartbeat + + + + + def __str__(self): + return "Account(address={}, amount={}, min_balance={}, amount_without_pending_rewards={}, apps_local_state={}, total_apps_opted_in={}, apps_total_schema={}, apps_total_extra_pages={}, assets={}, total_assets_opted_in={}, created_apps={}, total_created_apps={}, created_assets={}, total_created_assets={}, total_boxes={}, total_box_bytes={}, participation={}, incentive_eligible={}, pending_rewards={}, reward_base={}, rewards={}, round={}, status={}, sig_type={}, auth_addr={}, last_proposed={}, last_heartbeat={})".format(self.address, self.amount, self.min_balance, self.amount_without_pending_rewards, self.apps_local_state, self.total_apps_opted_in, self.apps_total_schema, self.apps_total_extra_pages, self.assets, self.total_assets_opted_in, self.created_apps, self.total_created_apps, self.created_assets, self.total_created_assets, self.total_boxes, self.total_box_bytes, self.participation, self.incentive_eligible, self.pending_rewards, self.reward_base, self.rewards, self.round, self.status, self.sig_type, self.auth_addr, self.last_proposed, self.last_heartbeat) + def __eq__(self, other): + if self.address != other.address: + return False + if self.amount != other.amount: + return False + if self.min_balance != other.min_balance: + return False + if self.amount_without_pending_rewards != other.amount_without_pending_rewards: + return False + if self.apps_local_state != other.apps_local_state: + return False + if self.total_apps_opted_in != other.total_apps_opted_in: + return False + if self.apps_total_schema != other.apps_total_schema: + return False + if self.apps_total_extra_pages != other.apps_total_extra_pages: + return False + if self.assets != other.assets: + return False + if self.total_assets_opted_in != other.total_assets_opted_in: + return False + if self.created_apps != other.created_apps: + return False + if self.total_created_apps != other.total_created_apps: + return False + if self.created_assets != other.created_assets: + return False + if self.total_created_assets != other.total_created_assets: + return False + if self.total_boxes != other.total_boxes: + return False + if self.total_box_bytes != other.total_box_bytes: + return False + if self.participation != other.participation: + return False + if self.incentive_eligible != other.incentive_eligible: + return False + if self.pending_rewards != other.pending_rewards: + return False + if self.reward_base != other.reward_base: + return False + if self.rewards != other.rewards: + return False + if self.round != other.round: + return False + if self.status != other.status: + return False + if self.sig_type != other.sig_type: + return False + if self.auth_addr != other.auth_addr: + return False + if self.last_proposed != other.last_proposed: + return False + if self.last_heartbeat != other.last_heartbeat: + return False + return True + +class _UniffiFfiConverterTypeAccount(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Account( + address=_UniffiFfiConverterString.read(buf), + amount=_UniffiFfiConverterUInt64.read(buf), + min_balance=_UniffiFfiConverterUInt64.read(buf), + amount_without_pending_rewards=_UniffiFfiConverterUInt64.read(buf), + apps_local_state=_UniffiFfiConverterOptionalSequenceTypeApplicationLocalState.read(buf), + total_apps_opted_in=_UniffiFfiConverterUInt64.read(buf), + apps_total_schema=_UniffiFfiConverterOptionalTypeApplicationStateSchema.read(buf), + apps_total_extra_pages=_UniffiFfiConverterOptionalUInt64.read(buf), + assets=_UniffiFfiConverterOptionalSequenceTypeAssetHolding.read(buf), + total_assets_opted_in=_UniffiFfiConverterUInt64.read(buf), + created_apps=_UniffiFfiConverterOptionalSequenceTypeApplication.read(buf), + total_created_apps=_UniffiFfiConverterUInt64.read(buf), + created_assets=_UniffiFfiConverterOptionalSequenceTypeAsset.read(buf), + total_created_assets=_UniffiFfiConverterUInt64.read(buf), + total_boxes=_UniffiFfiConverterOptionalUInt64.read(buf), + total_box_bytes=_UniffiFfiConverterOptionalUInt64.read(buf), + participation=_UniffiFfiConverterOptionalTypeAccountParticipation.read(buf), + incentive_eligible=_UniffiFfiConverterOptionalBoolean.read(buf), + pending_rewards=_UniffiFfiConverterUInt64.read(buf), + reward_base=_UniffiFfiConverterOptionalUInt64.read(buf), + rewards=_UniffiFfiConverterUInt64.read(buf), + round=_UniffiFfiConverterUInt64.read(buf), + status=_UniffiFfiConverterString.read(buf), + sig_type=_UniffiFfiConverterOptionalString.read(buf), + auth_addr=_UniffiFfiConverterOptionalString.read(buf), + last_proposed=_UniffiFfiConverterOptionalUInt64.read(buf), + last_heartbeat=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterUInt64.check_lower(value.amount) + _UniffiFfiConverterUInt64.check_lower(value.min_balance) + _UniffiFfiConverterUInt64.check_lower(value.amount_without_pending_rewards) + _UniffiFfiConverterOptionalSequenceTypeApplicationLocalState.check_lower(value.apps_local_state) + _UniffiFfiConverterUInt64.check_lower(value.total_apps_opted_in) + _UniffiFfiConverterOptionalTypeApplicationStateSchema.check_lower(value.apps_total_schema) + _UniffiFfiConverterOptionalUInt64.check_lower(value.apps_total_extra_pages) + _UniffiFfiConverterOptionalSequenceTypeAssetHolding.check_lower(value.assets) + _UniffiFfiConverterUInt64.check_lower(value.total_assets_opted_in) + _UniffiFfiConverterOptionalSequenceTypeApplication.check_lower(value.created_apps) + _UniffiFfiConverterUInt64.check_lower(value.total_created_apps) + _UniffiFfiConverterOptionalSequenceTypeAsset.check_lower(value.created_assets) + _UniffiFfiConverterUInt64.check_lower(value.total_created_assets) + _UniffiFfiConverterOptionalUInt64.check_lower(value.total_boxes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.total_box_bytes) + _UniffiFfiConverterOptionalTypeAccountParticipation.check_lower(value.participation) + _UniffiFfiConverterOptionalBoolean.check_lower(value.incentive_eligible) + _UniffiFfiConverterUInt64.check_lower(value.pending_rewards) + _UniffiFfiConverterOptionalUInt64.check_lower(value.reward_base) + _UniffiFfiConverterUInt64.check_lower(value.rewards) + _UniffiFfiConverterUInt64.check_lower(value.round) + _UniffiFfiConverterString.check_lower(value.status) + _UniffiFfiConverterOptionalString.check_lower(value.sig_type) + _UniffiFfiConverterOptionalString.check_lower(value.auth_addr) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_proposed) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_heartbeat) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterUInt64.write(value.amount, buf) + _UniffiFfiConverterUInt64.write(value.min_balance, buf) + _UniffiFfiConverterUInt64.write(value.amount_without_pending_rewards, buf) + _UniffiFfiConverterOptionalSequenceTypeApplicationLocalState.write(value.apps_local_state, buf) + _UniffiFfiConverterUInt64.write(value.total_apps_opted_in, buf) + _UniffiFfiConverterOptionalTypeApplicationStateSchema.write(value.apps_total_schema, buf) + _UniffiFfiConverterOptionalUInt64.write(value.apps_total_extra_pages, buf) + _UniffiFfiConverterOptionalSequenceTypeAssetHolding.write(value.assets, buf) + _UniffiFfiConverterUInt64.write(value.total_assets_opted_in, buf) + _UniffiFfiConverterOptionalSequenceTypeApplication.write(value.created_apps, buf) + _UniffiFfiConverterUInt64.write(value.total_created_apps, buf) + _UniffiFfiConverterOptionalSequenceTypeAsset.write(value.created_assets, buf) + _UniffiFfiConverterUInt64.write(value.total_created_assets, buf) + _UniffiFfiConverterOptionalUInt64.write(value.total_boxes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.total_box_bytes, buf) + _UniffiFfiConverterOptionalTypeAccountParticipation.write(value.participation, buf) + _UniffiFfiConverterOptionalBoolean.write(value.incentive_eligible, buf) + _UniffiFfiConverterUInt64.write(value.pending_rewards, buf) + _UniffiFfiConverterOptionalUInt64.write(value.reward_base, buf) + _UniffiFfiConverterUInt64.write(value.rewards, buf) + _UniffiFfiConverterUInt64.write(value.round, buf) + _UniffiFfiConverterString.write(value.status, buf) + _UniffiFfiConverterOptionalString.write(value.sig_type, buf) + _UniffiFfiConverterOptionalString.write(value.auth_addr, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_proposed, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_heartbeat, buf) + +class _UniffiFfiConverterOptionalTypeApplicationLocalState(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeApplicationLocalState.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeApplicationLocalState.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeApplicationLocalState.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeApplicationParams(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeApplicationParams.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeApplicationParams.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeApplicationParams.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AccountApplicationInformation: + """ + AccountApplicationResponse describes the account's application local state and global state (AppLocalState and AppParams, if either exists) for a specific application ID. Global state will only be returned if the provided address is the application's creator. +""" + def __init__(self, *, round:int, app_local_state:typing.Optional[ApplicationLocalState], created_app:typing.Optional[ApplicationParams]): + self.round = round + self.app_local_state = app_local_state + self.created_app = created_app + + + + + def __str__(self): + return "AccountApplicationInformation(round={}, app_local_state={}, created_app={})".format(self.round, self.app_local_state, self.created_app) + def __eq__(self, other): + if self.round != other.round: + return False + if self.app_local_state != other.app_local_state: + return False + if self.created_app != other.created_app: + return False + return True + +class _UniffiFfiConverterTypeAccountApplicationInformation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountApplicationInformation( + round=_UniffiFfiConverterUInt64.read(buf), + app_local_state=_UniffiFfiConverterOptionalTypeApplicationLocalState.read(buf), + created_app=_UniffiFfiConverterOptionalTypeApplicationParams.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.round) + _UniffiFfiConverterOptionalTypeApplicationLocalState.check_lower(value.app_local_state) + _UniffiFfiConverterOptionalTypeApplicationParams.check_lower(value.created_app) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.round, buf) + _UniffiFfiConverterOptionalTypeApplicationLocalState.write(value.app_local_state, buf) + _UniffiFfiConverterOptionalTypeApplicationParams.write(value.created_app, buf) + +class _UniffiFfiConverterOptionalTypeAssetParams(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAssetParams.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAssetParams.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAssetParams.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AccountAssetHolding: + """ + AccountAssetHolding describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. +""" + def __init__(self, *, asset_holding:AssetHolding, asset_params:typing.Optional[AssetParams]): + self.asset_holding = asset_holding + self.asset_params = asset_params + + + + + def __str__(self): + return "AccountAssetHolding(asset_holding={}, asset_params={})".format(self.asset_holding, self.asset_params) + def __eq__(self, other): + if self.asset_holding != other.asset_holding: + return False + if self.asset_params != other.asset_params: + return False + return True + +class _UniffiFfiConverterTypeAccountAssetHolding(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountAssetHolding( + asset_holding=_UniffiFfiConverterTypeAssetHolding.read(buf), + asset_params=_UniffiFfiConverterOptionalTypeAssetParams.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeAssetHolding.check_lower(value.asset_holding) + _UniffiFfiConverterOptionalTypeAssetParams.check_lower(value.asset_params) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeAssetHolding.write(value.asset_holding, buf) + _UniffiFfiConverterOptionalTypeAssetParams.write(value.asset_params, buf) + +class _UniffiFfiConverterOptionalTypeAssetHolding(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAssetHolding.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAssetHolding.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAssetHolding.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AccountAssetInformation: + """ + AccountAssetResponse describes the account's asset holding and asset parameters (if either exist) for a specific asset ID. Asset parameters will only be returned if the provided address is the asset's creator. +""" + def __init__(self, *, round:int, asset_holding:typing.Optional[AssetHolding], created_asset:typing.Optional[AssetParams]): + self.round = round + self.asset_holding = asset_holding + self.created_asset = created_asset + + + + + def __str__(self): + return "AccountAssetInformation(round={}, asset_holding={}, created_asset={})".format(self.round, self.asset_holding, self.created_asset) + def __eq__(self, other): + if self.round != other.round: + return False + if self.asset_holding != other.asset_holding: + return False + if self.created_asset != other.created_asset: + return False + return True + +class _UniffiFfiConverterTypeAccountAssetInformation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountAssetInformation( + round=_UniffiFfiConverterUInt64.read(buf), + asset_holding=_UniffiFfiConverterOptionalTypeAssetHolding.read(buf), + created_asset=_UniffiFfiConverterOptionalTypeAssetParams.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.round) + _UniffiFfiConverterOptionalTypeAssetHolding.check_lower(value.asset_holding) + _UniffiFfiConverterOptionalTypeAssetParams.check_lower(value.created_asset) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.round, buf) + _UniffiFfiConverterOptionalTypeAssetHolding.write(value.asset_holding, buf) + _UniffiFfiConverterOptionalTypeAssetParams.write(value.created_asset, buf) + +class _UniffiFfiConverterSequenceTypeAccountAssetHolding(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAccountAssetHolding.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAccountAssetHolding.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAccountAssetHolding.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeAccountAssetHolding(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeAccountAssetHolding.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeAccountAssetHolding.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeAccountAssetHolding.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AccountAssetsInformation: + """ + AccountAssetsInformationResponse contains a list of assets held by an account. +""" + def __init__(self, *, round:int, next_token:typing.Optional[str], asset_holdings:typing.Optional[typing.List[AccountAssetHolding]]): + self.round = round + self.next_token = next_token + self.asset_holdings = asset_holdings + + + + + def __str__(self): + return "AccountAssetsInformation(round={}, next_token={}, asset_holdings={})".format(self.round, self.next_token, self.asset_holdings) + def __eq__(self, other): + if self.round != other.round: + return False + if self.next_token != other.next_token: + return False + if self.asset_holdings != other.asset_holdings: + return False + return True + +class _UniffiFfiConverterTypeAccountAssetsInformation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountAssetsInformation( + round=_UniffiFfiConverterUInt64.read(buf), + next_token=_UniffiFfiConverterOptionalString.read(buf), + asset_holdings=_UniffiFfiConverterOptionalSequenceTypeAccountAssetHolding.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.round) + _UniffiFfiConverterOptionalString.check_lower(value.next_token) + _UniffiFfiConverterOptionalSequenceTypeAccountAssetHolding.check_lower(value.asset_holdings) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.round, buf) + _UniffiFfiConverterOptionalString.write(value.next_token, buf) + _UniffiFfiConverterOptionalSequenceTypeAccountAssetHolding.write(value.asset_holdings, buf) + +@dataclass +class EvalDelta: + """ + Represents a TEAL value delta. +""" + def __init__(self, *, action:int, bytes:typing.Optional[str], uint:typing.Optional[int]): + self.action = action + self.bytes = bytes + self.uint = uint + + + + + def __str__(self): + return "EvalDelta(action={}, bytes={}, uint={})".format(self.action, self.bytes, self.uint) + def __eq__(self, other): + if self.action != other.action: + return False + if self.bytes != other.bytes: + return False + if self.uint != other.uint: + return False + return True + +class _UniffiFfiConverterTypeEvalDelta(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return EvalDelta( + action=_UniffiFfiConverterUInt32.read(buf), + bytes=_UniffiFfiConverterOptionalString.read(buf), + uint=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt32.check_lower(value.action) + _UniffiFfiConverterOptionalString.check_lower(value.bytes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.uint) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt32.write(value.action, buf) + _UniffiFfiConverterOptionalString.write(value.bytes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.uint, buf) + +@dataclass +class EvalDeltaKeyValue: + """ + Key-value pairs for StateDelta. +""" + def __init__(self, *, key:str, value:EvalDelta): + self.key = key + self.value = value + + + + + def __str__(self): + return "EvalDeltaKeyValue(key={}, value={})".format(self.key, self.value) + def __eq__(self, other): + if self.key != other.key: + return False + if self.value != other.value: + return False + return True + +class _UniffiFfiConverterTypeEvalDeltaKeyValue(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return EvalDeltaKeyValue( + key=_UniffiFfiConverterString.read(buf), + value=_UniffiFfiConverterTypeEvalDelta.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.key) + _UniffiFfiConverterTypeEvalDelta.check_lower(value.value) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.key, buf) + _UniffiFfiConverterTypeEvalDelta.write(value.value, buf) + +class _UniffiFfiConverterSequenceTypeEvalDeltaKeyValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeEvalDeltaKeyValue.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeEvalDeltaKeyValue.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeEvalDeltaKeyValue.read(buf) for i in range(count) + ] + + +class _UniffiFfiConverterTypeStateDelta: + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeEvalDeltaKeyValue.write(value, buf) + + @staticmethod + def read(buf): + return _UniffiFfiConverterSequenceTypeEvalDeltaKeyValue.read(buf) + + @staticmethod + def lift(value): + return _UniffiFfiConverterSequenceTypeEvalDeltaKeyValue.lift(value) + + @staticmethod + def check_lower(value): + return _UniffiFfiConverterSequenceTypeEvalDeltaKeyValue.check_lower(value) + + @staticmethod + def lower(value): + return _UniffiFfiConverterSequenceTypeEvalDeltaKeyValue.lower(value) + + +StateDelta = typing.List[EvalDeltaKeyValue] + +@dataclass +class AccountStateDelta: + """ + Application state delta. +""" + def __init__(self, *, address:str, delta:StateDelta): + self.address = address + self.delta = delta + + + + + def __str__(self): + return "AccountStateDelta(address={}, delta={})".format(self.address, self.delta) + def __eq__(self, other): + if self.address != other.address: + return False + if self.delta != other.delta: + return False + return True + +class _UniffiFfiConverterTypeAccountStateDelta(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountStateDelta( + address=_UniffiFfiConverterString.read(buf), + delta=_UniffiFfiConverterTypeStateDelta.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterTypeStateDelta.check_lower(value.delta) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterTypeStateDelta.write(value.delta, buf) + +@dataclass +class AddParticipationKey: + """ + Participation ID of the submission +""" + def __init__(self, *, part_id:str): + self.part_id = part_id + + + + + def __str__(self): + return "AddParticipationKey(part_id={})".format(self.part_id) + def __eq__(self, other): + if self.part_id != other.part_id: + return False + return True + +class _UniffiFfiConverterTypeAddParticipationKey(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AddParticipationKey( + part_id=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.part_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.part_id, buf) + +class _UniffiFfiConverterSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterBytes.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterBytes.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterBytes.read(buf) for i in range(count) + ] + +@dataclass +class AppCallLogs: + """ + The logged messages from an app call along with the app ID and outer transaction ID. Logs appear in the same order that they were emitted. +""" + def __init__(self, *, logs:typing.List[bytes], app_id:int, tx_id:str): + self.logs = logs + self.app_id = app_id + self.tx_id = tx_id + + + + + def __str__(self): + return "AppCallLogs(logs={}, app_id={}, tx_id={})".format(self.logs, self.app_id, self.tx_id) + def __eq__(self, other): + if self.logs != other.logs: + return False + if self.app_id != other.app_id: + return False + if self.tx_id != other.tx_id: + return False + return True + +class _UniffiFfiConverterTypeAppCallLogs(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppCallLogs( + logs=_UniffiFfiConverterSequenceBytes.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + tx_id=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceBytes.check_lower(value.logs) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterString.check_lower(value.tx_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceBytes.write(value.logs, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterString.write(value.tx_id, buf) + +@dataclass +class AvmValue: + """ + Represents an AVM value. +""" + def __init__(self, *, type:int, bytes:typing.Optional[str], uint:typing.Optional[int]): + self.type = type + self.bytes = bytes + self.uint = uint + + + + + def __str__(self): + return "AvmValue(type={}, bytes={}, uint={})".format(self.type, self.bytes, self.uint) + def __eq__(self, other): + if self.type != other.type: + return False + if self.bytes != other.bytes: + return False + if self.uint != other.uint: + return False + return True + +class _UniffiFfiConverterTypeAvmValue(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AvmValue( + type=_UniffiFfiConverterUInt64.read(buf), + bytes=_UniffiFfiConverterOptionalString.read(buf), + uint=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.type) + _UniffiFfiConverterOptionalString.check_lower(value.bytes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.uint) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.type, buf) + _UniffiFfiConverterOptionalString.write(value.bytes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.uint, buf) + +@dataclass +class AvmKeyValue: + """ + Represents an AVM key-value pair in an application store. +""" + def __init__(self, *, key:bytes, value:AvmValue): + self.key = key + self.value = value + + + + + def __str__(self): + return "AvmKeyValue(key={}, value={})".format(self.key, self.value) + def __eq__(self, other): + if self.key != other.key: + return False + if self.value != other.value: + return False + return True + +class _UniffiFfiConverterTypeAvmKeyValue(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AvmKeyValue( + key=_UniffiFfiConverterBytes.read(buf), + value=_UniffiFfiConverterTypeAvmValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.key) + _UniffiFfiConverterTypeAvmValue.check_lower(value.value) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.key, buf) + _UniffiFfiConverterTypeAvmValue.write(value.value, buf) + +class _UniffiFfiConverterSequenceTypeAvmKeyValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAvmKeyValue.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAvmKeyValue.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAvmKeyValue.read(buf) for i in range(count) + ] + +@dataclass +class ApplicationKvStorage: + """ + An application's global/local/box state. +""" + def __init__(self, *, kvs:typing.List[AvmKeyValue], account:typing.Optional[str]): + self.kvs = kvs + self.account = account + + + + + def __str__(self): + return "ApplicationKvStorage(kvs={}, account={})".format(self.kvs, self.account) + def __eq__(self, other): + if self.kvs != other.kvs: + return False + if self.account != other.account: + return False + return True + +class _UniffiFfiConverterTypeApplicationKvStorage(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationKvStorage( + kvs=_UniffiFfiConverterSequenceTypeAvmKeyValue.read(buf), + account=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeAvmKeyValue.check_lower(value.kvs) + _UniffiFfiConverterOptionalString.check_lower(value.account) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeAvmKeyValue.write(value.kvs, buf) + _UniffiFfiConverterOptionalString.write(value.account, buf) + +class _UniffiFfiConverterSequenceTypeApplicationKvStorage(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeApplicationKvStorage.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeApplicationKvStorage.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeApplicationKvStorage.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeApplicationKvStorage(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeApplicationKvStorage.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeApplicationKvStorage.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeApplicationKvStorage.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeApplicationKvStorage(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeApplicationKvStorage.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeApplicationKvStorage.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeApplicationKvStorage.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class ApplicationInitialStates: + """ + An application's initial global/local/box states that were accessed during simulation. +""" + def __init__(self, *, id:int, app_locals:typing.Optional[typing.List[ApplicationKvStorage]], app_globals:typing.Optional[ApplicationKvStorage], app_boxes:typing.Optional[ApplicationKvStorage]): + self.id = id + self.app_locals = app_locals + self.app_globals = app_globals + self.app_boxes = app_boxes + + + + + def __str__(self): + return "ApplicationInitialStates(id={}, app_locals={}, app_globals={}, app_boxes={})".format(self.id, self.app_locals, self.app_globals, self.app_boxes) + def __eq__(self, other): + if self.id != other.id: + return False + if self.app_locals != other.app_locals: + return False + if self.app_globals != other.app_globals: + return False + if self.app_boxes != other.app_boxes: + return False + return True + +class _UniffiFfiConverterTypeApplicationInitialStates(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationInitialStates( + id=_UniffiFfiConverterUInt64.read(buf), + app_locals=_UniffiFfiConverterOptionalSequenceTypeApplicationKvStorage.read(buf), + app_globals=_UniffiFfiConverterOptionalTypeApplicationKvStorage.read(buf), + app_boxes=_UniffiFfiConverterOptionalTypeApplicationKvStorage.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.id) + _UniffiFfiConverterOptionalSequenceTypeApplicationKvStorage.check_lower(value.app_locals) + _UniffiFfiConverterOptionalTypeApplicationKvStorage.check_lower(value.app_globals) + _UniffiFfiConverterOptionalTypeApplicationKvStorage.check_lower(value.app_boxes) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.id, buf) + _UniffiFfiConverterOptionalSequenceTypeApplicationKvStorage.write(value.app_locals, buf) + _UniffiFfiConverterOptionalTypeApplicationKvStorage.write(value.app_globals, buf) + _UniffiFfiConverterOptionalTypeApplicationKvStorage.write(value.app_boxes, buf) + +@dataclass +class ApplicationLocalReference: + """ + References an account's local state for an application. +""" + def __init__(self, *, account:str, app:int): + self.account = account + self.app = app + + + + + def __str__(self): + return "ApplicationLocalReference(account={}, app={})".format(self.account, self.app) + def __eq__(self, other): + if self.account != other.account: + return False + if self.app != other.app: + return False + return True + +class _UniffiFfiConverterTypeApplicationLocalReference(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationLocalReference( + account=_UniffiFfiConverterString.read(buf), + app=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.account) + _UniffiFfiConverterUInt64.check_lower(value.app) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.account, buf) + _UniffiFfiConverterUInt64.write(value.app, buf) + +class _UniffiFfiConverterOptionalTypeAvmValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAvmValue.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAvmValue.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAvmValue.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class ApplicationStateOperation: + """ + An operation against an application's global/local/box state. +""" + def __init__(self, *, operation:str, app_state_type:str, key:bytes, new_value:typing.Optional[AvmValue], account:typing.Optional[str]): + self.operation = operation + self.app_state_type = app_state_type + self.key = key + self.new_value = new_value + self.account = account + + + + + def __str__(self): + return "ApplicationStateOperation(operation={}, app_state_type={}, key={}, new_value={}, account={})".format(self.operation, self.app_state_type, self.key, self.new_value, self.account) + def __eq__(self, other): + if self.operation != other.operation: + return False + if self.app_state_type != other.app_state_type: + return False + if self.key != other.key: + return False + if self.new_value != other.new_value: + return False + if self.account != other.account: + return False + return True + +class _UniffiFfiConverterTypeApplicationStateOperation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ApplicationStateOperation( + operation=_UniffiFfiConverterString.read(buf), + app_state_type=_UniffiFfiConverterString.read(buf), + key=_UniffiFfiConverterBytes.read(buf), + new_value=_UniffiFfiConverterOptionalTypeAvmValue.read(buf), + account=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.operation) + _UniffiFfiConverterString.check_lower(value.app_state_type) + _UniffiFfiConverterBytes.check_lower(value.key) + _UniffiFfiConverterOptionalTypeAvmValue.check_lower(value.new_value) + _UniffiFfiConverterOptionalString.check_lower(value.account) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.operation, buf) + _UniffiFfiConverterString.write(value.app_state_type, buf) + _UniffiFfiConverterBytes.write(value.key, buf) + _UniffiFfiConverterOptionalTypeAvmValue.write(value.new_value, buf) + _UniffiFfiConverterOptionalString.write(value.account, buf) + +@dataclass +class AssetHoldingReference: + """ + References an asset held by an account. +""" + def __init__(self, *, account:str, asset:int): + self.account = account + self.asset = asset + + + + + def __str__(self): + return "AssetHoldingReference(account={}, asset={})".format(self.account, self.asset) + def __eq__(self, other): + if self.account != other.account: + return False + if self.asset != other.asset: + return False + return True + +class _UniffiFfiConverterTypeAssetHoldingReference(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetHoldingReference( + account=_UniffiFfiConverterString.read(buf), + asset=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.account) + _UniffiFfiConverterUInt64.check_lower(value.asset) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.account, buf) + _UniffiFfiConverterUInt64.write(value.asset, buf) + +@dataclass +class BlockStateProofTrackingData: + """ + Tracking metadata for a specific StateProofType. +""" + def __init__(self, *, state_proof_voters_commitment:typing.Optional[bytes], state_proof_online_total_weight:typing.Optional[int], state_proof_next_round:typing.Optional[int]): + self.state_proof_voters_commitment = state_proof_voters_commitment + self.state_proof_online_total_weight = state_proof_online_total_weight + self.state_proof_next_round = state_proof_next_round + + + + + def __str__(self): + return "BlockStateProofTrackingData(state_proof_voters_commitment={}, state_proof_online_total_weight={}, state_proof_next_round={})".format(self.state_proof_voters_commitment, self.state_proof_online_total_weight, self.state_proof_next_round) + def __eq__(self, other): + if self.state_proof_voters_commitment != other.state_proof_voters_commitment: + return False + if self.state_proof_online_total_weight != other.state_proof_online_total_weight: + return False + if self.state_proof_next_round != other.state_proof_next_round: + return False + return True + +class _UniffiFfiConverterTypeBlockStateProofTrackingData(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BlockStateProofTrackingData( + state_proof_voters_commitment=_UniffiFfiConverterOptionalBytes.read(buf), + state_proof_online_total_weight=_UniffiFfiConverterOptionalUInt64.read(buf), + state_proof_next_round=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalBytes.check_lower(value.state_proof_voters_commitment) + _UniffiFfiConverterOptionalUInt64.check_lower(value.state_proof_online_total_weight) + _UniffiFfiConverterOptionalUInt64.check_lower(value.state_proof_next_round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalBytes.write(value.state_proof_voters_commitment, buf) + _UniffiFfiConverterOptionalUInt64.write(value.state_proof_online_total_weight, buf) + _UniffiFfiConverterOptionalUInt64.write(value.state_proof_next_round, buf) + +class _UniffiFfiConverterMapUInt64TypeBlockStateProofTrackingData(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiFfiConverterUInt64.check_lower(key) + _UniffiFfiConverterTypeBlockStateProofTrackingData.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiFfiConverterUInt64.write(key, buf) + _UniffiFfiConverterTypeBlockStateProofTrackingData.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiFfiConverterUInt64.read(buf) + val = _UniffiFfiConverterTypeBlockStateProofTrackingData.read(buf) + d[key] = val + return d + +class _UniffiFfiConverterOptionalMapUInt64TypeBlockStateProofTrackingData(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterMapUInt64TypeBlockStateProofTrackingData.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterMapUInt64TypeBlockStateProofTrackingData.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterMapUInt64TypeBlockStateProofTrackingData.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +@dataclass +class BlockEvalDelta: + """ + BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). +""" + def __init__(self, *, action:int, bytes:typing.Optional[str], uint:typing.Optional[int]): + self.action = action + self.bytes = bytes + self.uint = uint + + + + + def __str__(self): + return "BlockEvalDelta(action={}, bytes={}, uint={})".format(self.action, self.bytes, self.uint) + def __eq__(self, other): + if self.action != other.action: + return False + if self.bytes != other.bytes: + return False + if self.uint != other.uint: + return False + return True + +class _UniffiFfiConverterTypeBlockEvalDelta(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BlockEvalDelta( + action=_UniffiFfiConverterUInt32.read(buf), + bytes=_UniffiFfiConverterOptionalString.read(buf), + uint=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt32.check_lower(value.action) + _UniffiFfiConverterOptionalString.check_lower(value.bytes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.uint) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt32.write(value.action, buf) + _UniffiFfiConverterOptionalString.write(value.bytes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.uint, buf) + +class _UniffiFfiConverterMapStringTypeBlockEvalDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiFfiConverterString.check_lower(key) + _UniffiFfiConverterTypeBlockEvalDelta.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiFfiConverterString.write(key, buf) + _UniffiFfiConverterTypeBlockEvalDelta.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiFfiConverterString.read(buf) + val = _UniffiFfiConverterTypeBlockEvalDelta.read(buf) + d[key] = val + return d + +class _UniffiFfiConverterOptionalMapStringTypeBlockEvalDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterMapStringTypeBlockEvalDelta.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterMapStringTypeBlockEvalDelta.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterMapStringTypeBlockEvalDelta.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterMapUInt64MapStringTypeBlockEvalDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiFfiConverterUInt64.check_lower(key) + _UniffiFfiConverterMapStringTypeBlockEvalDelta.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiFfiConverterUInt64.write(key, buf) + _UniffiFfiConverterMapStringTypeBlockEvalDelta.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiFfiConverterUInt64.read(buf) + val = _UniffiFfiConverterMapStringTypeBlockEvalDelta.read(buf) + d[key] = val + return d + +class _UniffiFfiConverterOptionalMapUInt64MapStringTypeBlockEvalDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterMapUInt64MapStringTypeBlockEvalDelta.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterMapUInt64MapStringTypeBlockEvalDelta.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterMapUInt64MapStringTypeBlockEvalDelta.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterString.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterString.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterString.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class BlockAppEvalDelta: + """ + BlockAppEvalDelta matches msgpack wire for blocks; uses BlockStateDelta maps. +""" + def __init__(self, *, global_delta:typing.Optional[dict[str, BlockEvalDelta]], local_deltas:typing.Optional[dict[int, dict[str, BlockEvalDelta]]], inner_txns:typing.Optional[typing.List[SignedTxnInBlock]], shared_accounts:typing.Optional[typing.List[bytes]], logs:typing.Optional[typing.List[str]]): + self.global_delta = global_delta + self.local_deltas = local_deltas + self.inner_txns = inner_txns + self.shared_accounts = shared_accounts + self.logs = logs + + + + + def __str__(self): + return "BlockAppEvalDelta(global_delta={}, local_deltas={}, inner_txns={}, shared_accounts={}, logs={})".format(self.global_delta, self.local_deltas, self.inner_txns, self.shared_accounts, self.logs) + def __eq__(self, other): + if self.global_delta != other.global_delta: + return False + if self.local_deltas != other.local_deltas: + return False + if self.inner_txns != other.inner_txns: + return False + if self.shared_accounts != other.shared_accounts: + return False + if self.logs != other.logs: + return False + return True + +class _UniffiFfiConverterTypeBlockAppEvalDelta(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BlockAppEvalDelta( + global_delta=_UniffiFfiConverterOptionalMapStringTypeBlockEvalDelta.read(buf), + local_deltas=_UniffiFfiConverterOptionalMapUInt64MapStringTypeBlockEvalDelta.read(buf), + inner_txns=_UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock.read(buf), + shared_accounts=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + logs=_UniffiFfiConverterOptionalSequenceString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalMapStringTypeBlockEvalDelta.check_lower(value.global_delta) + _UniffiFfiConverterOptionalMapUInt64MapStringTypeBlockEvalDelta.check_lower(value.local_deltas) + _UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock.check_lower(value.inner_txns) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.shared_accounts) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.logs) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalMapStringTypeBlockEvalDelta.write(value.global_delta, buf) + _UniffiFfiConverterOptionalMapUInt64MapStringTypeBlockEvalDelta.write(value.local_deltas, buf) + _UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock.write(value.inner_txns, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.shared_accounts, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.logs, buf) + +class _UniffiFfiConverterOptionalTypeBlockAppEvalDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeBlockAppEvalDelta.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeBlockAppEvalDelta.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeBlockAppEvalDelta.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SignedTxnInBlock: + """ + SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata. +""" + def __init__(self, *, signed_transaction:algokit_transact_ffi.SignedTransaction, logic_signature:typing.Optional[bytes], closing_amount:typing.Optional[int], asset_closing_amount:typing.Optional[int], sender_rewards:typing.Optional[int], receiver_rewards:typing.Optional[int], close_rewards:typing.Optional[int], eval_delta:typing.Optional[BlockAppEvalDelta], config_asset:typing.Optional[int], application_id:typing.Optional[int], has_genesis_id:typing.Optional[bool], has_genesis_hash:typing.Optional[bool]): + self.signed_transaction = signed_transaction + self.logic_signature = logic_signature + self.closing_amount = closing_amount + self.asset_closing_amount = asset_closing_amount + self.sender_rewards = sender_rewards + self.receiver_rewards = receiver_rewards + self.close_rewards = close_rewards + self.eval_delta = eval_delta + self.config_asset = config_asset + self.application_id = application_id + self.has_genesis_id = has_genesis_id + self.has_genesis_hash = has_genesis_hash + + + + + def __str__(self): + return "SignedTxnInBlock(signed_transaction={}, logic_signature={}, closing_amount={}, asset_closing_amount={}, sender_rewards={}, receiver_rewards={}, close_rewards={}, eval_delta={}, config_asset={}, application_id={}, has_genesis_id={}, has_genesis_hash={})".format(self.signed_transaction, self.logic_signature, self.closing_amount, self.asset_closing_amount, self.sender_rewards, self.receiver_rewards, self.close_rewards, self.eval_delta, self.config_asset, self.application_id, self.has_genesis_id, self.has_genesis_hash) + def __eq__(self, other): + if self.signed_transaction != other.signed_transaction: + return False + if self.logic_signature != other.logic_signature: + return False + if self.closing_amount != other.closing_amount: + return False + if self.asset_closing_amount != other.asset_closing_amount: + return False + if self.sender_rewards != other.sender_rewards: + return False + if self.receiver_rewards != other.receiver_rewards: + return False + if self.close_rewards != other.close_rewards: + return False + if self.eval_delta != other.eval_delta: + return False + if self.config_asset != other.config_asset: + return False + if self.application_id != other.application_id: + return False + if self.has_genesis_id != other.has_genesis_id: + return False + if self.has_genesis_hash != other.has_genesis_hash: + return False + return True + +class _UniffiFfiConverterTypeSignedTxnInBlock(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SignedTxnInBlock( + signed_transaction=algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.read(buf), + logic_signature=_UniffiFfiConverterOptionalBytes.read(buf), + closing_amount=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_closing_amount=_UniffiFfiConverterOptionalUInt64.read(buf), + sender_rewards=_UniffiFfiConverterOptionalUInt64.read(buf), + receiver_rewards=_UniffiFfiConverterOptionalUInt64.read(buf), + close_rewards=_UniffiFfiConverterOptionalUInt64.read(buf), + eval_delta=_UniffiFfiConverterOptionalTypeBlockAppEvalDelta.read(buf), + config_asset=_UniffiFfiConverterOptionalUInt64.read(buf), + application_id=_UniffiFfiConverterOptionalUInt64.read(buf), + has_genesis_id=_UniffiFfiConverterOptionalBoolean.read(buf), + has_genesis_hash=_UniffiFfiConverterOptionalBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.check_lower(value.signed_transaction) + _UniffiFfiConverterOptionalBytes.check_lower(value.logic_signature) + _UniffiFfiConverterOptionalUInt64.check_lower(value.closing_amount) + _UniffiFfiConverterOptionalUInt64.check_lower(value.asset_closing_amount) + _UniffiFfiConverterOptionalUInt64.check_lower(value.sender_rewards) + _UniffiFfiConverterOptionalUInt64.check_lower(value.receiver_rewards) + _UniffiFfiConverterOptionalUInt64.check_lower(value.close_rewards) + _UniffiFfiConverterOptionalTypeBlockAppEvalDelta.check_lower(value.eval_delta) + _UniffiFfiConverterOptionalUInt64.check_lower(value.config_asset) + _UniffiFfiConverterOptionalUInt64.check_lower(value.application_id) + _UniffiFfiConverterOptionalBoolean.check_lower(value.has_genesis_id) + _UniffiFfiConverterOptionalBoolean.check_lower(value.has_genesis_hash) + + @staticmethod + def write(value, buf): + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.write(value.signed_transaction, buf) + _UniffiFfiConverterOptionalBytes.write(value.logic_signature, buf) + _UniffiFfiConverterOptionalUInt64.write(value.closing_amount, buf) + _UniffiFfiConverterOptionalUInt64.write(value.asset_closing_amount, buf) + _UniffiFfiConverterOptionalUInt64.write(value.sender_rewards, buf) + _UniffiFfiConverterOptionalUInt64.write(value.receiver_rewards, buf) + _UniffiFfiConverterOptionalUInt64.write(value.close_rewards, buf) + _UniffiFfiConverterOptionalTypeBlockAppEvalDelta.write(value.eval_delta, buf) + _UniffiFfiConverterOptionalUInt64.write(value.config_asset, buf) + _UniffiFfiConverterOptionalUInt64.write(value.application_id, buf) + _UniffiFfiConverterOptionalBoolean.write(value.has_genesis_id, buf) + _UniffiFfiConverterOptionalBoolean.write(value.has_genesis_hash, buf) + +class _UniffiFfiConverterSequenceTypeSignedTxnInBlock(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSignedTxnInBlock.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSignedTxnInBlock.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSignedTxnInBlock.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeSignedTxnInBlock.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeSignedTxnInBlock.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeSignedTxnInBlock.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class Block: + """ + Block contains the BlockHeader and the list of transactions (Payset). +""" + def __init__(self, *, round:typing.Optional[int], previous_block_hash:typing.Optional[bytes], previous_block_hash_512:typing.Optional[bytes], seed:typing.Optional[bytes], transactions_root:typing.Optional[bytes], transactions_root_sha256:typing.Optional[bytes], transactions_root_sha512:typing.Optional[bytes], timestamp:typing.Optional[int], genesis_id:typing.Optional[str], genesis_hash:typing.Optional[bytes], proposer:typing.Optional[bytes], fees_collected:typing.Optional[int], bonus:typing.Optional[int], proposer_payout:typing.Optional[int], fee_sink:typing.Optional[bytes], rewards_pool:typing.Optional[bytes], rewards_level:typing.Optional[int], rewards_rate:typing.Optional[int], rewards_residue:typing.Optional[int], rewards_recalculation_round:typing.Optional[int], current_protocol:typing.Optional[str], next_protocol:typing.Optional[str], next_protocol_approvals:typing.Optional[int], next_protocol_vote_before:typing.Optional[int], next_protocol_switch_on:typing.Optional[int], upgrade_propose:typing.Optional[str], upgrade_delay:typing.Optional[int], upgrade_approve:typing.Optional[bool], txn_counter:typing.Optional[int], state_proof_tracking:typing.Optional[dict[int, BlockStateProofTrackingData]], expired_participation_accounts:typing.Optional[typing.List[bytes]], absent_participation_accounts:typing.Optional[typing.List[bytes]], transactions:typing.Optional[typing.List[SignedTxnInBlock]]): + self.round = round + self.previous_block_hash = previous_block_hash + self.previous_block_hash_512 = previous_block_hash_512 + self.seed = seed + self.transactions_root = transactions_root + self.transactions_root_sha256 = transactions_root_sha256 + self.transactions_root_sha512 = transactions_root_sha512 + self.timestamp = timestamp + self.genesis_id = genesis_id + self.genesis_hash = genesis_hash + self.proposer = proposer + self.fees_collected = fees_collected + self.bonus = bonus + self.proposer_payout = proposer_payout + self.fee_sink = fee_sink + self.rewards_pool = rewards_pool + self.rewards_level = rewards_level + self.rewards_rate = rewards_rate + self.rewards_residue = rewards_residue + self.rewards_recalculation_round = rewards_recalculation_round + self.current_protocol = current_protocol + self.next_protocol = next_protocol + self.next_protocol_approvals = next_protocol_approvals + self.next_protocol_vote_before = next_protocol_vote_before + self.next_protocol_switch_on = next_protocol_switch_on + self.upgrade_propose = upgrade_propose + self.upgrade_delay = upgrade_delay + self.upgrade_approve = upgrade_approve + self.txn_counter = txn_counter + self.state_proof_tracking = state_proof_tracking + self.expired_participation_accounts = expired_participation_accounts + self.absent_participation_accounts = absent_participation_accounts + self.transactions = transactions + + + + + def __str__(self): + return "Block(round={}, previous_block_hash={}, previous_block_hash_512={}, seed={}, transactions_root={}, transactions_root_sha256={}, transactions_root_sha512={}, timestamp={}, genesis_id={}, genesis_hash={}, proposer={}, fees_collected={}, bonus={}, proposer_payout={}, fee_sink={}, rewards_pool={}, rewards_level={}, rewards_rate={}, rewards_residue={}, rewards_recalculation_round={}, current_protocol={}, next_protocol={}, next_protocol_approvals={}, next_protocol_vote_before={}, next_protocol_switch_on={}, upgrade_propose={}, upgrade_delay={}, upgrade_approve={}, txn_counter={}, state_proof_tracking={}, expired_participation_accounts={}, absent_participation_accounts={}, transactions={})".format(self.round, self.previous_block_hash, self.previous_block_hash_512, self.seed, self.transactions_root, self.transactions_root_sha256, self.transactions_root_sha512, self.timestamp, self.genesis_id, self.genesis_hash, self.proposer, self.fees_collected, self.bonus, self.proposer_payout, self.fee_sink, self.rewards_pool, self.rewards_level, self.rewards_rate, self.rewards_residue, self.rewards_recalculation_round, self.current_protocol, self.next_protocol, self.next_protocol_approvals, self.next_protocol_vote_before, self.next_protocol_switch_on, self.upgrade_propose, self.upgrade_delay, self.upgrade_approve, self.txn_counter, self.state_proof_tracking, self.expired_participation_accounts, self.absent_participation_accounts, self.transactions) + def __eq__(self, other): + if self.round != other.round: + return False + if self.previous_block_hash != other.previous_block_hash: + return False + if self.previous_block_hash_512 != other.previous_block_hash_512: + return False + if self.seed != other.seed: + return False + if self.transactions_root != other.transactions_root: + return False + if self.transactions_root_sha256 != other.transactions_root_sha256: + return False + if self.transactions_root_sha512 != other.transactions_root_sha512: + return False + if self.timestamp != other.timestamp: + return False + if self.genesis_id != other.genesis_id: + return False + if self.genesis_hash != other.genesis_hash: + return False + if self.proposer != other.proposer: + return False + if self.fees_collected != other.fees_collected: + return False + if self.bonus != other.bonus: + return False + if self.proposer_payout != other.proposer_payout: + return False + if self.fee_sink != other.fee_sink: + return False + if self.rewards_pool != other.rewards_pool: + return False + if self.rewards_level != other.rewards_level: + return False + if self.rewards_rate != other.rewards_rate: + return False + if self.rewards_residue != other.rewards_residue: + return False + if self.rewards_recalculation_round != other.rewards_recalculation_round: + return False + if self.current_protocol != other.current_protocol: + return False + if self.next_protocol != other.next_protocol: + return False + if self.next_protocol_approvals != other.next_protocol_approvals: + return False + if self.next_protocol_vote_before != other.next_protocol_vote_before: + return False + if self.next_protocol_switch_on != other.next_protocol_switch_on: + return False + if self.upgrade_propose != other.upgrade_propose: + return False + if self.upgrade_delay != other.upgrade_delay: + return False + if self.upgrade_approve != other.upgrade_approve: + return False + if self.txn_counter != other.txn_counter: + return False + if self.state_proof_tracking != other.state_proof_tracking: + return False + if self.expired_participation_accounts != other.expired_participation_accounts: + return False + if self.absent_participation_accounts != other.absent_participation_accounts: + return False + if self.transactions != other.transactions: + return False + return True + +class _UniffiFfiConverterTypeBlock(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Block( + round=_UniffiFfiConverterOptionalUInt64.read(buf), + previous_block_hash=_UniffiFfiConverterOptionalBytes.read(buf), + previous_block_hash_512=_UniffiFfiConverterOptionalBytes.read(buf), + seed=_UniffiFfiConverterOptionalBytes.read(buf), + transactions_root=_UniffiFfiConverterOptionalBytes.read(buf), + transactions_root_sha256=_UniffiFfiConverterOptionalBytes.read(buf), + transactions_root_sha512=_UniffiFfiConverterOptionalBytes.read(buf), + timestamp=_UniffiFfiConverterOptionalUInt64.read(buf), + genesis_id=_UniffiFfiConverterOptionalString.read(buf), + genesis_hash=_UniffiFfiConverterOptionalBytes.read(buf), + proposer=_UniffiFfiConverterOptionalBytes.read(buf), + fees_collected=_UniffiFfiConverterOptionalUInt64.read(buf), + bonus=_UniffiFfiConverterOptionalUInt64.read(buf), + proposer_payout=_UniffiFfiConverterOptionalUInt64.read(buf), + fee_sink=_UniffiFfiConverterOptionalBytes.read(buf), + rewards_pool=_UniffiFfiConverterOptionalBytes.read(buf), + rewards_level=_UniffiFfiConverterOptionalUInt64.read(buf), + rewards_rate=_UniffiFfiConverterOptionalUInt64.read(buf), + rewards_residue=_UniffiFfiConverterOptionalUInt64.read(buf), + rewards_recalculation_round=_UniffiFfiConverterOptionalUInt64.read(buf), + current_protocol=_UniffiFfiConverterOptionalString.read(buf), + next_protocol=_UniffiFfiConverterOptionalString.read(buf), + next_protocol_approvals=_UniffiFfiConverterOptionalUInt64.read(buf), + next_protocol_vote_before=_UniffiFfiConverterOptionalUInt64.read(buf), + next_protocol_switch_on=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_propose=_UniffiFfiConverterOptionalString.read(buf), + upgrade_delay=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_approve=_UniffiFfiConverterOptionalBoolean.read(buf), + txn_counter=_UniffiFfiConverterOptionalUInt64.read(buf), + state_proof_tracking=_UniffiFfiConverterOptionalMapUInt64TypeBlockStateProofTrackingData.read(buf), + expired_participation_accounts=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + absent_participation_accounts=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + transactions=_UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalUInt64.check_lower(value.round) + _UniffiFfiConverterOptionalBytes.check_lower(value.previous_block_hash) + _UniffiFfiConverterOptionalBytes.check_lower(value.previous_block_hash_512) + _UniffiFfiConverterOptionalBytes.check_lower(value.seed) + _UniffiFfiConverterOptionalBytes.check_lower(value.transactions_root) + _UniffiFfiConverterOptionalBytes.check_lower(value.transactions_root_sha256) + _UniffiFfiConverterOptionalBytes.check_lower(value.transactions_root_sha512) + _UniffiFfiConverterOptionalUInt64.check_lower(value.timestamp) + _UniffiFfiConverterOptionalString.check_lower(value.genesis_id) + _UniffiFfiConverterOptionalBytes.check_lower(value.genesis_hash) + _UniffiFfiConverterOptionalBytes.check_lower(value.proposer) + _UniffiFfiConverterOptionalUInt64.check_lower(value.fees_collected) + _UniffiFfiConverterOptionalUInt64.check_lower(value.bonus) + _UniffiFfiConverterOptionalUInt64.check_lower(value.proposer_payout) + _UniffiFfiConverterOptionalBytes.check_lower(value.fee_sink) + _UniffiFfiConverterOptionalBytes.check_lower(value.rewards_pool) + _UniffiFfiConverterOptionalUInt64.check_lower(value.rewards_level) + _UniffiFfiConverterOptionalUInt64.check_lower(value.rewards_rate) + _UniffiFfiConverterOptionalUInt64.check_lower(value.rewards_residue) + _UniffiFfiConverterOptionalUInt64.check_lower(value.rewards_recalculation_round) + _UniffiFfiConverterOptionalString.check_lower(value.current_protocol) + _UniffiFfiConverterOptionalString.check_lower(value.next_protocol) + _UniffiFfiConverterOptionalUInt64.check_lower(value.next_protocol_approvals) + _UniffiFfiConverterOptionalUInt64.check_lower(value.next_protocol_vote_before) + _UniffiFfiConverterOptionalUInt64.check_lower(value.next_protocol_switch_on) + _UniffiFfiConverterOptionalString.check_lower(value.upgrade_propose) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_delay) + _UniffiFfiConverterOptionalBoolean.check_lower(value.upgrade_approve) + _UniffiFfiConverterOptionalUInt64.check_lower(value.txn_counter) + _UniffiFfiConverterOptionalMapUInt64TypeBlockStateProofTrackingData.check_lower(value.state_proof_tracking) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.expired_participation_accounts) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.absent_participation_accounts) + _UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock.check_lower(value.transactions) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalUInt64.write(value.round, buf) + _UniffiFfiConverterOptionalBytes.write(value.previous_block_hash, buf) + _UniffiFfiConverterOptionalBytes.write(value.previous_block_hash_512, buf) + _UniffiFfiConverterOptionalBytes.write(value.seed, buf) + _UniffiFfiConverterOptionalBytes.write(value.transactions_root, buf) + _UniffiFfiConverterOptionalBytes.write(value.transactions_root_sha256, buf) + _UniffiFfiConverterOptionalBytes.write(value.transactions_root_sha512, buf) + _UniffiFfiConverterOptionalUInt64.write(value.timestamp, buf) + _UniffiFfiConverterOptionalString.write(value.genesis_id, buf) + _UniffiFfiConverterOptionalBytes.write(value.genesis_hash, buf) + _UniffiFfiConverterOptionalBytes.write(value.proposer, buf) + _UniffiFfiConverterOptionalUInt64.write(value.fees_collected, buf) + _UniffiFfiConverterOptionalUInt64.write(value.bonus, buf) + _UniffiFfiConverterOptionalUInt64.write(value.proposer_payout, buf) + _UniffiFfiConverterOptionalBytes.write(value.fee_sink, buf) + _UniffiFfiConverterOptionalBytes.write(value.rewards_pool, buf) + _UniffiFfiConverterOptionalUInt64.write(value.rewards_level, buf) + _UniffiFfiConverterOptionalUInt64.write(value.rewards_rate, buf) + _UniffiFfiConverterOptionalUInt64.write(value.rewards_residue, buf) + _UniffiFfiConverterOptionalUInt64.write(value.rewards_recalculation_round, buf) + _UniffiFfiConverterOptionalString.write(value.current_protocol, buf) + _UniffiFfiConverterOptionalString.write(value.next_protocol, buf) + _UniffiFfiConverterOptionalUInt64.write(value.next_protocol_approvals, buf) + _UniffiFfiConverterOptionalUInt64.write(value.next_protocol_vote_before, buf) + _UniffiFfiConverterOptionalUInt64.write(value.next_protocol_switch_on, buf) + _UniffiFfiConverterOptionalString.write(value.upgrade_propose, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_delay, buf) + _UniffiFfiConverterOptionalBoolean.write(value.upgrade_approve, buf) + _UniffiFfiConverterOptionalUInt64.write(value.txn_counter, buf) + _UniffiFfiConverterOptionalMapUInt64TypeBlockStateProofTrackingData.write(value.state_proof_tracking, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.expired_participation_accounts, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.absent_participation_accounts, buf) + _UniffiFfiConverterOptionalSequenceTypeSignedTxnInBlock.write(value.transactions, buf) + +@dataclass +class BlockAccountStateDelta: + """ + BlockAccountStateDelta pairs an address with a BlockStateDelta map. +""" + def __init__(self, *, address:str, delta:dict[str, BlockEvalDelta]): + self.address = address + self.delta = delta + + + + + def __str__(self): + return "BlockAccountStateDelta(address={}, delta={})".format(self.address, self.delta) + def __eq__(self, other): + if self.address != other.address: + return False + if self.delta != other.delta: + return False + return True + +class _UniffiFfiConverterTypeBlockAccountStateDelta(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BlockAccountStateDelta( + address=_UniffiFfiConverterString.read(buf), + delta=_UniffiFfiConverterMapStringTypeBlockEvalDelta.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterMapStringTypeBlockEvalDelta.check_lower(value.delta) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterMapStringTypeBlockEvalDelta.write(value.delta, buf) + +@dataclass +class Box: + """ + Box name and its content. +""" + def __init__(self, *, round:int, name:bytes, value:bytes): + self.round = round + self.name = name + self.value = value + + + + + def __str__(self): + return "Box(round={}, name={}, value={})".format(self.round, self.name, self.value) + def __eq__(self, other): + if self.round != other.round: + return False + if self.name != other.name: + return False + if self.value != other.value: + return False + return True + +class _UniffiFfiConverterTypeBox(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Box( + round=_UniffiFfiConverterUInt64.read(buf), + name=_UniffiFfiConverterBytes.read(buf), + value=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.round) + _UniffiFfiConverterBytes.check_lower(value.name) + _UniffiFfiConverterBytes.check_lower(value.value) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.round, buf) + _UniffiFfiConverterBytes.write(value.name, buf) + _UniffiFfiConverterBytes.write(value.value, buf) + +@dataclass +class BoxDescriptor: + """ + Box descriptor describes a Box. +""" + def __init__(self, *, name:bytes): + self.name = name + + + + + def __str__(self): + return "BoxDescriptor(name={})".format(self.name) + def __eq__(self, other): + if self.name != other.name: + return False + return True + +class _UniffiFfiConverterTypeBoxDescriptor(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BoxDescriptor( + name=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.name) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.name, buf) + +@dataclass +class BoxReference: + """ + References a box of an application. +""" + def __init__(self, *, app:int, name:bytes): + self.app = app + self.name = name + + + + + def __str__(self): + return "BoxReference(app={}, name={})".format(self.app, self.name) + def __eq__(self, other): + if self.app != other.app: + return False + if self.name != other.name: + return False + return True + +class _UniffiFfiConverterTypeBoxReference(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BoxReference( + app=_UniffiFfiConverterUInt64.read(buf), + name=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.app) + _UniffiFfiConverterBytes.check_lower(value.name) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.app, buf) + _UniffiFfiConverterBytes.write(value.name, buf) + +@dataclass +class BuildVersion: + def __init__(self, *, branch:str, build_number:int, channel:str, commit_hash:str, major:int, minor:int): + self.branch = branch + self.build_number = build_number + self.channel = channel + self.commit_hash = commit_hash + self.major = major + self.minor = minor + + + + + def __str__(self): + return "BuildVersion(branch={}, build_number={}, channel={}, commit_hash={}, major={}, minor={})".format(self.branch, self.build_number, self.channel, self.commit_hash, self.major, self.minor) + def __eq__(self, other): + if self.branch != other.branch: + return False + if self.build_number != other.build_number: + return False + if self.channel != other.channel: + return False + if self.commit_hash != other.commit_hash: + return False + if self.major != other.major: + return False + if self.minor != other.minor: + return False + return True + +class _UniffiFfiConverterTypeBuildVersion(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BuildVersion( + branch=_UniffiFfiConverterString.read(buf), + build_number=_UniffiFfiConverterUInt64.read(buf), + channel=_UniffiFfiConverterString.read(buf), + commit_hash=_UniffiFfiConverterString.read(buf), + major=_UniffiFfiConverterUInt64.read(buf), + minor=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.branch) + _UniffiFfiConverterUInt64.check_lower(value.build_number) + _UniffiFfiConverterString.check_lower(value.channel) + _UniffiFfiConverterString.check_lower(value.commit_hash) + _UniffiFfiConverterUInt64.check_lower(value.major) + _UniffiFfiConverterUInt64.check_lower(value.minor) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.branch, buf) + _UniffiFfiConverterUInt64.write(value.build_number, buf) + _UniffiFfiConverterString.write(value.channel, buf) + _UniffiFfiConverterString.write(value.commit_hash, buf) + _UniffiFfiConverterUInt64.write(value.major, buf) + _UniffiFfiConverterUInt64.write(value.minor, buf) + +@dataclass +class DebugSettingsProf: + """ + algod mutex and blocking profiling state. +""" + def __init__(self, *, block_rate:typing.Optional[int], mutex_rate:typing.Optional[int]): + self.block_rate = block_rate + self.mutex_rate = mutex_rate + + + + + def __str__(self): + return "DebugSettingsProf(block_rate={}, mutex_rate={})".format(self.block_rate, self.mutex_rate) + def __eq__(self, other): + if self.block_rate != other.block_rate: + return False + if self.mutex_rate != other.mutex_rate: + return False + return True + +class _UniffiFfiConverterTypeDebugSettingsProf(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DebugSettingsProf( + block_rate=_UniffiFfiConverterOptionalUInt64.read(buf), + mutex_rate=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalUInt64.check_lower(value.block_rate) + _UniffiFfiConverterOptionalUInt64.check_lower(value.mutex_rate) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalUInt64.write(value.block_rate, buf) + _UniffiFfiConverterOptionalUInt64.write(value.mutex_rate, buf) + +class _UniffiFfiConverterSequenceTypeSignedTransaction(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterSequenceTypeAccount(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAccount.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAccount.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAccount.read(buf) for i in range(count) + ] + +@dataclass +class DryrunSource: + """ + DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into transactions or application state. +""" + def __init__(self, *, field_name:str, source:str, txn_index:int, app_index:int): + self.field_name = field_name + self.source = source + self.txn_index = txn_index + self.app_index = app_index + + + + + def __str__(self): + return "DryrunSource(field_name={}, source={}, txn_index={}, app_index={})".format(self.field_name, self.source, self.txn_index, self.app_index) + def __eq__(self, other): + if self.field_name != other.field_name: + return False + if self.source != other.source: + return False + if self.txn_index != other.txn_index: + return False + if self.app_index != other.app_index: + return False + return True + +class _UniffiFfiConverterTypeDryrunSource(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DryrunSource( + field_name=_UniffiFfiConverterString.read(buf), + source=_UniffiFfiConverterString.read(buf), + txn_index=_UniffiFfiConverterUInt64.read(buf), + app_index=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.field_name) + _UniffiFfiConverterString.check_lower(value.source) + _UniffiFfiConverterUInt64.check_lower(value.txn_index) + _UniffiFfiConverterUInt64.check_lower(value.app_index) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.field_name, buf) + _UniffiFfiConverterString.write(value.source, buf) + _UniffiFfiConverterUInt64.write(value.txn_index, buf) + _UniffiFfiConverterUInt64.write(value.app_index, buf) + +class _UniffiFfiConverterSequenceTypeDryrunSource(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeDryrunSource.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeDryrunSource.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeDryrunSource.read(buf) for i in range(count) + ] + +@dataclass +class DryrunRequest: + """ + Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information. +""" + def __init__(self, *, txns:typing.List[algokit_transact_ffi.SignedTransaction], accounts:typing.List[Account], apps:typing.List[Application], protocol_version:str, round:int, latest_timestamp:int, sources:typing.List[DryrunSource]): + self.txns = txns + self.accounts = accounts + self.apps = apps + self.protocol_version = protocol_version + self.round = round + self.latest_timestamp = latest_timestamp + self.sources = sources + + + + + def __str__(self): + return "DryrunRequest(txns={}, accounts={}, apps={}, protocol_version={}, round={}, latest_timestamp={}, sources={})".format(self.txns, self.accounts, self.apps, self.protocol_version, self.round, self.latest_timestamp, self.sources) + def __eq__(self, other): + if self.txns != other.txns: + return False + if self.accounts != other.accounts: + return False + if self.apps != other.apps: + return False + if self.protocol_version != other.protocol_version: + return False + if self.round != other.round: + return False + if self.latest_timestamp != other.latest_timestamp: + return False + if self.sources != other.sources: + return False + return True + +class _UniffiFfiConverterTypeDryrunRequest(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DryrunRequest( + txns=_UniffiFfiConverterSequenceTypeSignedTransaction.read(buf), + accounts=_UniffiFfiConverterSequenceTypeAccount.read(buf), + apps=_UniffiFfiConverterSequenceTypeApplication.read(buf), + protocol_version=_UniffiFfiConverterString.read(buf), + round=_UniffiFfiConverterUInt64.read(buf), + latest_timestamp=_UniffiFfiConverterUInt64.read(buf), + sources=_UniffiFfiConverterSequenceTypeDryrunSource.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeSignedTransaction.check_lower(value.txns) + _UniffiFfiConverterSequenceTypeAccount.check_lower(value.accounts) + _UniffiFfiConverterSequenceTypeApplication.check_lower(value.apps) + _UniffiFfiConverterString.check_lower(value.protocol_version) + _UniffiFfiConverterUInt64.check_lower(value.round) + _UniffiFfiConverterUInt64.check_lower(value.latest_timestamp) + _UniffiFfiConverterSequenceTypeDryrunSource.check_lower(value.sources) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeSignedTransaction.write(value.txns, buf) + _UniffiFfiConverterSequenceTypeAccount.write(value.accounts, buf) + _UniffiFfiConverterSequenceTypeApplication.write(value.apps, buf) + _UniffiFfiConverterString.write(value.protocol_version, buf) + _UniffiFfiConverterUInt64.write(value.round, buf) + _UniffiFfiConverterUInt64.write(value.latest_timestamp, buf) + _UniffiFfiConverterSequenceTypeDryrunSource.write(value.sources, buf) + +class _UniffiFfiConverterSequenceTypeTealValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeTealValue.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeTealValue.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeTealValue.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeTealValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeTealValue.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeTealValue.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeTealValue.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class DryrunState: + """ + Stores the TEAL eval step data +""" + def __init__(self, *, line:int, pc:int, stack:typing.List[TealValue], scratch:typing.Optional[typing.List[TealValue]], error:typing.Optional[str]): + self.line = line + self.pc = pc + self.stack = stack + self.scratch = scratch + self.error = error + + + + + def __str__(self): + return "DryrunState(line={}, pc={}, stack={}, scratch={}, error={})".format(self.line, self.pc, self.stack, self.scratch, self.error) + def __eq__(self, other): + if self.line != other.line: + return False + if self.pc != other.pc: + return False + if self.stack != other.stack: + return False + if self.scratch != other.scratch: + return False + if self.error != other.error: + return False + return True + +class _UniffiFfiConverterTypeDryrunState(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DryrunState( + line=_UniffiFfiConverterUInt64.read(buf), + pc=_UniffiFfiConverterUInt64.read(buf), + stack=_UniffiFfiConverterSequenceTypeTealValue.read(buf), + scratch=_UniffiFfiConverterOptionalSequenceTypeTealValue.read(buf), + error=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.line) + _UniffiFfiConverterUInt64.check_lower(value.pc) + _UniffiFfiConverterSequenceTypeTealValue.check_lower(value.stack) + _UniffiFfiConverterOptionalSequenceTypeTealValue.check_lower(value.scratch) + _UniffiFfiConverterOptionalString.check_lower(value.error) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.line, buf) + _UniffiFfiConverterUInt64.write(value.pc, buf) + _UniffiFfiConverterSequenceTypeTealValue.write(value.stack, buf) + _UniffiFfiConverterOptionalSequenceTypeTealValue.write(value.scratch, buf) + _UniffiFfiConverterOptionalString.write(value.error, buf) + +class _UniffiFfiConverterSequenceTypeDryrunState(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeDryrunState.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeDryrunState.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeDryrunState.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeDryrunState(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeDryrunState.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeDryrunState.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeDryrunState.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeStateDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeStateDelta.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeStateDelta.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeStateDelta.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeAccountStateDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAccountStateDelta.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAccountStateDelta.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAccountStateDelta.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeAccountStateDelta(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeAccountStateDelta.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeAccountStateDelta.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeAccountStateDelta.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class DryrunTxnResult: + """ + DryrunTxnResult contains any LogicSig or ApplicationCall program debug information and state updates from a dryrun. +""" + def __init__(self, *, disassembly:typing.List[str], logic_sig_disassembly:typing.Optional[typing.List[str]], logic_sig_trace:typing.Optional[typing.List[DryrunState]], logic_sig_messages:typing.Optional[typing.List[str]], app_call_trace:typing.Optional[typing.List[DryrunState]], app_call_messages:typing.Optional[typing.List[str]], global_delta:typing.Optional[StateDelta], local_deltas:typing.Optional[typing.List[AccountStateDelta]], logs:typing.Optional[typing.List[bytes]], budget_added:typing.Optional[int], budget_consumed:typing.Optional[int]): + self.disassembly = disassembly + self.logic_sig_disassembly = logic_sig_disassembly + self.logic_sig_trace = logic_sig_trace + self.logic_sig_messages = logic_sig_messages + self.app_call_trace = app_call_trace + self.app_call_messages = app_call_messages + self.global_delta = global_delta + self.local_deltas = local_deltas + self.logs = logs + self.budget_added = budget_added + self.budget_consumed = budget_consumed + + + + + def __str__(self): + return "DryrunTxnResult(disassembly={}, logic_sig_disassembly={}, logic_sig_trace={}, logic_sig_messages={}, app_call_trace={}, app_call_messages={}, global_delta={}, local_deltas={}, logs={}, budget_added={}, budget_consumed={})".format(self.disassembly, self.logic_sig_disassembly, self.logic_sig_trace, self.logic_sig_messages, self.app_call_trace, self.app_call_messages, self.global_delta, self.local_deltas, self.logs, self.budget_added, self.budget_consumed) + def __eq__(self, other): + if self.disassembly != other.disassembly: + return False + if self.logic_sig_disassembly != other.logic_sig_disassembly: + return False + if self.logic_sig_trace != other.logic_sig_trace: + return False + if self.logic_sig_messages != other.logic_sig_messages: + return False + if self.app_call_trace != other.app_call_trace: + return False + if self.app_call_messages != other.app_call_messages: + return False + if self.global_delta != other.global_delta: + return False + if self.local_deltas != other.local_deltas: + return False + if self.logs != other.logs: + return False + if self.budget_added != other.budget_added: + return False + if self.budget_consumed != other.budget_consumed: + return False + return True + +class _UniffiFfiConverterTypeDryrunTxnResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DryrunTxnResult( + disassembly=_UniffiFfiConverterSequenceString.read(buf), + logic_sig_disassembly=_UniffiFfiConverterOptionalSequenceString.read(buf), + logic_sig_trace=_UniffiFfiConverterOptionalSequenceTypeDryrunState.read(buf), + logic_sig_messages=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_call_trace=_UniffiFfiConverterOptionalSequenceTypeDryrunState.read(buf), + app_call_messages=_UniffiFfiConverterOptionalSequenceString.read(buf), + global_delta=_UniffiFfiConverterOptionalTypeStateDelta.read(buf), + local_deltas=_UniffiFfiConverterOptionalSequenceTypeAccountStateDelta.read(buf), + logs=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + budget_added=_UniffiFfiConverterOptionalUInt32.read(buf), + budget_consumed=_UniffiFfiConverterOptionalUInt32.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceString.check_lower(value.disassembly) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.logic_sig_disassembly) + _UniffiFfiConverterOptionalSequenceTypeDryrunState.check_lower(value.logic_sig_trace) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.logic_sig_messages) + _UniffiFfiConverterOptionalSequenceTypeDryrunState.check_lower(value.app_call_trace) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.app_call_messages) + _UniffiFfiConverterOptionalTypeStateDelta.check_lower(value.global_delta) + _UniffiFfiConverterOptionalSequenceTypeAccountStateDelta.check_lower(value.local_deltas) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.logs) + _UniffiFfiConverterOptionalUInt32.check_lower(value.budget_added) + _UniffiFfiConverterOptionalUInt32.check_lower(value.budget_consumed) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceString.write(value.disassembly, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.logic_sig_disassembly, buf) + _UniffiFfiConverterOptionalSequenceTypeDryrunState.write(value.logic_sig_trace, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.logic_sig_messages, buf) + _UniffiFfiConverterOptionalSequenceTypeDryrunState.write(value.app_call_trace, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.app_call_messages, buf) + _UniffiFfiConverterOptionalTypeStateDelta.write(value.global_delta, buf) + _UniffiFfiConverterOptionalSequenceTypeAccountStateDelta.write(value.local_deltas, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.logs, buf) + _UniffiFfiConverterOptionalUInt32.write(value.budget_added, buf) + _UniffiFfiConverterOptionalUInt32.write(value.budget_consumed, buf) + + +class _UniffiFfiConverterTypeUnknownJsonValue: + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value, buf) + + @staticmethod + def read(buf): + return _UniffiFfiConverterString.read(buf) + + @staticmethod + def lift(value): + return _UniffiFfiConverterString.lift(value) + + @staticmethod + def check_lower(value): + return _UniffiFfiConverterString.check_lower(value) + + @staticmethod + def lower(value): + return _UniffiFfiConverterString.lower(value) + + +UnknownJsonValue = str + +class _UniffiFfiConverterOptionalTypeUnknownJsonValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeUnknownJsonValue.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeUnknownJsonValue.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class ErrorResponse: + """ + An error response with optional data field. +""" + def __init__(self, *, data:typing.Optional[UnknownJsonValue], message:str): + self.data = data + self.message = message + + + + + def __str__(self): + return "ErrorResponse(data={}, message={})".format(self.data, self.message) + def __eq__(self, other): + if self.data != other.data: + return False + if self.message != other.message: + return False + return True + +class _UniffiFfiConverterTypeErrorResponse(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ErrorResponse( + data=_UniffiFfiConverterOptionalTypeUnknownJsonValue.read(buf), + message=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalTypeUnknownJsonValue.check_lower(value.data) + _UniffiFfiConverterString.check_lower(value.message) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalTypeUnknownJsonValue.write(value.data, buf) + _UniffiFfiConverterString.write(value.message, buf) + +@dataclass +class GenesisAllocation: + def __init__(self, *, addr:str, comment:str, state:UnknownJsonValue): + self.addr = addr + self.comment = comment + self.state = state + + + + + def __str__(self): + return "GenesisAllocation(addr={}, comment={}, state={})".format(self.addr, self.comment, self.state) + def __eq__(self, other): + if self.addr != other.addr: + return False + if self.comment != other.comment: + return False + if self.state != other.state: + return False + return True + +class _UniffiFfiConverterTypeGenesisAllocation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GenesisAllocation( + addr=_UniffiFfiConverterString.read(buf), + comment=_UniffiFfiConverterString.read(buf), + state=_UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.addr) + _UniffiFfiConverterString.check_lower(value.comment) + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value.state) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.addr, buf) + _UniffiFfiConverterString.write(value.comment, buf) + _UniffiFfiConverterTypeUnknownJsonValue.write(value.state, buf) + +class _UniffiFfiConverterSequenceTypeGenesisAllocation(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeGenesisAllocation.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeGenesisAllocation.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeGenesisAllocation.read(buf) for i in range(count) + ] + +@dataclass +class Genesis: + def __init__(self, *, alloc:typing.List[GenesisAllocation], comment:typing.Optional[str], devmode:typing.Optional[bool], fees:str, id:str, network:str, proto:str, rwd:str, timestamp:int): + self.alloc = alloc + self.comment = comment + self.devmode = devmode + self.fees = fees + self.id = id + self.network = network + self.proto = proto + self.rwd = rwd + self.timestamp = timestamp + + + + + def __str__(self): + return "Genesis(alloc={}, comment={}, devmode={}, fees={}, id={}, network={}, proto={}, rwd={}, timestamp={})".format(self.alloc, self.comment, self.devmode, self.fees, self.id, self.network, self.proto, self.rwd, self.timestamp) + def __eq__(self, other): + if self.alloc != other.alloc: + return False + if self.comment != other.comment: + return False + if self.devmode != other.devmode: + return False + if self.fees != other.fees: + return False + if self.id != other.id: + return False + if self.network != other.network: + return False + if self.proto != other.proto: + return False + if self.rwd != other.rwd: + return False + if self.timestamp != other.timestamp: + return False + return True + +class _UniffiFfiConverterTypeGenesis(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Genesis( + alloc=_UniffiFfiConverterSequenceTypeGenesisAllocation.read(buf), + comment=_UniffiFfiConverterOptionalString.read(buf), + devmode=_UniffiFfiConverterOptionalBoolean.read(buf), + fees=_UniffiFfiConverterString.read(buf), + id=_UniffiFfiConverterString.read(buf), + network=_UniffiFfiConverterString.read(buf), + proto=_UniffiFfiConverterString.read(buf), + rwd=_UniffiFfiConverterString.read(buf), + timestamp=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeGenesisAllocation.check_lower(value.alloc) + _UniffiFfiConverterOptionalString.check_lower(value.comment) + _UniffiFfiConverterOptionalBoolean.check_lower(value.devmode) + _UniffiFfiConverterString.check_lower(value.fees) + _UniffiFfiConverterString.check_lower(value.id) + _UniffiFfiConverterString.check_lower(value.network) + _UniffiFfiConverterString.check_lower(value.proto) + _UniffiFfiConverterString.check_lower(value.rwd) + _UniffiFfiConverterUInt64.check_lower(value.timestamp) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeGenesisAllocation.write(value.alloc, buf) + _UniffiFfiConverterOptionalString.write(value.comment, buf) + _UniffiFfiConverterOptionalBoolean.write(value.devmode, buf) + _UniffiFfiConverterString.write(value.fees, buf) + _UniffiFfiConverterString.write(value.id, buf) + _UniffiFfiConverterString.write(value.network, buf) + _UniffiFfiConverterString.write(value.proto, buf) + _UniffiFfiConverterString.write(value.rwd, buf) + _UniffiFfiConverterUInt64.write(value.timestamp, buf) + +class _UniffiFfiConverterSequenceTypeBoxDescriptor(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeBoxDescriptor.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeBoxDescriptor.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeBoxDescriptor.read(buf) for i in range(count) + ] + +@dataclass +class GetApplicationBoxes: + """ + Box names of an application +""" + def __init__(self, *, boxes:typing.List[BoxDescriptor]): + self.boxes = boxes + + + + + def __str__(self): + return "GetApplicationBoxes(boxes={})".format(self.boxes) + def __eq__(self, other): + if self.boxes != other.boxes: + return False + return True + +class _UniffiFfiConverterTypeGetApplicationBoxes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetApplicationBoxes( + boxes=_UniffiFfiConverterSequenceTypeBoxDescriptor.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeBoxDescriptor.check_lower(value.boxes) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeBoxDescriptor.write(value.boxes, buf) + +@dataclass +class GetBlock: + """ + Encoded block object. +""" + def __init__(self, *, block:Block, cert:typing.Optional[bytes]): + self.block = block + self.cert = cert + + + + + def __str__(self): + return "GetBlock(block={}, cert={})".format(self.block, self.cert) + def __eq__(self, other): + if self.block != other.block: + return False + if self.cert != other.cert: + return False + return True + +class _UniffiFfiConverterTypeGetBlock(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetBlock( + block=_UniffiFfiConverterTypeBlock.read(buf), + cert=_UniffiFfiConverterOptionalBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeBlock.check_lower(value.block) + _UniffiFfiConverterOptionalBytes.check_lower(value.cert) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeBlock.write(value.block, buf) + _UniffiFfiConverterOptionalBytes.write(value.cert, buf) + +@dataclass +class GetBlockHash: + """ + Hash of a block header. +""" + def __init__(self, *, block_hash:str): + self.block_hash = block_hash + + + + + def __str__(self): + return "GetBlockHash(block_hash={})".format(self.block_hash) + def __eq__(self, other): + if self.block_hash != other.block_hash: + return False + return True + +class _UniffiFfiConverterTypeGetBlockHash(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetBlockHash( + block_hash=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.block_hash) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.block_hash, buf) + +class _UniffiFfiConverterSequenceTypeAppCallLogs(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAppCallLogs.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAppCallLogs.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAppCallLogs.read(buf) for i in range(count) + ] + +@dataclass +class GetBlockLogs: + """ + All logs emitted in the given round. Each app call, whether top-level or inner, that contains logs results in a separate AppCallLogs object. Therefore there may be multiple AppCallLogs with the same application ID and outer transaction ID in the event of multiple inner app calls to the same app. App calls with no logs are not included in the response. AppCallLogs are returned in the same order that their corresponding app call appeared in the block (pre-order traversal of inner app calls) +""" + def __init__(self, *, logs:typing.List[AppCallLogs]): + self.logs = logs + + + + + def __str__(self): + return "GetBlockLogs(logs={})".format(self.logs) + def __eq__(self, other): + if self.logs != other.logs: + return False + return True + +class _UniffiFfiConverterTypeGetBlockLogs(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetBlockLogs( + logs=_UniffiFfiConverterSequenceTypeAppCallLogs.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeAppCallLogs.check_lower(value.logs) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeAppCallLogs.write(value.logs, buf) + +@dataclass +class GetBlockTimeStampOffset: + """ + Response containing the timestamp offset in seconds +""" + def __init__(self, *, offset:int): + self.offset = offset + + + + + def __str__(self): + return "GetBlockTimeStampOffset(offset={})".format(self.offset) + def __eq__(self, other): + if self.offset != other.offset: + return False + return True + +class _UniffiFfiConverterTypeGetBlockTimeStampOffset(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetBlockTimeStampOffset( + offset=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.offset) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.offset, buf) + +@dataclass +class GetBlockTxids: + """ + Top level transaction IDs in a block. +""" + def __init__(self, *, block_txids:typing.List[str]): + self.block_txids = block_txids + + + + + def __str__(self): + return "GetBlockTxids(block_txids={})".format(self.block_txids) + def __eq__(self, other): + if self.block_txids != other.block_txids: + return False + return True + +class _UniffiFfiConverterTypeGetBlockTxids(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetBlockTxids( + block_txids=_UniffiFfiConverterSequenceString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceString.check_lower(value.block_txids) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceString.write(value.block_txids, buf) + +@dataclass +class GetPendingTransactions: + """ + PendingTransactions is an array of signed transactions exactly as they were submitted. +""" + def __init__(self, *, top_transactions:typing.List[algokit_transact_ffi.SignedTransaction], total_transactions:int): + self.top_transactions = top_transactions + self.total_transactions = total_transactions + + + + + def __str__(self): + return "GetPendingTransactions(top_transactions={}, total_transactions={})".format(self.top_transactions, self.total_transactions) + def __eq__(self, other): + if self.top_transactions != other.top_transactions: + return False + if self.total_transactions != other.total_transactions: + return False + return True + +class _UniffiFfiConverterTypeGetPendingTransactions(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetPendingTransactions( + top_transactions=_UniffiFfiConverterSequenceTypeSignedTransaction.read(buf), + total_transactions=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeSignedTransaction.check_lower(value.top_transactions) + _UniffiFfiConverterUInt64.check_lower(value.total_transactions) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeSignedTransaction.write(value.top_transactions, buf) + _UniffiFfiConverterUInt64.write(value.total_transactions, buf) + +@dataclass +class GetPendingTransactionsByAddress: + """ + PendingTransactions is an array of signed transactions exactly as they were submitted. +""" + def __init__(self, *, top_transactions:typing.List[algokit_transact_ffi.SignedTransaction], total_transactions:int): + self.top_transactions = top_transactions + self.total_transactions = total_transactions + + + + + def __str__(self): + return "GetPendingTransactionsByAddress(top_transactions={}, total_transactions={})".format(self.top_transactions, self.total_transactions) + def __eq__(self, other): + if self.top_transactions != other.top_transactions: + return False + if self.total_transactions != other.total_transactions: + return False + return True + +class _UniffiFfiConverterTypeGetPendingTransactionsByAddress(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetPendingTransactionsByAddress( + top_transactions=_UniffiFfiConverterSequenceTypeSignedTransaction.read(buf), + total_transactions=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeSignedTransaction.check_lower(value.top_transactions) + _UniffiFfiConverterUInt64.check_lower(value.total_transactions) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeSignedTransaction.write(value.top_transactions, buf) + _UniffiFfiConverterUInt64.write(value.total_transactions, buf) + +@dataclass +class GetStatus: + """ + NodeStatus contains the information about a node status +""" + def __init__(self, *, catchup_time:int, last_round:int, last_version:str, next_version:str, next_version_round:int, next_version_supported:bool, stopped_at_unsupported_round:bool, time_since_last_round:int, last_catchpoint:typing.Optional[str], catchpoint:typing.Optional[str], catchpoint_total_accounts:typing.Optional[int], catchpoint_processed_accounts:typing.Optional[int], catchpoint_verified_accounts:typing.Optional[int], catchpoint_total_kvs:typing.Optional[int], catchpoint_processed_kvs:typing.Optional[int], catchpoint_verified_kvs:typing.Optional[int], catchpoint_total_blocks:typing.Optional[int], catchpoint_acquired_blocks:typing.Optional[int], upgrade_delay:typing.Optional[int], upgrade_node_vote:typing.Optional[bool], upgrade_votes_required:typing.Optional[int], upgrade_votes:typing.Optional[int], upgrade_yes_votes:typing.Optional[int], upgrade_no_votes:typing.Optional[int], upgrade_next_protocol_vote_before:typing.Optional[int], upgrade_vote_rounds:typing.Optional[int]): + self.catchup_time = catchup_time + self.last_round = last_round + self.last_version = last_version + self.next_version = next_version + self.next_version_round = next_version_round + self.next_version_supported = next_version_supported + self.stopped_at_unsupported_round = stopped_at_unsupported_round + self.time_since_last_round = time_since_last_round + self.last_catchpoint = last_catchpoint + self.catchpoint = catchpoint + self.catchpoint_total_accounts = catchpoint_total_accounts + self.catchpoint_processed_accounts = catchpoint_processed_accounts + self.catchpoint_verified_accounts = catchpoint_verified_accounts + self.catchpoint_total_kvs = catchpoint_total_kvs + self.catchpoint_processed_kvs = catchpoint_processed_kvs + self.catchpoint_verified_kvs = catchpoint_verified_kvs + self.catchpoint_total_blocks = catchpoint_total_blocks + self.catchpoint_acquired_blocks = catchpoint_acquired_blocks + self.upgrade_delay = upgrade_delay + self.upgrade_node_vote = upgrade_node_vote + self.upgrade_votes_required = upgrade_votes_required + self.upgrade_votes = upgrade_votes + self.upgrade_yes_votes = upgrade_yes_votes + self.upgrade_no_votes = upgrade_no_votes + self.upgrade_next_protocol_vote_before = upgrade_next_protocol_vote_before + self.upgrade_vote_rounds = upgrade_vote_rounds + + + + + def __str__(self): + return "GetStatus(catchup_time={}, last_round={}, last_version={}, next_version={}, next_version_round={}, next_version_supported={}, stopped_at_unsupported_round={}, time_since_last_round={}, last_catchpoint={}, catchpoint={}, catchpoint_total_accounts={}, catchpoint_processed_accounts={}, catchpoint_verified_accounts={}, catchpoint_total_kvs={}, catchpoint_processed_kvs={}, catchpoint_verified_kvs={}, catchpoint_total_blocks={}, catchpoint_acquired_blocks={}, upgrade_delay={}, upgrade_node_vote={}, upgrade_votes_required={}, upgrade_votes={}, upgrade_yes_votes={}, upgrade_no_votes={}, upgrade_next_protocol_vote_before={}, upgrade_vote_rounds={})".format(self.catchup_time, self.last_round, self.last_version, self.next_version, self.next_version_round, self.next_version_supported, self.stopped_at_unsupported_round, self.time_since_last_round, self.last_catchpoint, self.catchpoint, self.catchpoint_total_accounts, self.catchpoint_processed_accounts, self.catchpoint_verified_accounts, self.catchpoint_total_kvs, self.catchpoint_processed_kvs, self.catchpoint_verified_kvs, self.catchpoint_total_blocks, self.catchpoint_acquired_blocks, self.upgrade_delay, self.upgrade_node_vote, self.upgrade_votes_required, self.upgrade_votes, self.upgrade_yes_votes, self.upgrade_no_votes, self.upgrade_next_protocol_vote_before, self.upgrade_vote_rounds) + def __eq__(self, other): + if self.catchup_time != other.catchup_time: + return False + if self.last_round != other.last_round: + return False + if self.last_version != other.last_version: + return False + if self.next_version != other.next_version: + return False + if self.next_version_round != other.next_version_round: + return False + if self.next_version_supported != other.next_version_supported: + return False + if self.stopped_at_unsupported_round != other.stopped_at_unsupported_round: + return False + if self.time_since_last_round != other.time_since_last_round: + return False + if self.last_catchpoint != other.last_catchpoint: + return False + if self.catchpoint != other.catchpoint: + return False + if self.catchpoint_total_accounts != other.catchpoint_total_accounts: + return False + if self.catchpoint_processed_accounts != other.catchpoint_processed_accounts: + return False + if self.catchpoint_verified_accounts != other.catchpoint_verified_accounts: + return False + if self.catchpoint_total_kvs != other.catchpoint_total_kvs: + return False + if self.catchpoint_processed_kvs != other.catchpoint_processed_kvs: + return False + if self.catchpoint_verified_kvs != other.catchpoint_verified_kvs: + return False + if self.catchpoint_total_blocks != other.catchpoint_total_blocks: + return False + if self.catchpoint_acquired_blocks != other.catchpoint_acquired_blocks: + return False + if self.upgrade_delay != other.upgrade_delay: + return False + if self.upgrade_node_vote != other.upgrade_node_vote: + return False + if self.upgrade_votes_required != other.upgrade_votes_required: + return False + if self.upgrade_votes != other.upgrade_votes: + return False + if self.upgrade_yes_votes != other.upgrade_yes_votes: + return False + if self.upgrade_no_votes != other.upgrade_no_votes: + return False + if self.upgrade_next_protocol_vote_before != other.upgrade_next_protocol_vote_before: + return False + if self.upgrade_vote_rounds != other.upgrade_vote_rounds: + return False + return True + +class _UniffiFfiConverterTypeGetStatus(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetStatus( + catchup_time=_UniffiFfiConverterUInt64.read(buf), + last_round=_UniffiFfiConverterUInt64.read(buf), + last_version=_UniffiFfiConverterString.read(buf), + next_version=_UniffiFfiConverterString.read(buf), + next_version_round=_UniffiFfiConverterUInt64.read(buf), + next_version_supported=_UniffiFfiConverterBoolean.read(buf), + stopped_at_unsupported_round=_UniffiFfiConverterBoolean.read(buf), + time_since_last_round=_UniffiFfiConverterUInt64.read(buf), + last_catchpoint=_UniffiFfiConverterOptionalString.read(buf), + catchpoint=_UniffiFfiConverterOptionalString.read(buf), + catchpoint_total_accounts=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_processed_accounts=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_verified_accounts=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_total_kvs=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_processed_kvs=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_verified_kvs=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_total_blocks=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_acquired_blocks=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_delay=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_node_vote=_UniffiFfiConverterOptionalBoolean.read(buf), + upgrade_votes_required=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_votes=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_yes_votes=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_no_votes=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_next_protocol_vote_before=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_vote_rounds=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.catchup_time) + _UniffiFfiConverterUInt64.check_lower(value.last_round) + _UniffiFfiConverterString.check_lower(value.last_version) + _UniffiFfiConverterString.check_lower(value.next_version) + _UniffiFfiConverterUInt64.check_lower(value.next_version_round) + _UniffiFfiConverterBoolean.check_lower(value.next_version_supported) + _UniffiFfiConverterBoolean.check_lower(value.stopped_at_unsupported_round) + _UniffiFfiConverterUInt64.check_lower(value.time_since_last_round) + _UniffiFfiConverterOptionalString.check_lower(value.last_catchpoint) + _UniffiFfiConverterOptionalString.check_lower(value.catchpoint) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_total_accounts) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_processed_accounts) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_verified_accounts) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_total_kvs) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_processed_kvs) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_verified_kvs) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_total_blocks) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_acquired_blocks) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_delay) + _UniffiFfiConverterOptionalBoolean.check_lower(value.upgrade_node_vote) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_votes_required) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_votes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_yes_votes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_no_votes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_next_protocol_vote_before) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_vote_rounds) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.catchup_time, buf) + _UniffiFfiConverterUInt64.write(value.last_round, buf) + _UniffiFfiConverterString.write(value.last_version, buf) + _UniffiFfiConverterString.write(value.next_version, buf) + _UniffiFfiConverterUInt64.write(value.next_version_round, buf) + _UniffiFfiConverterBoolean.write(value.next_version_supported, buf) + _UniffiFfiConverterBoolean.write(value.stopped_at_unsupported_round, buf) + _UniffiFfiConverterUInt64.write(value.time_since_last_round, buf) + _UniffiFfiConverterOptionalString.write(value.last_catchpoint, buf) + _UniffiFfiConverterOptionalString.write(value.catchpoint, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_total_accounts, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_processed_accounts, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_verified_accounts, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_total_kvs, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_processed_kvs, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_verified_kvs, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_total_blocks, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_acquired_blocks, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_delay, buf) + _UniffiFfiConverterOptionalBoolean.write(value.upgrade_node_vote, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_votes_required, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_votes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_yes_votes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_no_votes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_next_protocol_vote_before, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_vote_rounds, buf) + +@dataclass +class GetSupply: + """ + Supply represents the current supply of MicroAlgos in the system +""" + def __init__(self, *, current_round:int, online_money:int, total_money:int): + self.current_round = current_round + self.online_money = online_money + self.total_money = total_money + + + + + def __str__(self): + return "GetSupply(current_round={}, online_money={}, total_money={})".format(self.current_round, self.online_money, self.total_money) + def __eq__(self, other): + if self.current_round != other.current_round: + return False + if self.online_money != other.online_money: + return False + if self.total_money != other.total_money: + return False + return True + +class _UniffiFfiConverterTypeGetSupply(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetSupply( + current_round=_UniffiFfiConverterUInt64.read(buf), + online_money=_UniffiFfiConverterUInt64.read(buf), + total_money=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.current_round) + _UniffiFfiConverterUInt64.check_lower(value.online_money) + _UniffiFfiConverterUInt64.check_lower(value.total_money) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.current_round, buf) + _UniffiFfiConverterUInt64.write(value.online_money, buf) + _UniffiFfiConverterUInt64.write(value.total_money, buf) + +@dataclass +class GetSyncRound: + """ + Response containing the ledger's minimum sync round +""" + def __init__(self, *, round:int): + self.round = round + + + + + def __str__(self): + return "GetSyncRound(round={})".format(self.round) + def __eq__(self, other): + if self.round != other.round: + return False + return True + +class _UniffiFfiConverterTypeGetSyncRound(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetSyncRound( + round=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.round, buf) + +@dataclass +class LedgerStateDelta: + """ + Ledger StateDelta object +""" + + + + + + def __str__(self): + return "LedgerStateDelta()".format() + def __eq__(self, other): + return True + +class _UniffiFfiConverterTypeLedgerStateDelta(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return LedgerStateDelta( + ) + + @staticmethod + def check_lower(value): + pass + + @staticmethod + def write(value, buf): + pass + +@dataclass +class LedgerStateDeltaForTransactionGroup: + """ + Contains a ledger delta for a single transaction group +""" + def __init__(self, *, delta:LedgerStateDelta, ids:typing.List[str]): + self.delta = delta + self.ids = ids + + + + + def __str__(self): + return "LedgerStateDeltaForTransactionGroup(delta={}, ids={})".format(self.delta, self.ids) + def __eq__(self, other): + if self.delta != other.delta: + return False + if self.ids != other.ids: + return False + return True + +class _UniffiFfiConverterTypeLedgerStateDeltaForTransactionGroup(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return LedgerStateDeltaForTransactionGroup( + delta=_UniffiFfiConverterTypeLedgerStateDelta.read(buf), + ids=_UniffiFfiConverterSequenceString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeLedgerStateDelta.check_lower(value.delta) + _UniffiFfiConverterSequenceString.check_lower(value.ids) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeLedgerStateDelta.write(value.delta, buf) + _UniffiFfiConverterSequenceString.write(value.ids, buf) + +class _UniffiFfiConverterSequenceTypeLedgerStateDeltaForTransactionGroup(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeLedgerStateDeltaForTransactionGroup.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeLedgerStateDeltaForTransactionGroup.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeLedgerStateDeltaForTransactionGroup.read(buf) for i in range(count) + ] + +@dataclass +class GetTransactionGroupLedgerStateDeltasForRound: + """ + Response containing all ledger state deltas for transaction groups, with their associated Ids, in a single round. +""" + def __init__(self, *, deltas:typing.List[LedgerStateDeltaForTransactionGroup]): + self.deltas = deltas + + + + + def __str__(self): + return "GetTransactionGroupLedgerStateDeltasForRound(deltas={})".format(self.deltas) + def __eq__(self, other): + if self.deltas != other.deltas: + return False + return True + +class _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRound(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GetTransactionGroupLedgerStateDeltasForRound( + deltas=_UniffiFfiConverterSequenceTypeLedgerStateDeltaForTransactionGroup.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeLedgerStateDeltaForTransactionGroup.check_lower(value.deltas) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeLedgerStateDeltaForTransactionGroup.write(value.deltas, buf) + +@dataclass +class LightBlockHeaderProof: + """ + Proof of membership and position of a light block header. +""" + def __init__(self, *, index:int, treedepth:int, proof:bytes): + self.index = index + self.treedepth = treedepth + self.proof = proof + + + + + def __str__(self): + return "LightBlockHeaderProof(index={}, treedepth={}, proof={})".format(self.index, self.treedepth, self.proof) + def __eq__(self, other): + if self.index != other.index: + return False + if self.treedepth != other.treedepth: + return False + if self.proof != other.proof: + return False + return True + +class _UniffiFfiConverterTypeLightBlockHeaderProof(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return LightBlockHeaderProof( + index=_UniffiFfiConverterUInt64.read(buf), + treedepth=_UniffiFfiConverterUInt64.read(buf), + proof=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.index) + _UniffiFfiConverterUInt64.check_lower(value.treedepth) + _UniffiFfiConverterBytes.check_lower(value.proof) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.index, buf) + _UniffiFfiConverterUInt64.write(value.treedepth, buf) + _UniffiFfiConverterBytes.write(value.proof, buf) + +@dataclass +class ParticipationKey: + """ + Represents a participation key used by the node. +""" + def __init__(self, *, id:str, address:str, effective_first_valid:typing.Optional[int], effective_last_valid:typing.Optional[int], last_vote:typing.Optional[int], last_block_proposal:typing.Optional[int], last_state_proof:typing.Optional[int], key:AccountParticipation): + self.id = id + self.address = address + self.effective_first_valid = effective_first_valid + self.effective_last_valid = effective_last_valid + self.last_vote = last_vote + self.last_block_proposal = last_block_proposal + self.last_state_proof = last_state_proof + self.key = key + + + + + def __str__(self): + return "ParticipationKey(id={}, address={}, effective_first_valid={}, effective_last_valid={}, last_vote={}, last_block_proposal={}, last_state_proof={}, key={})".format(self.id, self.address, self.effective_first_valid, self.effective_last_valid, self.last_vote, self.last_block_proposal, self.last_state_proof, self.key) + def __eq__(self, other): + if self.id != other.id: + return False + if self.address != other.address: + return False + if self.effective_first_valid != other.effective_first_valid: + return False + if self.effective_last_valid != other.effective_last_valid: + return False + if self.last_vote != other.last_vote: + return False + if self.last_block_proposal != other.last_block_proposal: + return False + if self.last_state_proof != other.last_state_proof: + return False + if self.key != other.key: + return False + return True + +class _UniffiFfiConverterTypeParticipationKey(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ParticipationKey( + id=_UniffiFfiConverterString.read(buf), + address=_UniffiFfiConverterString.read(buf), + effective_first_valid=_UniffiFfiConverterOptionalUInt64.read(buf), + effective_last_valid=_UniffiFfiConverterOptionalUInt64.read(buf), + last_vote=_UniffiFfiConverterOptionalUInt64.read(buf), + last_block_proposal=_UniffiFfiConverterOptionalUInt64.read(buf), + last_state_proof=_UniffiFfiConverterOptionalUInt64.read(buf), + key=_UniffiFfiConverterTypeAccountParticipation.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.id) + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterOptionalUInt64.check_lower(value.effective_first_valid) + _UniffiFfiConverterOptionalUInt64.check_lower(value.effective_last_valid) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_vote) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_block_proposal) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_state_proof) + _UniffiFfiConverterTypeAccountParticipation.check_lower(value.key) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.id, buf) + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterOptionalUInt64.write(value.effective_first_valid, buf) + _UniffiFfiConverterOptionalUInt64.write(value.effective_last_valid, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_vote, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_block_proposal, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_state_proof, buf) + _UniffiFfiConverterTypeAccountParticipation.write(value.key, buf) + +class _UniffiFfiConverterSequenceTypePendingTransactionResponse(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypePendingTransactionResponse.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypePendingTransactionResponse.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypePendingTransactionResponse.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypePendingTransactionResponse(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypePendingTransactionResponse.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypePendingTransactionResponse.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypePendingTransactionResponse.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class PendingTransactionResponse: + """ + Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details. +""" + def __init__(self, *, asset_id:typing.Optional[int], app_id:typing.Optional[int], close_rewards:typing.Optional[int], closing_amount:typing.Optional[int], asset_closing_amount:typing.Optional[int], confirmed_round:typing.Optional[int], pool_error:str, receiver_rewards:typing.Optional[int], sender_rewards:typing.Optional[int], local_state_delta:typing.Optional[typing.List[AccountStateDelta]], global_state_delta:typing.Optional[StateDelta], logs:typing.Optional[typing.List[bytes]], inner_txns:typing.Optional[typing.List[PendingTransactionResponse]], txn:algokit_transact_ffi.SignedTransaction): + self.asset_id = asset_id + self.app_id = app_id + self.close_rewards = close_rewards + self.closing_amount = closing_amount + self.asset_closing_amount = asset_closing_amount + self.confirmed_round = confirmed_round + self.pool_error = pool_error + self.receiver_rewards = receiver_rewards + self.sender_rewards = sender_rewards + self.local_state_delta = local_state_delta + self.global_state_delta = global_state_delta + self.logs = logs + self.inner_txns = inner_txns + self.txn = txn + + + + + def __str__(self): + return "PendingTransactionResponse(asset_id={}, app_id={}, close_rewards={}, closing_amount={}, asset_closing_amount={}, confirmed_round={}, pool_error={}, receiver_rewards={}, sender_rewards={}, local_state_delta={}, global_state_delta={}, logs={}, inner_txns={}, txn={})".format(self.asset_id, self.app_id, self.close_rewards, self.closing_amount, self.asset_closing_amount, self.confirmed_round, self.pool_error, self.receiver_rewards, self.sender_rewards, self.local_state_delta, self.global_state_delta, self.logs, self.inner_txns, self.txn) + def __eq__(self, other): + if self.asset_id != other.asset_id: + return False + if self.app_id != other.app_id: + return False + if self.close_rewards != other.close_rewards: + return False + if self.closing_amount != other.closing_amount: + return False + if self.asset_closing_amount != other.asset_closing_amount: + return False + if self.confirmed_round != other.confirmed_round: + return False + if self.pool_error != other.pool_error: + return False + if self.receiver_rewards != other.receiver_rewards: + return False + if self.sender_rewards != other.sender_rewards: + return False + if self.local_state_delta != other.local_state_delta: + return False + if self.global_state_delta != other.global_state_delta: + return False + if self.logs != other.logs: + return False + if self.inner_txns != other.inner_txns: + return False + if self.txn != other.txn: + return False + return True + +class _UniffiFfiConverterTypePendingTransactionResponse(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return PendingTransactionResponse( + asset_id=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterOptionalUInt64.read(buf), + close_rewards=_UniffiFfiConverterOptionalUInt64.read(buf), + closing_amount=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_closing_amount=_UniffiFfiConverterOptionalUInt64.read(buf), + confirmed_round=_UniffiFfiConverterOptionalUInt64.read(buf), + pool_error=_UniffiFfiConverterString.read(buf), + receiver_rewards=_UniffiFfiConverterOptionalUInt64.read(buf), + sender_rewards=_UniffiFfiConverterOptionalUInt64.read(buf), + local_state_delta=_UniffiFfiConverterOptionalSequenceTypeAccountStateDelta.read(buf), + global_state_delta=_UniffiFfiConverterOptionalTypeStateDelta.read(buf), + logs=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + inner_txns=_UniffiFfiConverterOptionalSequenceTypePendingTransactionResponse.read(buf), + txn=algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalUInt64.check_lower(value.asset_id) + _UniffiFfiConverterOptionalUInt64.check_lower(value.app_id) + _UniffiFfiConverterOptionalUInt64.check_lower(value.close_rewards) + _UniffiFfiConverterOptionalUInt64.check_lower(value.closing_amount) + _UniffiFfiConverterOptionalUInt64.check_lower(value.asset_closing_amount) + _UniffiFfiConverterOptionalUInt64.check_lower(value.confirmed_round) + _UniffiFfiConverterString.check_lower(value.pool_error) + _UniffiFfiConverterOptionalUInt64.check_lower(value.receiver_rewards) + _UniffiFfiConverterOptionalUInt64.check_lower(value.sender_rewards) + _UniffiFfiConverterOptionalSequenceTypeAccountStateDelta.check_lower(value.local_state_delta) + _UniffiFfiConverterOptionalTypeStateDelta.check_lower(value.global_state_delta) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.logs) + _UniffiFfiConverterOptionalSequenceTypePendingTransactionResponse.check_lower(value.inner_txns) + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.check_lower(value.txn) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalUInt64.write(value.asset_id, buf) + _UniffiFfiConverterOptionalUInt64.write(value.app_id, buf) + _UniffiFfiConverterOptionalUInt64.write(value.close_rewards, buf) + _UniffiFfiConverterOptionalUInt64.write(value.closing_amount, buf) + _UniffiFfiConverterOptionalUInt64.write(value.asset_closing_amount, buf) + _UniffiFfiConverterOptionalUInt64.write(value.confirmed_round, buf) + _UniffiFfiConverterString.write(value.pool_error, buf) + _UniffiFfiConverterOptionalUInt64.write(value.receiver_rewards, buf) + _UniffiFfiConverterOptionalUInt64.write(value.sender_rewards, buf) + _UniffiFfiConverterOptionalSequenceTypeAccountStateDelta.write(value.local_state_delta, buf) + _UniffiFfiConverterOptionalTypeStateDelta.write(value.global_state_delta, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.logs, buf) + _UniffiFfiConverterOptionalSequenceTypePendingTransactionResponse.write(value.inner_txns, buf) + algokit_transact_ffi._UniffiFfiConverterTypeSignedTransaction.write(value.txn, buf) + +@dataclass +class RawTransaction: + """ + Transaction ID of the submission. +""" + def __init__(self, *, tx_id:str): + self.tx_id = tx_id + + + + + def __str__(self): + return "RawTransaction(tx_id={})".format(self.tx_id) + def __eq__(self, other): + if self.tx_id != other.tx_id: + return False + return True + +class _UniffiFfiConverterTypeRawTransaction(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return RawTransaction( + tx_id=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.tx_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.tx_id, buf) + +@dataclass +class ScratchChange: + """ + A write operation into a scratch slot. +""" + def __init__(self, *, slot:int, new_value:AvmValue): + self.slot = slot + self.new_value = new_value + + + + + def __str__(self): + return "ScratchChange(slot={}, new_value={})".format(self.slot, self.new_value) + def __eq__(self, other): + if self.slot != other.slot: + return False + if self.new_value != other.new_value: + return False + return True + +class _UniffiFfiConverterTypeScratchChange(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ScratchChange( + slot=_UniffiFfiConverterUInt64.read(buf), + new_value=_UniffiFfiConverterTypeAvmValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.slot) + _UniffiFfiConverterTypeAvmValue.check_lower(value.new_value) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.slot, buf) + _UniffiFfiConverterTypeAvmValue.write(value.new_value, buf) + +class _UniffiFfiConverterSequenceTypeApplicationInitialStates(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeApplicationInitialStates.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeApplicationInitialStates.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeApplicationInitialStates.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeApplicationInitialStates(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeApplicationInitialStates.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeApplicationInitialStates.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeApplicationInitialStates.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulateInitialStates: + """ + Initial states of resources that were accessed during simulation. +""" + def __init__(self, *, app_initial_states:typing.Optional[typing.List[ApplicationInitialStates]]): + self.app_initial_states = app_initial_states + + + + + def __str__(self): + return "SimulateInitialStates(app_initial_states={})".format(self.app_initial_states) + def __eq__(self, other): + if self.app_initial_states != other.app_initial_states: + return False + return True + +class _UniffiFfiConverterTypeSimulateInitialStates(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateInitialStates( + app_initial_states=_UniffiFfiConverterOptionalSequenceTypeApplicationInitialStates.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalSequenceTypeApplicationInitialStates.check_lower(value.app_initial_states) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalSequenceTypeApplicationInitialStates.write(value.app_initial_states, buf) + +@dataclass +class SimulateRequestTransactionGroup: + """ + A transaction group to simulate. +""" + def __init__(self, *, txns:typing.List[algokit_transact_ffi.SignedTransaction]): + self.txns = txns + + + + + def __str__(self): + return "SimulateRequestTransactionGroup(txns={})".format(self.txns) + def __eq__(self, other): + if self.txns != other.txns: + return False + return True + +class _UniffiFfiConverterTypeSimulateRequestTransactionGroup(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateRequestTransactionGroup( + txns=_UniffiFfiConverterSequenceTypeSignedTransaction.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeSignedTransaction.check_lower(value.txns) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeSignedTransaction.write(value.txns, buf) + +class _UniffiFfiConverterSequenceTypeSimulateRequestTransactionGroup(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSimulateRequestTransactionGroup.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSimulateRequestTransactionGroup.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSimulateRequestTransactionGroup.read(buf) for i in range(count) + ] + +@dataclass +class SimulateTraceConfig: + """ + An object that configures simulation execution trace. +""" + def __init__(self, *, enable:typing.Optional[bool], stack_change:typing.Optional[bool], scratch_change:typing.Optional[bool], state_change:typing.Optional[bool]): + self.enable = enable + self.stack_change = stack_change + self.scratch_change = scratch_change + self.state_change = state_change + + + + + def __str__(self): + return "SimulateTraceConfig(enable={}, stack_change={}, scratch_change={}, state_change={})".format(self.enable, self.stack_change, self.scratch_change, self.state_change) + def __eq__(self, other): + if self.enable != other.enable: + return False + if self.stack_change != other.stack_change: + return False + if self.scratch_change != other.scratch_change: + return False + if self.state_change != other.state_change: + return False + return True + +class _UniffiFfiConverterTypeSimulateTraceConfig(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateTraceConfig( + enable=_UniffiFfiConverterOptionalBoolean.read(buf), + stack_change=_UniffiFfiConverterOptionalBoolean.read(buf), + scratch_change=_UniffiFfiConverterOptionalBoolean.read(buf), + state_change=_UniffiFfiConverterOptionalBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalBoolean.check_lower(value.enable) + _UniffiFfiConverterOptionalBoolean.check_lower(value.stack_change) + _UniffiFfiConverterOptionalBoolean.check_lower(value.scratch_change) + _UniffiFfiConverterOptionalBoolean.check_lower(value.state_change) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalBoolean.write(value.enable, buf) + _UniffiFfiConverterOptionalBoolean.write(value.stack_change, buf) + _UniffiFfiConverterOptionalBoolean.write(value.scratch_change, buf) + _UniffiFfiConverterOptionalBoolean.write(value.state_change, buf) + +class _UniffiFfiConverterOptionalTypeSimulateTraceConfig(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeSimulateTraceConfig.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeSimulateTraceConfig.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeSimulateTraceConfig.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulateRequest: + """ + Request type for simulation endpoint. +""" + def __init__(self, *, txn_groups:typing.List[SimulateRequestTransactionGroup], round:typing.Optional[int], allow_empty_signatures:typing.Optional[bool], allow_more_logging:typing.Optional[bool], allow_unnamed_resources:typing.Optional[bool], extra_opcode_budget:typing.Optional[int], exec_trace_config:typing.Optional[SimulateTraceConfig], fix_signers:typing.Optional[bool]): + self.txn_groups = txn_groups + self.round = round + self.allow_empty_signatures = allow_empty_signatures + self.allow_more_logging = allow_more_logging + self.allow_unnamed_resources = allow_unnamed_resources + self.extra_opcode_budget = extra_opcode_budget + self.exec_trace_config = exec_trace_config + self.fix_signers = fix_signers + + + + + def __str__(self): + return "SimulateRequest(txn_groups={}, round={}, allow_empty_signatures={}, allow_more_logging={}, allow_unnamed_resources={}, extra_opcode_budget={}, exec_trace_config={}, fix_signers={})".format(self.txn_groups, self.round, self.allow_empty_signatures, self.allow_more_logging, self.allow_unnamed_resources, self.extra_opcode_budget, self.exec_trace_config, self.fix_signers) + def __eq__(self, other): + if self.txn_groups != other.txn_groups: + return False + if self.round != other.round: + return False + if self.allow_empty_signatures != other.allow_empty_signatures: + return False + if self.allow_more_logging != other.allow_more_logging: + return False + if self.allow_unnamed_resources != other.allow_unnamed_resources: + return False + if self.extra_opcode_budget != other.extra_opcode_budget: + return False + if self.exec_trace_config != other.exec_trace_config: + return False + if self.fix_signers != other.fix_signers: + return False + return True + +class _UniffiFfiConverterTypeSimulateRequest(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateRequest( + txn_groups=_UniffiFfiConverterSequenceTypeSimulateRequestTransactionGroup.read(buf), + round=_UniffiFfiConverterOptionalUInt64.read(buf), + allow_empty_signatures=_UniffiFfiConverterOptionalBoolean.read(buf), + allow_more_logging=_UniffiFfiConverterOptionalBoolean.read(buf), + allow_unnamed_resources=_UniffiFfiConverterOptionalBoolean.read(buf), + extra_opcode_budget=_UniffiFfiConverterOptionalUInt64.read(buf), + exec_trace_config=_UniffiFfiConverterOptionalTypeSimulateTraceConfig.read(buf), + fix_signers=_UniffiFfiConverterOptionalBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeSimulateRequestTransactionGroup.check_lower(value.txn_groups) + _UniffiFfiConverterOptionalUInt64.check_lower(value.round) + _UniffiFfiConverterOptionalBoolean.check_lower(value.allow_empty_signatures) + _UniffiFfiConverterOptionalBoolean.check_lower(value.allow_more_logging) + _UniffiFfiConverterOptionalBoolean.check_lower(value.allow_unnamed_resources) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_opcode_budget) + _UniffiFfiConverterOptionalTypeSimulateTraceConfig.check_lower(value.exec_trace_config) + _UniffiFfiConverterOptionalBoolean.check_lower(value.fix_signers) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeSimulateRequestTransactionGroup.write(value.txn_groups, buf) + _UniffiFfiConverterOptionalUInt64.write(value.round, buf) + _UniffiFfiConverterOptionalBoolean.write(value.allow_empty_signatures, buf) + _UniffiFfiConverterOptionalBoolean.write(value.allow_more_logging, buf) + _UniffiFfiConverterOptionalBoolean.write(value.allow_unnamed_resources, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_opcode_budget, buf) + _UniffiFfiConverterOptionalTypeSimulateTraceConfig.write(value.exec_trace_config, buf) + _UniffiFfiConverterOptionalBoolean.write(value.fix_signers, buf) + +class _UniffiFfiConverterSequenceTypeScratchChange(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeScratchChange.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeScratchChange.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeScratchChange.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeScratchChange(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeScratchChange.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeScratchChange.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeScratchChange.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeApplicationStateOperation(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeApplicationStateOperation.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeApplicationStateOperation.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeApplicationStateOperation.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeApplicationStateOperation(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeApplicationStateOperation.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeApplicationStateOperation.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeApplicationStateOperation.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterUInt64.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterUInt64.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterUInt64.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeAvmValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAvmValue.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAvmValue.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAvmValue.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeAvmValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeAvmValue.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeAvmValue.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeAvmValue.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulationOpcodeTraceUnit: + """ + The set of trace information and effect from evaluating a single opcode. +""" + def __init__(self, *, pc:int, scratch_changes:typing.Optional[typing.List[ScratchChange]], state_changes:typing.Optional[typing.List[ApplicationStateOperation]], spawned_inners:typing.Optional[typing.List[int]], stack_pop_count:typing.Optional[int], stack_additions:typing.Optional[typing.List[AvmValue]]): + self.pc = pc + self.scratch_changes = scratch_changes + self.state_changes = state_changes + self.spawned_inners = spawned_inners + self.stack_pop_count = stack_pop_count + self.stack_additions = stack_additions + + + + + def __str__(self): + return "SimulationOpcodeTraceUnit(pc={}, scratch_changes={}, state_changes={}, spawned_inners={}, stack_pop_count={}, stack_additions={})".format(self.pc, self.scratch_changes, self.state_changes, self.spawned_inners, self.stack_pop_count, self.stack_additions) + def __eq__(self, other): + if self.pc != other.pc: + return False + if self.scratch_changes != other.scratch_changes: + return False + if self.state_changes != other.state_changes: + return False + if self.spawned_inners != other.spawned_inners: + return False + if self.stack_pop_count != other.stack_pop_count: + return False + if self.stack_additions != other.stack_additions: + return False + return True + +class _UniffiFfiConverterTypeSimulationOpcodeTraceUnit(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulationOpcodeTraceUnit( + pc=_UniffiFfiConverterUInt64.read(buf), + scratch_changes=_UniffiFfiConverterOptionalSequenceTypeScratchChange.read(buf), + state_changes=_UniffiFfiConverterOptionalSequenceTypeApplicationStateOperation.read(buf), + spawned_inners=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + stack_pop_count=_UniffiFfiConverterOptionalUInt64.read(buf), + stack_additions=_UniffiFfiConverterOptionalSequenceTypeAvmValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.pc) + _UniffiFfiConverterOptionalSequenceTypeScratchChange.check_lower(value.scratch_changes) + _UniffiFfiConverterOptionalSequenceTypeApplicationStateOperation.check_lower(value.state_changes) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.spawned_inners) + _UniffiFfiConverterOptionalUInt64.check_lower(value.stack_pop_count) + _UniffiFfiConverterOptionalSequenceTypeAvmValue.check_lower(value.stack_additions) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.pc, buf) + _UniffiFfiConverterOptionalSequenceTypeScratchChange.write(value.scratch_changes, buf) + _UniffiFfiConverterOptionalSequenceTypeApplicationStateOperation.write(value.state_changes, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.spawned_inners, buf) + _UniffiFfiConverterOptionalUInt64.write(value.stack_pop_count, buf) + _UniffiFfiConverterOptionalSequenceTypeAvmValue.write(value.stack_additions, buf) + +class _UniffiFfiConverterSequenceTypeSimulationOpcodeTraceUnit(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSimulationOpcodeTraceUnit.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSimulationOpcodeTraceUnit.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSimulationOpcodeTraceUnit.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeSimulationOpcodeTraceUnit.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeSimulationOpcodeTraceUnit.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeSimulationOpcodeTraceUnit.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeSimulationTransactionExecTrace(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSimulationTransactionExecTrace.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSimulationTransactionExecTrace.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSimulationTransactionExecTrace.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeSimulationTransactionExecTrace(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeSimulationTransactionExecTrace.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeSimulationTransactionExecTrace.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeSimulationTransactionExecTrace.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulationTransactionExecTrace: + """ + The execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way. +""" + def __init__(self, *, approval_program_trace:typing.Optional[typing.List[SimulationOpcodeTraceUnit]], approval_program_hash:typing.Optional[bytes], clear_state_program_trace:typing.Optional[typing.List[SimulationOpcodeTraceUnit]], clear_state_program_hash:typing.Optional[bytes], clear_state_rollback:typing.Optional[bool], clear_state_rollback_error:typing.Optional[str], logic_sig_trace:typing.Optional[typing.List[SimulationOpcodeTraceUnit]], logic_sig_hash:typing.Optional[bytes], inner_trace:typing.Optional[typing.List[SimulationTransactionExecTrace]]): + self.approval_program_trace = approval_program_trace + self.approval_program_hash = approval_program_hash + self.clear_state_program_trace = clear_state_program_trace + self.clear_state_program_hash = clear_state_program_hash + self.clear_state_rollback = clear_state_rollback + self.clear_state_rollback_error = clear_state_rollback_error + self.logic_sig_trace = logic_sig_trace + self.logic_sig_hash = logic_sig_hash + self.inner_trace = inner_trace + + + + + def __str__(self): + return "SimulationTransactionExecTrace(approval_program_trace={}, approval_program_hash={}, clear_state_program_trace={}, clear_state_program_hash={}, clear_state_rollback={}, clear_state_rollback_error={}, logic_sig_trace={}, logic_sig_hash={}, inner_trace={})".format(self.approval_program_trace, self.approval_program_hash, self.clear_state_program_trace, self.clear_state_program_hash, self.clear_state_rollback, self.clear_state_rollback_error, self.logic_sig_trace, self.logic_sig_hash, self.inner_trace) + def __eq__(self, other): + if self.approval_program_trace != other.approval_program_trace: + return False + if self.approval_program_hash != other.approval_program_hash: + return False + if self.clear_state_program_trace != other.clear_state_program_trace: + return False + if self.clear_state_program_hash != other.clear_state_program_hash: + return False + if self.clear_state_rollback != other.clear_state_rollback: + return False + if self.clear_state_rollback_error != other.clear_state_rollback_error: + return False + if self.logic_sig_trace != other.logic_sig_trace: + return False + if self.logic_sig_hash != other.logic_sig_hash: + return False + if self.inner_trace != other.inner_trace: + return False + return True + +class _UniffiFfiConverterTypeSimulationTransactionExecTrace(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulationTransactionExecTrace( + approval_program_trace=_UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.read(buf), + approval_program_hash=_UniffiFfiConverterOptionalBytes.read(buf), + clear_state_program_trace=_UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.read(buf), + clear_state_program_hash=_UniffiFfiConverterOptionalBytes.read(buf), + clear_state_rollback=_UniffiFfiConverterOptionalBoolean.read(buf), + clear_state_rollback_error=_UniffiFfiConverterOptionalString.read(buf), + logic_sig_trace=_UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.read(buf), + logic_sig_hash=_UniffiFfiConverterOptionalBytes.read(buf), + inner_trace=_UniffiFfiConverterOptionalSequenceTypeSimulationTransactionExecTrace.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.check_lower(value.approval_program_trace) + _UniffiFfiConverterOptionalBytes.check_lower(value.approval_program_hash) + _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.check_lower(value.clear_state_program_trace) + _UniffiFfiConverterOptionalBytes.check_lower(value.clear_state_program_hash) + _UniffiFfiConverterOptionalBoolean.check_lower(value.clear_state_rollback) + _UniffiFfiConverterOptionalString.check_lower(value.clear_state_rollback_error) + _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.check_lower(value.logic_sig_trace) + _UniffiFfiConverterOptionalBytes.check_lower(value.logic_sig_hash) + _UniffiFfiConverterOptionalSequenceTypeSimulationTransactionExecTrace.check_lower(value.inner_trace) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.write(value.approval_program_trace, buf) + _UniffiFfiConverterOptionalBytes.write(value.approval_program_hash, buf) + _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.write(value.clear_state_program_trace, buf) + _UniffiFfiConverterOptionalBytes.write(value.clear_state_program_hash, buf) + _UniffiFfiConverterOptionalBoolean.write(value.clear_state_rollback, buf) + _UniffiFfiConverterOptionalString.write(value.clear_state_rollback_error, buf) + _UniffiFfiConverterOptionalSequenceTypeSimulationOpcodeTraceUnit.write(value.logic_sig_trace, buf) + _UniffiFfiConverterOptionalBytes.write(value.logic_sig_hash, buf) + _UniffiFfiConverterOptionalSequenceTypeSimulationTransactionExecTrace.write(value.inner_trace, buf) + +class _UniffiFfiConverterOptionalTypeSimulationTransactionExecTrace(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeSimulationTransactionExecTrace.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeSimulationTransactionExecTrace.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeSimulationTransactionExecTrace.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeBoxReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeBoxReference.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeBoxReference.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeBoxReference.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeBoxReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeBoxReference.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeBoxReference.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeBoxReference.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeAssetHoldingReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAssetHoldingReference.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAssetHoldingReference.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAssetHoldingReference.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeAssetHoldingReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeAssetHoldingReference.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeAssetHoldingReference.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeAssetHoldingReference.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeApplicationLocalReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeApplicationLocalReference.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeApplicationLocalReference.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeApplicationLocalReference.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeApplicationLocalReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeApplicationLocalReference.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeApplicationLocalReference.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeApplicationLocalReference.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulateUnnamedResourcesAccessed: + """ + These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them. +""" + def __init__(self, *, accounts:typing.Optional[typing.List[str]], assets:typing.Optional[typing.List[int]], apps:typing.Optional[typing.List[int]], boxes:typing.Optional[typing.List[BoxReference]], extra_box_refs:typing.Optional[int], asset_holdings:typing.Optional[typing.List[AssetHoldingReference]], app_locals:typing.Optional[typing.List[ApplicationLocalReference]]): + self.accounts = accounts + self.assets = assets + self.apps = apps + self.boxes = boxes + self.extra_box_refs = extra_box_refs + self.asset_holdings = asset_holdings + self.app_locals = app_locals + + + + + def __str__(self): + return "SimulateUnnamedResourcesAccessed(accounts={}, assets={}, apps={}, boxes={}, extra_box_refs={}, asset_holdings={}, app_locals={})".format(self.accounts, self.assets, self.apps, self.boxes, self.extra_box_refs, self.asset_holdings, self.app_locals) + def __eq__(self, other): + if self.accounts != other.accounts: + return False + if self.assets != other.assets: + return False + if self.apps != other.apps: + return False + if self.boxes != other.boxes: + return False + if self.extra_box_refs != other.extra_box_refs: + return False + if self.asset_holdings != other.asset_holdings: + return False + if self.app_locals != other.app_locals: + return False + return True + +class _UniffiFfiConverterTypeSimulateUnnamedResourcesAccessed(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateUnnamedResourcesAccessed( + accounts=_UniffiFfiConverterOptionalSequenceString.read(buf), + assets=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + apps=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + boxes=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + extra_box_refs=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_holdings=_UniffiFfiConverterOptionalSequenceTypeAssetHoldingReference.read(buf), + app_locals=_UniffiFfiConverterOptionalSequenceTypeApplicationLocalReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalSequenceString.check_lower(value.accounts) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.assets) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.apps) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.boxes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_box_refs) + _UniffiFfiConverterOptionalSequenceTypeAssetHoldingReference.check_lower(value.asset_holdings) + _UniffiFfiConverterOptionalSequenceTypeApplicationLocalReference.check_lower(value.app_locals) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalSequenceString.write(value.accounts, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.assets, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.apps, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.boxes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_box_refs, buf) + _UniffiFfiConverterOptionalSequenceTypeAssetHoldingReference.write(value.asset_holdings, buf) + _UniffiFfiConverterOptionalSequenceTypeApplicationLocalReference.write(value.app_locals, buf) + +class _UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeSimulateUnnamedResourcesAccessed.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeSimulateUnnamedResourcesAccessed.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeSimulateUnnamedResourcesAccessed.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulateTransactionResult: + """ + Simulation result for an individual transaction +""" + def __init__(self, *, txn_result:PendingTransactionResponse, app_budget_consumed:typing.Optional[int], logic_sig_budget_consumed:typing.Optional[int], exec_trace:typing.Optional[SimulationTransactionExecTrace], unnamed_resources_accessed:typing.Optional[SimulateUnnamedResourcesAccessed], fixed_signer:typing.Optional[str]): + self.txn_result = txn_result + self.app_budget_consumed = app_budget_consumed + self.logic_sig_budget_consumed = logic_sig_budget_consumed + self.exec_trace = exec_trace + self.unnamed_resources_accessed = unnamed_resources_accessed + self.fixed_signer = fixed_signer + + + + + def __str__(self): + return "SimulateTransactionResult(txn_result={}, app_budget_consumed={}, logic_sig_budget_consumed={}, exec_trace={}, unnamed_resources_accessed={}, fixed_signer={})".format(self.txn_result, self.app_budget_consumed, self.logic_sig_budget_consumed, self.exec_trace, self.unnamed_resources_accessed, self.fixed_signer) + def __eq__(self, other): + if self.txn_result != other.txn_result: + return False + if self.app_budget_consumed != other.app_budget_consumed: + return False + if self.logic_sig_budget_consumed != other.logic_sig_budget_consumed: + return False + if self.exec_trace != other.exec_trace: + return False + if self.unnamed_resources_accessed != other.unnamed_resources_accessed: + return False + if self.fixed_signer != other.fixed_signer: + return False + return True + +class _UniffiFfiConverterTypeSimulateTransactionResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateTransactionResult( + txn_result=_UniffiFfiConverterTypePendingTransactionResponse.read(buf), + app_budget_consumed=_UniffiFfiConverterOptionalUInt32.read(buf), + logic_sig_budget_consumed=_UniffiFfiConverterOptionalUInt32.read(buf), + exec_trace=_UniffiFfiConverterOptionalTypeSimulationTransactionExecTrace.read(buf), + unnamed_resources_accessed=_UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed.read(buf), + fixed_signer=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypePendingTransactionResponse.check_lower(value.txn_result) + _UniffiFfiConverterOptionalUInt32.check_lower(value.app_budget_consumed) + _UniffiFfiConverterOptionalUInt32.check_lower(value.logic_sig_budget_consumed) + _UniffiFfiConverterOptionalTypeSimulationTransactionExecTrace.check_lower(value.exec_trace) + _UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed.check_lower(value.unnamed_resources_accessed) + _UniffiFfiConverterOptionalString.check_lower(value.fixed_signer) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypePendingTransactionResponse.write(value.txn_result, buf) + _UniffiFfiConverterOptionalUInt32.write(value.app_budget_consumed, buf) + _UniffiFfiConverterOptionalUInt32.write(value.logic_sig_budget_consumed, buf) + _UniffiFfiConverterOptionalTypeSimulationTransactionExecTrace.write(value.exec_trace, buf) + _UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed.write(value.unnamed_resources_accessed, buf) + _UniffiFfiConverterOptionalString.write(value.fixed_signer, buf) + +class _UniffiFfiConverterSequenceTypeSimulateTransactionResult(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSimulateTransactionResult.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSimulateTransactionResult.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSimulateTransactionResult.read(buf) for i in range(count) + ] + +@dataclass +class SimulateTransactionGroupResult: + """ + Simulation result for an atomic transaction group +""" + def __init__(self, *, txn_results:typing.List[SimulateTransactionResult], failure_message:typing.Optional[str], failed_at:typing.Optional[typing.List[int]], app_budget_added:typing.Optional[int], app_budget_consumed:typing.Optional[int], unnamed_resources_accessed:typing.Optional[SimulateUnnamedResourcesAccessed]): + self.txn_results = txn_results + self.failure_message = failure_message + self.failed_at = failed_at + self.app_budget_added = app_budget_added + self.app_budget_consumed = app_budget_consumed + self.unnamed_resources_accessed = unnamed_resources_accessed + + + + + def __str__(self): + return "SimulateTransactionGroupResult(txn_results={}, failure_message={}, failed_at={}, app_budget_added={}, app_budget_consumed={}, unnamed_resources_accessed={})".format(self.txn_results, self.failure_message, self.failed_at, self.app_budget_added, self.app_budget_consumed, self.unnamed_resources_accessed) + def __eq__(self, other): + if self.txn_results != other.txn_results: + return False + if self.failure_message != other.failure_message: + return False + if self.failed_at != other.failed_at: + return False + if self.app_budget_added != other.app_budget_added: + return False + if self.app_budget_consumed != other.app_budget_consumed: + return False + if self.unnamed_resources_accessed != other.unnamed_resources_accessed: + return False + return True + +class _UniffiFfiConverterTypeSimulateTransactionGroupResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateTransactionGroupResult( + txn_results=_UniffiFfiConverterSequenceTypeSimulateTransactionResult.read(buf), + failure_message=_UniffiFfiConverterOptionalString.read(buf), + failed_at=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + app_budget_added=_UniffiFfiConverterOptionalUInt64.read(buf), + app_budget_consumed=_UniffiFfiConverterOptionalUInt64.read(buf), + unnamed_resources_accessed=_UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeSimulateTransactionResult.check_lower(value.txn_results) + _UniffiFfiConverterOptionalString.check_lower(value.failure_message) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.failed_at) + _UniffiFfiConverterOptionalUInt64.check_lower(value.app_budget_added) + _UniffiFfiConverterOptionalUInt64.check_lower(value.app_budget_consumed) + _UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed.check_lower(value.unnamed_resources_accessed) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeSimulateTransactionResult.write(value.txn_results, buf) + _UniffiFfiConverterOptionalString.write(value.failure_message, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.failed_at, buf) + _UniffiFfiConverterOptionalUInt64.write(value.app_budget_added, buf) + _UniffiFfiConverterOptionalUInt64.write(value.app_budget_consumed, buf) + _UniffiFfiConverterOptionalTypeSimulateUnnamedResourcesAccessed.write(value.unnamed_resources_accessed, buf) + +class _UniffiFfiConverterSequenceTypeSimulateTransactionGroupResult(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSimulateTransactionGroupResult.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSimulateTransactionGroupResult.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSimulateTransactionGroupResult.read(buf) for i in range(count) + ] + +@dataclass +class SimulationEvalOverrides: + """ + The set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways. +""" + def __init__(self, *, allow_empty_signatures:typing.Optional[bool], allow_unnamed_resources:typing.Optional[bool], max_log_calls:typing.Optional[int], max_log_size:typing.Optional[int], extra_opcode_budget:typing.Optional[int], fix_signers:typing.Optional[bool]): + self.allow_empty_signatures = allow_empty_signatures + self.allow_unnamed_resources = allow_unnamed_resources + self.max_log_calls = max_log_calls + self.max_log_size = max_log_size + self.extra_opcode_budget = extra_opcode_budget + self.fix_signers = fix_signers + + + + + def __str__(self): + return "SimulationEvalOverrides(allow_empty_signatures={}, allow_unnamed_resources={}, max_log_calls={}, max_log_size={}, extra_opcode_budget={}, fix_signers={})".format(self.allow_empty_signatures, self.allow_unnamed_resources, self.max_log_calls, self.max_log_size, self.extra_opcode_budget, self.fix_signers) + def __eq__(self, other): + if self.allow_empty_signatures != other.allow_empty_signatures: + return False + if self.allow_unnamed_resources != other.allow_unnamed_resources: + return False + if self.max_log_calls != other.max_log_calls: + return False + if self.max_log_size != other.max_log_size: + return False + if self.extra_opcode_budget != other.extra_opcode_budget: + return False + if self.fix_signers != other.fix_signers: + return False + return True + +class _UniffiFfiConverterTypeSimulationEvalOverrides(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulationEvalOverrides( + allow_empty_signatures=_UniffiFfiConverterOptionalBoolean.read(buf), + allow_unnamed_resources=_UniffiFfiConverterOptionalBoolean.read(buf), + max_log_calls=_UniffiFfiConverterOptionalUInt64.read(buf), + max_log_size=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_opcode_budget=_UniffiFfiConverterOptionalUInt64.read(buf), + fix_signers=_UniffiFfiConverterOptionalBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalBoolean.check_lower(value.allow_empty_signatures) + _UniffiFfiConverterOptionalBoolean.check_lower(value.allow_unnamed_resources) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_log_calls) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_log_size) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_opcode_budget) + _UniffiFfiConverterOptionalBoolean.check_lower(value.fix_signers) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalBoolean.write(value.allow_empty_signatures, buf) + _UniffiFfiConverterOptionalBoolean.write(value.allow_unnamed_resources, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_log_calls, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_log_size, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_opcode_budget, buf) + _UniffiFfiConverterOptionalBoolean.write(value.fix_signers, buf) + +class _UniffiFfiConverterOptionalTypeSimulationEvalOverrides(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeSimulationEvalOverrides.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeSimulationEvalOverrides.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeSimulationEvalOverrides.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeSimulateInitialStates(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeSimulateInitialStates.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeSimulateInitialStates.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeSimulateInitialStates.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SimulateTransaction: + """ + Result of a transaction group simulation. +""" + def __init__(self, *, version:int, last_round:int, txn_groups:typing.List[SimulateTransactionGroupResult], eval_overrides:typing.Optional[SimulationEvalOverrides], exec_trace_config:typing.Optional[SimulateTraceConfig], initial_states:typing.Optional[SimulateInitialStates]): + self.version = version + self.last_round = last_round + self.txn_groups = txn_groups + self.eval_overrides = eval_overrides + self.exec_trace_config = exec_trace_config + self.initial_states = initial_states + + + + + def __str__(self): + return "SimulateTransaction(version={}, last_round={}, txn_groups={}, eval_overrides={}, exec_trace_config={}, initial_states={})".format(self.version, self.last_round, self.txn_groups, self.eval_overrides, self.exec_trace_config, self.initial_states) + def __eq__(self, other): + if self.version != other.version: + return False + if self.last_round != other.last_round: + return False + if self.txn_groups != other.txn_groups: + return False + if self.eval_overrides != other.eval_overrides: + return False + if self.exec_trace_config != other.exec_trace_config: + return False + if self.initial_states != other.initial_states: + return False + return True + +class _UniffiFfiConverterTypeSimulateTransaction(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SimulateTransaction( + version=_UniffiFfiConverterUInt64.read(buf), + last_round=_UniffiFfiConverterUInt64.read(buf), + txn_groups=_UniffiFfiConverterSequenceTypeSimulateTransactionGroupResult.read(buf), + eval_overrides=_UniffiFfiConverterOptionalTypeSimulationEvalOverrides.read(buf), + exec_trace_config=_UniffiFfiConverterOptionalTypeSimulateTraceConfig.read(buf), + initial_states=_UniffiFfiConverterOptionalTypeSimulateInitialStates.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.version) + _UniffiFfiConverterUInt64.check_lower(value.last_round) + _UniffiFfiConverterSequenceTypeSimulateTransactionGroupResult.check_lower(value.txn_groups) + _UniffiFfiConverterOptionalTypeSimulationEvalOverrides.check_lower(value.eval_overrides) + _UniffiFfiConverterOptionalTypeSimulateTraceConfig.check_lower(value.exec_trace_config) + _UniffiFfiConverterOptionalTypeSimulateInitialStates.check_lower(value.initial_states) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.version, buf) + _UniffiFfiConverterUInt64.write(value.last_round, buf) + _UniffiFfiConverterSequenceTypeSimulateTransactionGroupResult.write(value.txn_groups, buf) + _UniffiFfiConverterOptionalTypeSimulationEvalOverrides.write(value.eval_overrides, buf) + _UniffiFfiConverterOptionalTypeSimulateTraceConfig.write(value.exec_trace_config, buf) + _UniffiFfiConverterOptionalTypeSimulateInitialStates.write(value.initial_states, buf) + +@dataclass +class StartCatchup: + """ + An catchpoint start response. +""" + def __init__(self, *, catchup_message:str): + self.catchup_message = catchup_message + + + + + def __str__(self): + return "StartCatchup(catchup_message={})".format(self.catchup_message) + def __eq__(self, other): + if self.catchup_message != other.catchup_message: + return False + return True + +class _UniffiFfiConverterTypeStartCatchup(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StartCatchup( + catchup_message=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.catchup_message) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.catchup_message, buf) + +@dataclass +class StateProofMessage: + """ + Represents the message that the state proofs are attesting to. +""" + def __init__(self, *, block_headers_commitment:bytes, voters_commitment:bytes, ln_proven_weight:int, first_attested_round:int, last_attested_round:int): + self.block_headers_commitment = block_headers_commitment + self.voters_commitment = voters_commitment + self.ln_proven_weight = ln_proven_weight + self.first_attested_round = first_attested_round + self.last_attested_round = last_attested_round + + + + + def __str__(self): + return "StateProofMessage(block_headers_commitment={}, voters_commitment={}, ln_proven_weight={}, first_attested_round={}, last_attested_round={})".format(self.block_headers_commitment, self.voters_commitment, self.ln_proven_weight, self.first_attested_round, self.last_attested_round) + def __eq__(self, other): + if self.block_headers_commitment != other.block_headers_commitment: + return False + if self.voters_commitment != other.voters_commitment: + return False + if self.ln_proven_weight != other.ln_proven_weight: + return False + if self.first_attested_round != other.first_attested_round: + return False + if self.last_attested_round != other.last_attested_round: + return False + return True + +class _UniffiFfiConverterTypeStateProofMessage(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StateProofMessage( + block_headers_commitment=_UniffiFfiConverterBytes.read(buf), + voters_commitment=_UniffiFfiConverterBytes.read(buf), + ln_proven_weight=_UniffiFfiConverterUInt64.read(buf), + first_attested_round=_UniffiFfiConverterUInt64.read(buf), + last_attested_round=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.block_headers_commitment) + _UniffiFfiConverterBytes.check_lower(value.voters_commitment) + _UniffiFfiConverterUInt64.check_lower(value.ln_proven_weight) + _UniffiFfiConverterUInt64.check_lower(value.first_attested_round) + _UniffiFfiConverterUInt64.check_lower(value.last_attested_round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.block_headers_commitment, buf) + _UniffiFfiConverterBytes.write(value.voters_commitment, buf) + _UniffiFfiConverterUInt64.write(value.ln_proven_weight, buf) + _UniffiFfiConverterUInt64.write(value.first_attested_round, buf) + _UniffiFfiConverterUInt64.write(value.last_attested_round, buf) + +@dataclass +class StateProof: + """ + Represents a state proof and its corresponding message +""" + def __init__(self, *, message:StateProofMessage, state_proof:bytes): + self.message = message + self.state_proof = state_proof + + + + + def __str__(self): + return "StateProof(message={}, state_proof={})".format(self.message, self.state_proof) + def __eq__(self, other): + if self.message != other.message: + return False + if self.state_proof != other.state_proof: + return False + return True + +class _UniffiFfiConverterTypeStateProof(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StateProof( + message=_UniffiFfiConverterTypeStateProofMessage.read(buf), + state_proof=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeStateProofMessage.check_lower(value.message) + _UniffiFfiConverterBytes.check_lower(value.state_proof) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeStateProofMessage.write(value.message, buf) + _UniffiFfiConverterBytes.write(value.state_proof, buf) + +@dataclass +class TealCompile: + """ + Teal compile Result +""" + def __init__(self, *, hash:str, result:bytes, sourcemap:typing.Optional[UnknownJsonValue]): + self.hash = hash + self.result = result + self.sourcemap = sourcemap + + + + + def __str__(self): + return "TealCompile(hash={}, result={}, sourcemap={})".format(self.hash, self.result, self.sourcemap) + def __eq__(self, other): + if self.hash != other.hash: + return False + if self.result != other.result: + return False + if self.sourcemap != other.sourcemap: + return False + return True + +class _UniffiFfiConverterTypeTealCompile(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TealCompile( + hash=_UniffiFfiConverterString.read(buf), + result=_UniffiFfiConverterBytes.read(buf), + sourcemap=_UniffiFfiConverterOptionalTypeUnknownJsonValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.hash) + _UniffiFfiConverterBytes.check_lower(value.result) + _UniffiFfiConverterOptionalTypeUnknownJsonValue.check_lower(value.sourcemap) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.hash, buf) + _UniffiFfiConverterBytes.write(value.result, buf) + _UniffiFfiConverterOptionalTypeUnknownJsonValue.write(value.sourcemap, buf) + +@dataclass +class TealDisassemble: + """ + Teal disassembly Result +""" + def __init__(self, *, result:str): + self.result = result + + + + + def __str__(self): + return "TealDisassemble(result={})".format(self.result) + def __eq__(self, other): + if self.result != other.result: + return False + return True + +class _UniffiFfiConverterTypeTealDisassemble(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TealDisassemble( + result=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.result) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.result, buf) + +class _UniffiFfiConverterSequenceTypeDryrunTxnResult(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeDryrunTxnResult.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeDryrunTxnResult.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeDryrunTxnResult.read(buf) for i in range(count) + ] + +@dataclass +class TealDryrun: + """ + DryrunResponse contains per-txn debug information from a dryrun. +""" + def __init__(self, *, txns:typing.List[DryrunTxnResult], error:str, protocol_version:str): + self.txns = txns + self.error = error + self.protocol_version = protocol_version + + + + + def __str__(self): + return "TealDryrun(txns={}, error={}, protocol_version={})".format(self.txns, self.error, self.protocol_version) + def __eq__(self, other): + if self.txns != other.txns: + return False + if self.error != other.error: + return False + if self.protocol_version != other.protocol_version: + return False + return True + +class _UniffiFfiConverterTypeTealDryrun(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TealDryrun( + txns=_UniffiFfiConverterSequenceTypeDryrunTxnResult.read(buf), + error=_UniffiFfiConverterString.read(buf), + protocol_version=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceTypeDryrunTxnResult.check_lower(value.txns) + _UniffiFfiConverterString.check_lower(value.error) + _UniffiFfiConverterString.check_lower(value.protocol_version) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceTypeDryrunTxnResult.write(value.txns, buf) + _UniffiFfiConverterString.write(value.error, buf) + _UniffiFfiConverterString.write(value.protocol_version, buf) + +@dataclass +class TransactionParams: + """ + TransactionParams contains the parameters that help a client construct + a new transaction. +""" + def __init__(self, *, consensus_version:str, fee:int, genesis_hash:bytes, genesis_id:str, last_round:int, min_fee:int): + self.consensus_version = consensus_version + self.fee = fee + self.genesis_hash = genesis_hash + self.genesis_id = genesis_id + self.last_round = last_round + self.min_fee = min_fee + + + + + def __str__(self): + return "TransactionParams(consensus_version={}, fee={}, genesis_hash={}, genesis_id={}, last_round={}, min_fee={})".format(self.consensus_version, self.fee, self.genesis_hash, self.genesis_id, self.last_round, self.min_fee) + def __eq__(self, other): + if self.consensus_version != other.consensus_version: + return False + if self.fee != other.fee: + return False + if self.genesis_hash != other.genesis_hash: + return False + if self.genesis_id != other.genesis_id: + return False + if self.last_round != other.last_round: + return False + if self.min_fee != other.min_fee: + return False + return True + +class _UniffiFfiConverterTypeTransactionParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionParams( + consensus_version=_UniffiFfiConverterString.read(buf), + fee=_UniffiFfiConverterUInt64.read(buf), + genesis_hash=_UniffiFfiConverterBytes.read(buf), + genesis_id=_UniffiFfiConverterString.read(buf), + last_round=_UniffiFfiConverterUInt64.read(buf), + min_fee=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.consensus_version) + _UniffiFfiConverterUInt64.check_lower(value.fee) + _UniffiFfiConverterBytes.check_lower(value.genesis_hash) + _UniffiFfiConverterString.check_lower(value.genesis_id) + _UniffiFfiConverterUInt64.check_lower(value.last_round) + _UniffiFfiConverterUInt64.check_lower(value.min_fee) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.consensus_version, buf) + _UniffiFfiConverterUInt64.write(value.fee, buf) + _UniffiFfiConverterBytes.write(value.genesis_hash, buf) + _UniffiFfiConverterString.write(value.genesis_id, buf) + _UniffiFfiConverterUInt64.write(value.last_round, buf) + _UniffiFfiConverterUInt64.write(value.min_fee, buf) + +@dataclass +class TransactionProof: + """ + Proof of transaction in a block. +""" + def __init__(self, *, proof:bytes, stibhash:bytes, treedepth:int, idx:int, hashtype:str): + self.proof = proof + self.stibhash = stibhash + self.treedepth = treedepth + self.idx = idx + self.hashtype = hashtype + + + + + def __str__(self): + return "TransactionProof(proof={}, stibhash={}, treedepth={}, idx={}, hashtype={})".format(self.proof, self.stibhash, self.treedepth, self.idx, self.hashtype) + def __eq__(self, other): + if self.proof != other.proof: + return False + if self.stibhash != other.stibhash: + return False + if self.treedepth != other.treedepth: + return False + if self.idx != other.idx: + return False + if self.hashtype != other.hashtype: + return False + return True + +class _UniffiFfiConverterTypeTransactionProof(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionProof( + proof=_UniffiFfiConverterBytes.read(buf), + stibhash=_UniffiFfiConverterBytes.read(buf), + treedepth=_UniffiFfiConverterUInt64.read(buf), + idx=_UniffiFfiConverterUInt64.read(buf), + hashtype=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.proof) + _UniffiFfiConverterBytes.check_lower(value.stibhash) + _UniffiFfiConverterUInt64.check_lower(value.treedepth) + _UniffiFfiConverterUInt64.check_lower(value.idx) + _UniffiFfiConverterString.check_lower(value.hashtype) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.proof, buf) + _UniffiFfiConverterBytes.write(value.stibhash, buf) + _UniffiFfiConverterUInt64.write(value.treedepth, buf) + _UniffiFfiConverterUInt64.write(value.idx, buf) + _UniffiFfiConverterString.write(value.hashtype, buf) + +@dataclass +class Version: + """ + algod version information. +""" + def __init__(self, *, build:BuildVersion, genesis_hash_b64:bytes, genesis_id:str, versions:typing.List[str]): + self.build = build + self.genesis_hash_b64 = genesis_hash_b64 + self.genesis_id = genesis_id + self.versions = versions + + + + + def __str__(self): + return "Version(build={}, genesis_hash_b64={}, genesis_id={}, versions={})".format(self.build, self.genesis_hash_b64, self.genesis_id, self.versions) + def __eq__(self, other): + if self.build != other.build: + return False + if self.genesis_hash_b64 != other.genesis_hash_b64: + return False + if self.genesis_id != other.genesis_id: + return False + if self.versions != other.versions: + return False + return True + +class _UniffiFfiConverterTypeVersion(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Version( + build=_UniffiFfiConverterTypeBuildVersion.read(buf), + genesis_hash_b64=_UniffiFfiConverterBytes.read(buf), + genesis_id=_UniffiFfiConverterString.read(buf), + versions=_UniffiFfiConverterSequenceString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeBuildVersion.check_lower(value.build) + _UniffiFfiConverterBytes.check_lower(value.genesis_hash_b64) + _UniffiFfiConverterString.check_lower(value.genesis_id) + _UniffiFfiConverterSequenceString.check_lower(value.versions) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeBuildVersion.write(value.build, buf) + _UniffiFfiConverterBytes.write(value.genesis_hash_b64, buf) + _UniffiFfiConverterString.write(value.genesis_id, buf) + _UniffiFfiConverterSequenceString.write(value.versions, buf) + +@dataclass +class WaitForBlock: + """ + NodeStatus contains the information about a node status +""" + def __init__(self, *, catchup_time:int, last_round:int, last_version:str, next_version:str, next_version_round:int, next_version_supported:bool, stopped_at_unsupported_round:bool, time_since_last_round:int, last_catchpoint:typing.Optional[str], catchpoint:typing.Optional[str], catchpoint_total_accounts:typing.Optional[int], catchpoint_processed_accounts:typing.Optional[int], catchpoint_verified_accounts:typing.Optional[int], catchpoint_total_kvs:typing.Optional[int], catchpoint_processed_kvs:typing.Optional[int], catchpoint_verified_kvs:typing.Optional[int], catchpoint_total_blocks:typing.Optional[int], catchpoint_acquired_blocks:typing.Optional[int], upgrade_delay:typing.Optional[int], upgrade_node_vote:typing.Optional[bool], upgrade_votes_required:typing.Optional[int], upgrade_votes:typing.Optional[int], upgrade_yes_votes:typing.Optional[int], upgrade_no_votes:typing.Optional[int], upgrade_next_protocol_vote_before:typing.Optional[int], upgrade_vote_rounds:typing.Optional[int]): + self.catchup_time = catchup_time + self.last_round = last_round + self.last_version = last_version + self.next_version = next_version + self.next_version_round = next_version_round + self.next_version_supported = next_version_supported + self.stopped_at_unsupported_round = stopped_at_unsupported_round + self.time_since_last_round = time_since_last_round + self.last_catchpoint = last_catchpoint + self.catchpoint = catchpoint + self.catchpoint_total_accounts = catchpoint_total_accounts + self.catchpoint_processed_accounts = catchpoint_processed_accounts + self.catchpoint_verified_accounts = catchpoint_verified_accounts + self.catchpoint_total_kvs = catchpoint_total_kvs + self.catchpoint_processed_kvs = catchpoint_processed_kvs + self.catchpoint_verified_kvs = catchpoint_verified_kvs + self.catchpoint_total_blocks = catchpoint_total_blocks + self.catchpoint_acquired_blocks = catchpoint_acquired_blocks + self.upgrade_delay = upgrade_delay + self.upgrade_node_vote = upgrade_node_vote + self.upgrade_votes_required = upgrade_votes_required + self.upgrade_votes = upgrade_votes + self.upgrade_yes_votes = upgrade_yes_votes + self.upgrade_no_votes = upgrade_no_votes + self.upgrade_next_protocol_vote_before = upgrade_next_protocol_vote_before + self.upgrade_vote_rounds = upgrade_vote_rounds + + + + + def __str__(self): + return "WaitForBlock(catchup_time={}, last_round={}, last_version={}, next_version={}, next_version_round={}, next_version_supported={}, stopped_at_unsupported_round={}, time_since_last_round={}, last_catchpoint={}, catchpoint={}, catchpoint_total_accounts={}, catchpoint_processed_accounts={}, catchpoint_verified_accounts={}, catchpoint_total_kvs={}, catchpoint_processed_kvs={}, catchpoint_verified_kvs={}, catchpoint_total_blocks={}, catchpoint_acquired_blocks={}, upgrade_delay={}, upgrade_node_vote={}, upgrade_votes_required={}, upgrade_votes={}, upgrade_yes_votes={}, upgrade_no_votes={}, upgrade_next_protocol_vote_before={}, upgrade_vote_rounds={})".format(self.catchup_time, self.last_round, self.last_version, self.next_version, self.next_version_round, self.next_version_supported, self.stopped_at_unsupported_round, self.time_since_last_round, self.last_catchpoint, self.catchpoint, self.catchpoint_total_accounts, self.catchpoint_processed_accounts, self.catchpoint_verified_accounts, self.catchpoint_total_kvs, self.catchpoint_processed_kvs, self.catchpoint_verified_kvs, self.catchpoint_total_blocks, self.catchpoint_acquired_blocks, self.upgrade_delay, self.upgrade_node_vote, self.upgrade_votes_required, self.upgrade_votes, self.upgrade_yes_votes, self.upgrade_no_votes, self.upgrade_next_protocol_vote_before, self.upgrade_vote_rounds) + def __eq__(self, other): + if self.catchup_time != other.catchup_time: + return False + if self.last_round != other.last_round: + return False + if self.last_version != other.last_version: + return False + if self.next_version != other.next_version: + return False + if self.next_version_round != other.next_version_round: + return False + if self.next_version_supported != other.next_version_supported: + return False + if self.stopped_at_unsupported_round != other.stopped_at_unsupported_round: + return False + if self.time_since_last_round != other.time_since_last_round: + return False + if self.last_catchpoint != other.last_catchpoint: + return False + if self.catchpoint != other.catchpoint: + return False + if self.catchpoint_total_accounts != other.catchpoint_total_accounts: + return False + if self.catchpoint_processed_accounts != other.catchpoint_processed_accounts: + return False + if self.catchpoint_verified_accounts != other.catchpoint_verified_accounts: + return False + if self.catchpoint_total_kvs != other.catchpoint_total_kvs: + return False + if self.catchpoint_processed_kvs != other.catchpoint_processed_kvs: + return False + if self.catchpoint_verified_kvs != other.catchpoint_verified_kvs: + return False + if self.catchpoint_total_blocks != other.catchpoint_total_blocks: + return False + if self.catchpoint_acquired_blocks != other.catchpoint_acquired_blocks: + return False + if self.upgrade_delay != other.upgrade_delay: + return False + if self.upgrade_node_vote != other.upgrade_node_vote: + return False + if self.upgrade_votes_required != other.upgrade_votes_required: + return False + if self.upgrade_votes != other.upgrade_votes: + return False + if self.upgrade_yes_votes != other.upgrade_yes_votes: + return False + if self.upgrade_no_votes != other.upgrade_no_votes: + return False + if self.upgrade_next_protocol_vote_before != other.upgrade_next_protocol_vote_before: + return False + if self.upgrade_vote_rounds != other.upgrade_vote_rounds: + return False + return True + +class _UniffiFfiConverterTypeWaitForBlock(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return WaitForBlock( + catchup_time=_UniffiFfiConverterUInt64.read(buf), + last_round=_UniffiFfiConverterUInt64.read(buf), + last_version=_UniffiFfiConverterString.read(buf), + next_version=_UniffiFfiConverterString.read(buf), + next_version_round=_UniffiFfiConverterUInt64.read(buf), + next_version_supported=_UniffiFfiConverterBoolean.read(buf), + stopped_at_unsupported_round=_UniffiFfiConverterBoolean.read(buf), + time_since_last_round=_UniffiFfiConverterUInt64.read(buf), + last_catchpoint=_UniffiFfiConverterOptionalString.read(buf), + catchpoint=_UniffiFfiConverterOptionalString.read(buf), + catchpoint_total_accounts=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_processed_accounts=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_verified_accounts=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_total_kvs=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_processed_kvs=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_verified_kvs=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_total_blocks=_UniffiFfiConverterOptionalUInt64.read(buf), + catchpoint_acquired_blocks=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_delay=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_node_vote=_UniffiFfiConverterOptionalBoolean.read(buf), + upgrade_votes_required=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_votes=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_yes_votes=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_no_votes=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_next_protocol_vote_before=_UniffiFfiConverterOptionalUInt64.read(buf), + upgrade_vote_rounds=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.catchup_time) + _UniffiFfiConverterUInt64.check_lower(value.last_round) + _UniffiFfiConverterString.check_lower(value.last_version) + _UniffiFfiConverterString.check_lower(value.next_version) + _UniffiFfiConverterUInt64.check_lower(value.next_version_round) + _UniffiFfiConverterBoolean.check_lower(value.next_version_supported) + _UniffiFfiConverterBoolean.check_lower(value.stopped_at_unsupported_round) + _UniffiFfiConverterUInt64.check_lower(value.time_since_last_round) + _UniffiFfiConverterOptionalString.check_lower(value.last_catchpoint) + _UniffiFfiConverterOptionalString.check_lower(value.catchpoint) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_total_accounts) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_processed_accounts) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_verified_accounts) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_total_kvs) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_processed_kvs) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_verified_kvs) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_total_blocks) + _UniffiFfiConverterOptionalUInt64.check_lower(value.catchpoint_acquired_blocks) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_delay) + _UniffiFfiConverterOptionalBoolean.check_lower(value.upgrade_node_vote) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_votes_required) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_votes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_yes_votes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_no_votes) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_next_protocol_vote_before) + _UniffiFfiConverterOptionalUInt64.check_lower(value.upgrade_vote_rounds) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.catchup_time, buf) + _UniffiFfiConverterUInt64.write(value.last_round, buf) + _UniffiFfiConverterString.write(value.last_version, buf) + _UniffiFfiConverterString.write(value.next_version, buf) + _UniffiFfiConverterUInt64.write(value.next_version_round, buf) + _UniffiFfiConverterBoolean.write(value.next_version_supported, buf) + _UniffiFfiConverterBoolean.write(value.stopped_at_unsupported_round, buf) + _UniffiFfiConverterUInt64.write(value.time_since_last_round, buf) + _UniffiFfiConverterOptionalString.write(value.last_catchpoint, buf) + _UniffiFfiConverterOptionalString.write(value.catchpoint, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_total_accounts, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_processed_accounts, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_verified_accounts, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_total_kvs, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_processed_kvs, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_verified_kvs, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_total_blocks, buf) + _UniffiFfiConverterOptionalUInt64.write(value.catchpoint_acquired_blocks, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_delay, buf) + _UniffiFfiConverterOptionalBoolean.write(value.upgrade_node_vote, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_votes_required, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_votes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_yes_votes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_no_votes, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_next_protocol_vote_before, buf) + _UniffiFfiConverterOptionalUInt64.write(value.upgrade_vote_rounds, buf) + + + +# AbortCatchupError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AbortCatchupError(Exception): + """ + struct for typed errors of method [`abort_catchup`] +""" + pass + +_UniffiTempAbortCatchupError = AbortCatchupError + +class AbortCatchupError: # type: ignore + """ + struct for typed errors of method [`abort_catchup`] +""" + + class Status400(_UniffiTempAbortCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AbortCatchupError.Status400({})".format(str(self)) + _UniffiTempAbortCatchupError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAbortCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AbortCatchupError.Status401({})".format(str(self)) + _UniffiTempAbortCatchupError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempAbortCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AbortCatchupError.Status500({})".format(str(self)) + _UniffiTempAbortCatchupError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempAbortCatchupError): + + def __init__(self): + pass + + def __repr__(self): + return "AbortCatchupError.Statusdefault({})".format(str(self)) + _UniffiTempAbortCatchupError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAbortCatchupError): + + def __init__(self): + pass + + def __repr__(self): + return "AbortCatchupError.DefaultResponse({})".format(str(self)) + _UniffiTempAbortCatchupError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAbortCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AbortCatchupError.UnknownValue({})".format(str(self)) + _UniffiTempAbortCatchupError.UnknownValue = UnknownValue # type: ignore + +AbortCatchupError = _UniffiTempAbortCatchupError # type: ignore +del _UniffiTempAbortCatchupError + + +class _UniffiFfiConverterTypeAbortCatchupError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AbortCatchupError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AbortCatchupError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AbortCatchupError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AbortCatchupError.Statusdefault( + ) + if variant == 5: + return AbortCatchupError.DefaultResponse( + ) + if variant == 6: + return AbortCatchupError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AbortCatchupError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AbortCatchupError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AbortCatchupError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AbortCatchupError.Statusdefault): + return + if isinstance(value, AbortCatchupError.DefaultResponse): + return + if isinstance(value, AbortCatchupError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AbortCatchupError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AbortCatchupError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AbortCatchupError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AbortCatchupError.Statusdefault): + buf.write_i32(4) + if isinstance(value, AbortCatchupError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, AbortCatchupError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AccountApplicationInformationError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AccountApplicationInformationError(Exception): + """ + struct for typed errors of method [`account_application_information`] +""" + pass + +_UniffiTempAccountApplicationInformationError = AccountApplicationInformationError + +class AccountApplicationInformationError: # type: ignore + """ + struct for typed errors of method [`account_application_information`] +""" + + class Status400(_UniffiTempAccountApplicationInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountApplicationInformationError.Status400({})".format(str(self)) + _UniffiTempAccountApplicationInformationError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAccountApplicationInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountApplicationInformationError.Status401({})".format(str(self)) + _UniffiTempAccountApplicationInformationError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempAccountApplicationInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountApplicationInformationError.Status500({})".format(str(self)) + _UniffiTempAccountApplicationInformationError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempAccountApplicationInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountApplicationInformationError.Statusdefault({})".format(str(self)) + _UniffiTempAccountApplicationInformationError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAccountApplicationInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountApplicationInformationError.DefaultResponse({})".format(str(self)) + _UniffiTempAccountApplicationInformationError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAccountApplicationInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountApplicationInformationError.UnknownValue({})".format(str(self)) + _UniffiTempAccountApplicationInformationError.UnknownValue = UnknownValue # type: ignore + +AccountApplicationInformationError = _UniffiTempAccountApplicationInformationError # type: ignore +del _UniffiTempAccountApplicationInformationError + + +class _UniffiFfiConverterTypeAccountApplicationInformationError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AccountApplicationInformationError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AccountApplicationInformationError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AccountApplicationInformationError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AccountApplicationInformationError.Statusdefault( + ) + if variant == 5: + return AccountApplicationInformationError.DefaultResponse( + ) + if variant == 6: + return AccountApplicationInformationError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AccountApplicationInformationError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountApplicationInformationError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountApplicationInformationError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountApplicationInformationError.Statusdefault): + return + if isinstance(value, AccountApplicationInformationError.DefaultResponse): + return + if isinstance(value, AccountApplicationInformationError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AccountApplicationInformationError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountApplicationInformationError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountApplicationInformationError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountApplicationInformationError.Statusdefault): + buf.write_i32(4) + if isinstance(value, AccountApplicationInformationError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, AccountApplicationInformationError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AccountAssetInformationError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AccountAssetInformationError(Exception): + """ + struct for typed errors of method [`account_asset_information`] +""" + pass + +_UniffiTempAccountAssetInformationError = AccountAssetInformationError + +class AccountAssetInformationError: # type: ignore + """ + struct for typed errors of method [`account_asset_information`] +""" + + class Status400(_UniffiTempAccountAssetInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetInformationError.Status400({})".format(str(self)) + _UniffiTempAccountAssetInformationError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAccountAssetInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetInformationError.Status401({})".format(str(self)) + _UniffiTempAccountAssetInformationError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempAccountAssetInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetInformationError.Status500({})".format(str(self)) + _UniffiTempAccountAssetInformationError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempAccountAssetInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountAssetInformationError.Statusdefault({})".format(str(self)) + _UniffiTempAccountAssetInformationError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAccountAssetInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountAssetInformationError.DefaultResponse({})".format(str(self)) + _UniffiTempAccountAssetInformationError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAccountAssetInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetInformationError.UnknownValue({})".format(str(self)) + _UniffiTempAccountAssetInformationError.UnknownValue = UnknownValue # type: ignore + +AccountAssetInformationError = _UniffiTempAccountAssetInformationError # type: ignore +del _UniffiTempAccountAssetInformationError + + +class _UniffiFfiConverterTypeAccountAssetInformationError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AccountAssetInformationError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AccountAssetInformationError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AccountAssetInformationError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AccountAssetInformationError.Statusdefault( + ) + if variant == 5: + return AccountAssetInformationError.DefaultResponse( + ) + if variant == 6: + return AccountAssetInformationError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AccountAssetInformationError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountAssetInformationError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountAssetInformationError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountAssetInformationError.Statusdefault): + return + if isinstance(value, AccountAssetInformationError.DefaultResponse): + return + if isinstance(value, AccountAssetInformationError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AccountAssetInformationError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountAssetInformationError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountAssetInformationError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountAssetInformationError.Statusdefault): + buf.write_i32(4) + if isinstance(value, AccountAssetInformationError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, AccountAssetInformationError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AccountAssetsInformationError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AccountAssetsInformationError(Exception): + """ + struct for typed errors of method [`account_assets_information`] +""" + pass + +_UniffiTempAccountAssetsInformationError = AccountAssetsInformationError + +class AccountAssetsInformationError: # type: ignore + """ + struct for typed errors of method [`account_assets_information`] +""" + + class Status400(_UniffiTempAccountAssetsInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetsInformationError.Status400({})".format(str(self)) + _UniffiTempAccountAssetsInformationError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAccountAssetsInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetsInformationError.Status401({})".format(str(self)) + _UniffiTempAccountAssetsInformationError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempAccountAssetsInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetsInformationError.Status500({})".format(str(self)) + _UniffiTempAccountAssetsInformationError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempAccountAssetsInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountAssetsInformationError.Statusdefault({})".format(str(self)) + _UniffiTempAccountAssetsInformationError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAccountAssetsInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountAssetsInformationError.DefaultResponse({})".format(str(self)) + _UniffiTempAccountAssetsInformationError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAccountAssetsInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountAssetsInformationError.UnknownValue({})".format(str(self)) + _UniffiTempAccountAssetsInformationError.UnknownValue = UnknownValue # type: ignore + +AccountAssetsInformationError = _UniffiTempAccountAssetsInformationError # type: ignore +del _UniffiTempAccountAssetsInformationError + + +class _UniffiFfiConverterTypeAccountAssetsInformationError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AccountAssetsInformationError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AccountAssetsInformationError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AccountAssetsInformationError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AccountAssetsInformationError.Statusdefault( + ) + if variant == 5: + return AccountAssetsInformationError.DefaultResponse( + ) + if variant == 6: + return AccountAssetsInformationError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AccountAssetsInformationError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountAssetsInformationError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountAssetsInformationError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountAssetsInformationError.Statusdefault): + return + if isinstance(value, AccountAssetsInformationError.DefaultResponse): + return + if isinstance(value, AccountAssetsInformationError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AccountAssetsInformationError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountAssetsInformationError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountAssetsInformationError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountAssetsInformationError.Statusdefault): + buf.write_i32(4) + if isinstance(value, AccountAssetsInformationError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, AccountAssetsInformationError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AccountInformationError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AccountInformationError(Exception): + """ + struct for typed errors of method [`account_information`] +""" + pass + +_UniffiTempAccountInformationError = AccountInformationError + +class AccountInformationError: # type: ignore + """ + struct for typed errors of method [`account_information`] +""" + + class Status400(_UniffiTempAccountInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountInformationError.Status400({})".format(str(self)) + _UniffiTempAccountInformationError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAccountInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountInformationError.Status401({})".format(str(self)) + _UniffiTempAccountInformationError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempAccountInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountInformationError.Status500({})".format(str(self)) + _UniffiTempAccountInformationError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempAccountInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountInformationError.Statusdefault({})".format(str(self)) + _UniffiTempAccountInformationError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAccountInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "AccountInformationError.DefaultResponse({})".format(str(self)) + _UniffiTempAccountInformationError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAccountInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AccountInformationError.UnknownValue({})".format(str(self)) + _UniffiTempAccountInformationError.UnknownValue = UnknownValue # type: ignore + +AccountInformationError = _UniffiTempAccountInformationError # type: ignore +del _UniffiTempAccountInformationError + + +class _UniffiFfiConverterTypeAccountInformationError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AccountInformationError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AccountInformationError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AccountInformationError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AccountInformationError.Statusdefault( + ) + if variant == 5: + return AccountInformationError.DefaultResponse( + ) + if variant == 6: + return AccountInformationError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AccountInformationError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountInformationError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountInformationError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AccountInformationError.Statusdefault): + return + if isinstance(value, AccountInformationError.DefaultResponse): + return + if isinstance(value, AccountInformationError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AccountInformationError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountInformationError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountInformationError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AccountInformationError.Statusdefault): + buf.write_i32(4) + if isinstance(value, AccountInformationError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, AccountInformationError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AddParticipationKeyError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AddParticipationKeyError(Exception): + """ + struct for typed errors of method [`add_participation_key`] +""" + pass + +_UniffiTempAddParticipationKeyError = AddParticipationKeyError + +class AddParticipationKeyError: # type: ignore + """ + struct for typed errors of method [`add_participation_key`] +""" + + class Status400(_UniffiTempAddParticipationKeyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AddParticipationKeyError.Status400({})".format(str(self)) + _UniffiTempAddParticipationKeyError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAddParticipationKeyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AddParticipationKeyError.Status401({})".format(str(self)) + _UniffiTempAddParticipationKeyError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempAddParticipationKeyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AddParticipationKeyError.Status404({})".format(str(self)) + _UniffiTempAddParticipationKeyError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempAddParticipationKeyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AddParticipationKeyError.Status500({})".format(str(self)) + _UniffiTempAddParticipationKeyError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempAddParticipationKeyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AddParticipationKeyError.Status503({})".format(str(self)) + _UniffiTempAddParticipationKeyError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempAddParticipationKeyError): + + def __init__(self): + pass + + def __repr__(self): + return "AddParticipationKeyError.Statusdefault({})".format(str(self)) + _UniffiTempAddParticipationKeyError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAddParticipationKeyError): + + def __init__(self): + pass + + def __repr__(self): + return "AddParticipationKeyError.DefaultResponse({})".format(str(self)) + _UniffiTempAddParticipationKeyError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAddParticipationKeyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AddParticipationKeyError.UnknownValue({})".format(str(self)) + _UniffiTempAddParticipationKeyError.UnknownValue = UnknownValue # type: ignore + +AddParticipationKeyError = _UniffiTempAddParticipationKeyError # type: ignore +del _UniffiTempAddParticipationKeyError + + +class _UniffiFfiConverterTypeAddParticipationKeyError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AddParticipationKeyError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AddParticipationKeyError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AddParticipationKeyError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AddParticipationKeyError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return AddParticipationKeyError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return AddParticipationKeyError.Statusdefault( + ) + if variant == 7: + return AddParticipationKeyError.DefaultResponse( + ) + if variant == 8: + return AddParticipationKeyError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AddParticipationKeyError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AddParticipationKeyError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AddParticipationKeyError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AddParticipationKeyError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AddParticipationKeyError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AddParticipationKeyError.Statusdefault): + return + if isinstance(value, AddParticipationKeyError.DefaultResponse): + return + if isinstance(value, AddParticipationKeyError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AddParticipationKeyError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AddParticipationKeyError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AddParticipationKeyError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AddParticipationKeyError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AddParticipationKeyError.Status503): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AddParticipationKeyError.Statusdefault): + buf.write_i32(6) + if isinstance(value, AddParticipationKeyError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, AddParticipationKeyError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# HealthCheckError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class HealthCheckError(Exception): + """ + struct for typed errors of method [`health_check`] +""" + pass + +_UniffiTempHealthCheckError = HealthCheckError + +class HealthCheckError: # type: ignore + """ + struct for typed errors of method [`health_check`] +""" + + class Statusdefault(_UniffiTempHealthCheckError): + + def __init__(self): + pass + + def __repr__(self): + return "HealthCheckError.Statusdefault({})".format(str(self)) + _UniffiTempHealthCheckError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempHealthCheckError): + + def __init__(self): + pass + + def __repr__(self): + return "HealthCheckError.DefaultResponse({})".format(str(self)) + _UniffiTempHealthCheckError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempHealthCheckError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "HealthCheckError.UnknownValue({})".format(str(self)) + _UniffiTempHealthCheckError.UnknownValue = UnknownValue # type: ignore + +HealthCheckError = _UniffiTempHealthCheckError # type: ignore +del _UniffiTempHealthCheckError + + +class _UniffiFfiConverterTypeHealthCheckError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return HealthCheckError.Statusdefault( + ) + if variant == 2: + return HealthCheckError.DefaultResponse( + ) + if variant == 3: + return HealthCheckError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, HealthCheckError.Statusdefault): + return + if isinstance(value, HealthCheckError.DefaultResponse): + return + if isinstance(value, HealthCheckError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, HealthCheckError.Statusdefault): + buf.write_i32(1) + if isinstance(value, HealthCheckError.DefaultResponse): + buf.write_i32(2) + if isinstance(value, HealthCheckError.UnknownValue): + buf.write_i32(3) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetReadyError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetReadyError(Exception): + """ + struct for typed errors of method [`get_ready`] +""" + pass + +_UniffiTempGetReadyError = GetReadyError + +class GetReadyError: # type: ignore + """ + struct for typed errors of method [`get_ready`] +""" + + class Status500(_UniffiTempGetReadyError): + + def __init__(self): + pass + + def __repr__(self): + return "GetReadyError.Status500({})".format(str(self)) + _UniffiTempGetReadyError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetReadyError): + + def __init__(self): + pass + + def __repr__(self): + return "GetReadyError.Status503({})".format(str(self)) + _UniffiTempGetReadyError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetReadyError): + + def __init__(self): + pass + + def __repr__(self): + return "GetReadyError.Statusdefault({})".format(str(self)) + _UniffiTempGetReadyError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetReadyError): + + def __init__(self): + pass + + def __repr__(self): + return "GetReadyError.DefaultResponse({})".format(str(self)) + _UniffiTempGetReadyError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetReadyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetReadyError.UnknownValue({})".format(str(self)) + _UniffiTempGetReadyError.UnknownValue = UnknownValue # type: ignore + +GetReadyError = _UniffiTempGetReadyError # type: ignore +del _UniffiTempGetReadyError + + +class _UniffiFfiConverterTypeGetReadyError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetReadyError.Status500( + ) + if variant == 2: + return GetReadyError.Status503( + ) + if variant == 3: + return GetReadyError.Statusdefault( + ) + if variant == 4: + return GetReadyError.DefaultResponse( + ) + if variant == 5: + return GetReadyError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetReadyError.Status500): + return + if isinstance(value, GetReadyError.Status503): + return + if isinstance(value, GetReadyError.Statusdefault): + return + if isinstance(value, GetReadyError.DefaultResponse): + return + if isinstance(value, GetReadyError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetReadyError.Status500): + buf.write_i32(1) + if isinstance(value, GetReadyError.Status503): + buf.write_i32(2) + if isinstance(value, GetReadyError.Statusdefault): + buf.write_i32(3) + if isinstance(value, GetReadyError.DefaultResponse): + buf.write_i32(4) + if isinstance(value, GetReadyError.UnknownValue): + buf.write_i32(5) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# MetricsError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class MetricsError(Exception): + """ + struct for typed errors of method [`metrics`] +""" + pass + +_UniffiTempMetricsError = MetricsError + +class MetricsError: # type: ignore + """ + struct for typed errors of method [`metrics`] +""" + + class Status404(_UniffiTempMetricsError): + + def __init__(self): + pass + + def __repr__(self): + return "MetricsError.Status404({})".format(str(self)) + _UniffiTempMetricsError.Status404 = Status404 # type: ignore + class DefaultResponse(_UniffiTempMetricsError): + + def __init__(self): + pass + + def __repr__(self): + return "MetricsError.DefaultResponse({})".format(str(self)) + _UniffiTempMetricsError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempMetricsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "MetricsError.UnknownValue({})".format(str(self)) + _UniffiTempMetricsError.UnknownValue = UnknownValue # type: ignore + +MetricsError = _UniffiTempMetricsError # type: ignore +del _UniffiTempMetricsError + + +class _UniffiFfiConverterTypeMetricsError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return MetricsError.Status404( + ) + if variant == 2: + return MetricsError.DefaultResponse( + ) + if variant == 3: + return MetricsError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, MetricsError.Status404): + return + if isinstance(value, MetricsError.DefaultResponse): + return + if isinstance(value, MetricsError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, MetricsError.Status404): + buf.write_i32(1) + if isinstance(value, MetricsError.DefaultResponse): + buf.write_i32(2) + if isinstance(value, MetricsError.UnknownValue): + buf.write_i32(3) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetGenesisError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetGenesisError(Exception): + """ + struct for typed errors of method [`get_genesis`] +""" + pass + +_UniffiTempGetGenesisError = GetGenesisError + +class GetGenesisError: # type: ignore + """ + struct for typed errors of method [`get_genesis`] +""" + + class Statusdefault(_UniffiTempGetGenesisError): + + def __init__(self): + pass + + def __repr__(self): + return "GetGenesisError.Statusdefault({})".format(str(self)) + _UniffiTempGetGenesisError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetGenesisError): + + def __init__(self): + pass + + def __repr__(self): + return "GetGenesisError.DefaultResponse({})".format(str(self)) + _UniffiTempGetGenesisError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetGenesisError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetGenesisError.UnknownValue({})".format(str(self)) + _UniffiTempGetGenesisError.UnknownValue = UnknownValue # type: ignore + +GetGenesisError = _UniffiTempGetGenesisError # type: ignore +del _UniffiTempGetGenesisError + + +class _UniffiFfiConverterTypeGetGenesisError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetGenesisError.Statusdefault( + ) + if variant == 2: + return GetGenesisError.DefaultResponse( + ) + if variant == 3: + return GetGenesisError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetGenesisError.Statusdefault): + return + if isinstance(value, GetGenesisError.DefaultResponse): + return + if isinstance(value, GetGenesisError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetGenesisError.Statusdefault): + buf.write_i32(1) + if isinstance(value, GetGenesisError.DefaultResponse): + buf.write_i32(2) + if isinstance(value, GetGenesisError.UnknownValue): + buf.write_i32(3) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# SwaggerJsonError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class SwaggerJsonError(Exception): + """ + struct for typed errors of method [`swagger_json`] +""" + pass + +_UniffiTempSwaggerJsonError = SwaggerJsonError + +class SwaggerJsonError: # type: ignore + """ + struct for typed errors of method [`swagger_json`] +""" + + class Statusdefault(_UniffiTempSwaggerJsonError): + + def __init__(self): + pass + + def __repr__(self): + return "SwaggerJsonError.Statusdefault({})".format(str(self)) + _UniffiTempSwaggerJsonError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempSwaggerJsonError): + + def __init__(self): + pass + + def __repr__(self): + return "SwaggerJsonError.DefaultResponse({})".format(str(self)) + _UniffiTempSwaggerJsonError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempSwaggerJsonError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SwaggerJsonError.UnknownValue({})".format(str(self)) + _UniffiTempSwaggerJsonError.UnknownValue = UnknownValue # type: ignore + +SwaggerJsonError = _UniffiTempSwaggerJsonError # type: ignore +del _UniffiTempSwaggerJsonError + + +class _UniffiFfiConverterTypeSwaggerJsonError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return SwaggerJsonError.Statusdefault( + ) + if variant == 2: + return SwaggerJsonError.DefaultResponse( + ) + if variant == 3: + return SwaggerJsonError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, SwaggerJsonError.Statusdefault): + return + if isinstance(value, SwaggerJsonError.DefaultResponse): + return + if isinstance(value, SwaggerJsonError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, SwaggerJsonError.Statusdefault): + buf.write_i32(1) + if isinstance(value, SwaggerJsonError.DefaultResponse): + buf.write_i32(2) + if isinstance(value, SwaggerJsonError.UnknownValue): + buf.write_i32(3) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetVersionError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetVersionError(Exception): + """ + struct for typed errors of method [`get_version`] +""" + pass + +_UniffiTempGetVersionError = GetVersionError + +class GetVersionError: # type: ignore + """ + struct for typed errors of method [`get_version`] +""" + + class DefaultResponse(_UniffiTempGetVersionError): + + def __init__(self): + pass + + def __repr__(self): + return "GetVersionError.DefaultResponse({})".format(str(self)) + _UniffiTempGetVersionError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetVersionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetVersionError.UnknownValue({})".format(str(self)) + _UniffiTempGetVersionError.UnknownValue = UnknownValue # type: ignore + +GetVersionError = _UniffiTempGetVersionError # type: ignore +del _UniffiTempGetVersionError + + +class _UniffiFfiConverterTypeGetVersionError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetVersionError.DefaultResponse( + ) + if variant == 2: + return GetVersionError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetVersionError.DefaultResponse): + return + if isinstance(value, GetVersionError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetVersionError.DefaultResponse): + buf.write_i32(1) + if isinstance(value, GetVersionError.UnknownValue): + buf.write_i32(2) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetDebugSettingsProfError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetDebugSettingsProfError(Exception): + """ + struct for typed errors of method [`get_debug_settings_prof`] +""" + pass + +_UniffiTempGetDebugSettingsProfError = GetDebugSettingsProfError + +class GetDebugSettingsProfError: # type: ignore + """ + struct for typed errors of method [`get_debug_settings_prof`] +""" + + class DefaultResponse(_UniffiTempGetDebugSettingsProfError): + + def __init__(self): + pass + + def __repr__(self): + return "GetDebugSettingsProfError.DefaultResponse({})".format(str(self)) + _UniffiTempGetDebugSettingsProfError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetDebugSettingsProfError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetDebugSettingsProfError.UnknownValue({})".format(str(self)) + _UniffiTempGetDebugSettingsProfError.UnknownValue = UnknownValue # type: ignore + +GetDebugSettingsProfError = _UniffiTempGetDebugSettingsProfError # type: ignore +del _UniffiTempGetDebugSettingsProfError + + +class _UniffiFfiConverterTypeGetDebugSettingsProfError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetDebugSettingsProfError.DefaultResponse( + ) + if variant == 2: + return GetDebugSettingsProfError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetDebugSettingsProfError.DefaultResponse): + return + if isinstance(value, GetDebugSettingsProfError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetDebugSettingsProfError.DefaultResponse): + buf.write_i32(1) + if isinstance(value, GetDebugSettingsProfError.UnknownValue): + buf.write_i32(2) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# PutDebugSettingsProfError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class PutDebugSettingsProfError(Exception): + """ + struct for typed errors of method [`put_debug_settings_prof`] +""" + pass + +_UniffiTempPutDebugSettingsProfError = PutDebugSettingsProfError + +class PutDebugSettingsProfError: # type: ignore + """ + struct for typed errors of method [`put_debug_settings_prof`] +""" + + class DefaultResponse(_UniffiTempPutDebugSettingsProfError): + + def __init__(self): + pass + + def __repr__(self): + return "PutDebugSettingsProfError.DefaultResponse({})".format(str(self)) + _UniffiTempPutDebugSettingsProfError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempPutDebugSettingsProfError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "PutDebugSettingsProfError.UnknownValue({})".format(str(self)) + _UniffiTempPutDebugSettingsProfError.UnknownValue = UnknownValue # type: ignore + +PutDebugSettingsProfError = _UniffiTempPutDebugSettingsProfError # type: ignore +del _UniffiTempPutDebugSettingsProfError + + +class _UniffiFfiConverterTypePutDebugSettingsProfError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return PutDebugSettingsProfError.DefaultResponse( + ) + if variant == 2: + return PutDebugSettingsProfError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, PutDebugSettingsProfError.DefaultResponse): + return + if isinstance(value, PutDebugSettingsProfError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, PutDebugSettingsProfError.DefaultResponse): + buf.write_i32(1) + if isinstance(value, PutDebugSettingsProfError.UnknownValue): + buf.write_i32(2) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetConfigError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetConfigError(Exception): + """ + struct for typed errors of method [`get_config`] +""" + pass + +_UniffiTempGetConfigError = GetConfigError + +class GetConfigError: # type: ignore + """ + struct for typed errors of method [`get_config`] +""" + + class Statusdefault(_UniffiTempGetConfigError): + + def __init__(self): + pass + + def __repr__(self): + return "GetConfigError.Statusdefault({})".format(str(self)) + _UniffiTempGetConfigError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetConfigError): + + def __init__(self): + pass + + def __repr__(self): + return "GetConfigError.DefaultResponse({})".format(str(self)) + _UniffiTempGetConfigError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetConfigError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetConfigError.UnknownValue({})".format(str(self)) + _UniffiTempGetConfigError.UnknownValue = UnknownValue # type: ignore + +GetConfigError = _UniffiTempGetConfigError # type: ignore +del _UniffiTempGetConfigError + + +class _UniffiFfiConverterTypeGetConfigError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetConfigError.Statusdefault( + ) + if variant == 2: + return GetConfigError.DefaultResponse( + ) + if variant == 3: + return GetConfigError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetConfigError.Statusdefault): + return + if isinstance(value, GetConfigError.DefaultResponse): + return + if isinstance(value, GetConfigError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetConfigError.Statusdefault): + buf.write_i32(1) + if isinstance(value, GetConfigError.DefaultResponse): + buf.write_i32(2) + if isinstance(value, GetConfigError.UnknownValue): + buf.write_i32(3) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetPendingTransactionsByAddressError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetPendingTransactionsByAddressError(Exception): + """ + struct for typed errors of method [`get_pending_transactions_by_address`] +""" + pass + +_UniffiTempGetPendingTransactionsByAddressError = GetPendingTransactionsByAddressError + +class GetPendingTransactionsByAddressError: # type: ignore + """ + struct for typed errors of method [`get_pending_transactions_by_address`] +""" + + class Status400(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsByAddressError.Status400({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsByAddressError.Status401({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsByAddressError.Status500({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsByAddressError.Status503({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self): + pass + + def __repr__(self): + return "GetPendingTransactionsByAddressError.Statusdefault({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self): + pass + + def __repr__(self): + return "GetPendingTransactionsByAddressError.DefaultResponse({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetPendingTransactionsByAddressError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsByAddressError.UnknownValue({})".format(str(self)) + _UniffiTempGetPendingTransactionsByAddressError.UnknownValue = UnknownValue # type: ignore + +GetPendingTransactionsByAddressError = _UniffiTempGetPendingTransactionsByAddressError # type: ignore +del _UniffiTempGetPendingTransactionsByAddressError + + +class _UniffiFfiConverterTypeGetPendingTransactionsByAddressError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetPendingTransactionsByAddressError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetPendingTransactionsByAddressError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetPendingTransactionsByAddressError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetPendingTransactionsByAddressError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetPendingTransactionsByAddressError.Statusdefault( + ) + if variant == 6: + return GetPendingTransactionsByAddressError.DefaultResponse( + ) + if variant == 7: + return GetPendingTransactionsByAddressError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetPendingTransactionsByAddressError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsByAddressError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsByAddressError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsByAddressError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsByAddressError.Statusdefault): + return + if isinstance(value, GetPendingTransactionsByAddressError.DefaultResponse): + return + if isinstance(value, GetPendingTransactionsByAddressError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetPendingTransactionsByAddressError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsByAddressError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsByAddressError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsByAddressError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsByAddressError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetPendingTransactionsByAddressError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetPendingTransactionsByAddressError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetBlockError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetBlockError(Exception): + """ + struct for typed errors of method [`get_block`] +""" + pass + +_UniffiTempGetBlockError = GetBlockError + +class GetBlockError: # type: ignore + """ + struct for typed errors of method [`get_block`] +""" + + class Status400(_UniffiTempGetBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockError.Status400({})".format(str(self)) + _UniffiTempGetBlockError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockError.Status401({})".format(str(self)) + _UniffiTempGetBlockError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockError.Status404({})".format(str(self)) + _UniffiTempGetBlockError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockError.Status500({})".format(str(self)) + _UniffiTempGetBlockError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetBlockError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockError.Statusdefault({})".format(str(self)) + _UniffiTempGetBlockError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetBlockError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockError.DefaultResponse({})".format(str(self)) + _UniffiTempGetBlockError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockError.UnknownValue({})".format(str(self)) + _UniffiTempGetBlockError.UnknownValue = UnknownValue # type: ignore + +GetBlockError = _UniffiTempGetBlockError # type: ignore +del _UniffiTempGetBlockError + + +class _UniffiFfiConverterTypeGetBlockError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetBlockError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetBlockError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetBlockError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetBlockError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetBlockError.Statusdefault( + ) + if variant == 6: + return GetBlockError.DefaultResponse( + ) + if variant == 7: + return GetBlockError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetBlockError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockError.Statusdefault): + return + if isinstance(value, GetBlockError.DefaultResponse): + return + if isinstance(value, GetBlockError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetBlockError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetBlockError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetBlockError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetBlockTxidsError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetBlockTxidsError(Exception): + """ + struct for typed errors of method [`get_block_txids`] +""" + pass + +_UniffiTempGetBlockTxidsError = GetBlockTxidsError + +class GetBlockTxidsError: # type: ignore + """ + struct for typed errors of method [`get_block_txids`] +""" + + class Status400(_UniffiTempGetBlockTxidsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTxidsError.Status400({})".format(str(self)) + _UniffiTempGetBlockTxidsError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetBlockTxidsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTxidsError.Status401({})".format(str(self)) + _UniffiTempGetBlockTxidsError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetBlockTxidsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTxidsError.Status404({})".format(str(self)) + _UniffiTempGetBlockTxidsError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetBlockTxidsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTxidsError.Status500({})".format(str(self)) + _UniffiTempGetBlockTxidsError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetBlockTxidsError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockTxidsError.Statusdefault({})".format(str(self)) + _UniffiTempGetBlockTxidsError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetBlockTxidsError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockTxidsError.DefaultResponse({})".format(str(self)) + _UniffiTempGetBlockTxidsError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetBlockTxidsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTxidsError.UnknownValue({})".format(str(self)) + _UniffiTempGetBlockTxidsError.UnknownValue = UnknownValue # type: ignore + +GetBlockTxidsError = _UniffiTempGetBlockTxidsError # type: ignore +del _UniffiTempGetBlockTxidsError + + +class _UniffiFfiConverterTypeGetBlockTxidsError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetBlockTxidsError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetBlockTxidsError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetBlockTxidsError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetBlockTxidsError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetBlockTxidsError.Statusdefault( + ) + if variant == 6: + return GetBlockTxidsError.DefaultResponse( + ) + if variant == 7: + return GetBlockTxidsError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetBlockTxidsError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockTxidsError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockTxidsError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockTxidsError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockTxidsError.Statusdefault): + return + if isinstance(value, GetBlockTxidsError.DefaultResponse): + return + if isinstance(value, GetBlockTxidsError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetBlockTxidsError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockTxidsError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockTxidsError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockTxidsError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockTxidsError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetBlockTxidsError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetBlockTxidsError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetBlockHashError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetBlockHashError(Exception): + """ + struct for typed errors of method [`get_block_hash`] +""" + pass + +_UniffiTempGetBlockHashError = GetBlockHashError + +class GetBlockHashError: # type: ignore + """ + struct for typed errors of method [`get_block_hash`] +""" + + class Status400(_UniffiTempGetBlockHashError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockHashError.Status400({})".format(str(self)) + _UniffiTempGetBlockHashError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetBlockHashError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockHashError.Status401({})".format(str(self)) + _UniffiTempGetBlockHashError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetBlockHashError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockHashError.Status404({})".format(str(self)) + _UniffiTempGetBlockHashError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetBlockHashError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockHashError.Status500({})".format(str(self)) + _UniffiTempGetBlockHashError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetBlockHashError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockHashError.Statusdefault({})".format(str(self)) + _UniffiTempGetBlockHashError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetBlockHashError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockHashError.DefaultResponse({})".format(str(self)) + _UniffiTempGetBlockHashError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetBlockHashError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockHashError.UnknownValue({})".format(str(self)) + _UniffiTempGetBlockHashError.UnknownValue = UnknownValue # type: ignore + +GetBlockHashError = _UniffiTempGetBlockHashError # type: ignore +del _UniffiTempGetBlockHashError + + +class _UniffiFfiConverterTypeGetBlockHashError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetBlockHashError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetBlockHashError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetBlockHashError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetBlockHashError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetBlockHashError.Statusdefault( + ) + if variant == 6: + return GetBlockHashError.DefaultResponse( + ) + if variant == 7: + return GetBlockHashError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetBlockHashError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockHashError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockHashError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockHashError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockHashError.Statusdefault): + return + if isinstance(value, GetBlockHashError.DefaultResponse): + return + if isinstance(value, GetBlockHashError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetBlockHashError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockHashError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockHashError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockHashError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockHashError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetBlockHashError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetBlockHashError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetTransactionProofError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetTransactionProofError(Exception): + """ + struct for typed errors of method [`get_transaction_proof`] +""" + pass + +_UniffiTempGetTransactionProofError = GetTransactionProofError + +class GetTransactionProofError: # type: ignore + """ + struct for typed errors of method [`get_transaction_proof`] +""" + + class Status400(_UniffiTempGetTransactionProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionProofError.Status400({})".format(str(self)) + _UniffiTempGetTransactionProofError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetTransactionProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionProofError.Status401({})".format(str(self)) + _UniffiTempGetTransactionProofError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetTransactionProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionProofError.Status404({})".format(str(self)) + _UniffiTempGetTransactionProofError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetTransactionProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionProofError.Status500({})".format(str(self)) + _UniffiTempGetTransactionProofError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetTransactionProofError): + + def __init__(self): + pass + + def __repr__(self): + return "GetTransactionProofError.Statusdefault({})".format(str(self)) + _UniffiTempGetTransactionProofError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetTransactionProofError): + + def __init__(self): + pass + + def __repr__(self): + return "GetTransactionProofError.DefaultResponse({})".format(str(self)) + _UniffiTempGetTransactionProofError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetTransactionProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionProofError.UnknownValue({})".format(str(self)) + _UniffiTempGetTransactionProofError.UnknownValue = UnknownValue # type: ignore + +GetTransactionProofError = _UniffiTempGetTransactionProofError # type: ignore +del _UniffiTempGetTransactionProofError + + +class _UniffiFfiConverterTypeGetTransactionProofError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetTransactionProofError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetTransactionProofError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetTransactionProofError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetTransactionProofError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetTransactionProofError.Statusdefault( + ) + if variant == 6: + return GetTransactionProofError.DefaultResponse( + ) + if variant == 7: + return GetTransactionProofError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetTransactionProofError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionProofError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionProofError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionProofError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionProofError.Statusdefault): + return + if isinstance(value, GetTransactionProofError.DefaultResponse): + return + if isinstance(value, GetTransactionProofError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetTransactionProofError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionProofError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionProofError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionProofError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionProofError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetTransactionProofError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetTransactionProofError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetBlockLogsError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetBlockLogsError(Exception): + """ + struct for typed errors of method [`get_block_logs`] +""" + pass + +_UniffiTempGetBlockLogsError = GetBlockLogsError + +class GetBlockLogsError: # type: ignore + """ + struct for typed errors of method [`get_block_logs`] +""" + + class Status400(_UniffiTempGetBlockLogsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockLogsError.Status400({})".format(str(self)) + _UniffiTempGetBlockLogsError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetBlockLogsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockLogsError.Status401({})".format(str(self)) + _UniffiTempGetBlockLogsError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetBlockLogsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockLogsError.Status404({})".format(str(self)) + _UniffiTempGetBlockLogsError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetBlockLogsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockLogsError.Status500({})".format(str(self)) + _UniffiTempGetBlockLogsError.Status500 = Status500 # type: ignore + class DefaultResponse(_UniffiTempGetBlockLogsError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockLogsError.DefaultResponse({})".format(str(self)) + _UniffiTempGetBlockLogsError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetBlockLogsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockLogsError.UnknownValue({})".format(str(self)) + _UniffiTempGetBlockLogsError.UnknownValue = UnknownValue # type: ignore + +GetBlockLogsError = _UniffiTempGetBlockLogsError # type: ignore +del _UniffiTempGetBlockLogsError + + +class _UniffiFfiConverterTypeGetBlockLogsError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetBlockLogsError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetBlockLogsError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetBlockLogsError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetBlockLogsError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetBlockLogsError.DefaultResponse( + ) + if variant == 6: + return GetBlockLogsError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetBlockLogsError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockLogsError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockLogsError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockLogsError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockLogsError.DefaultResponse): + return + if isinstance(value, GetBlockLogsError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetBlockLogsError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockLogsError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockLogsError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockLogsError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockLogsError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, GetBlockLogsError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetSupplyError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetSupplyError(Exception): + """ + struct for typed errors of method [`get_supply`] +""" + pass + +_UniffiTempGetSupplyError = GetSupplyError + +class GetSupplyError: # type: ignore + """ + struct for typed errors of method [`get_supply`] +""" + + class Status401(_UniffiTempGetSupplyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSupplyError.Status401({})".format(str(self)) + _UniffiTempGetSupplyError.Status401 = Status401 # type: ignore + class Statusdefault(_UniffiTempGetSupplyError): + + def __init__(self): + pass + + def __repr__(self): + return "GetSupplyError.Statusdefault({})".format(str(self)) + _UniffiTempGetSupplyError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetSupplyError): + + def __init__(self): + pass + + def __repr__(self): + return "GetSupplyError.DefaultResponse({})".format(str(self)) + _UniffiTempGetSupplyError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetSupplyError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSupplyError.UnknownValue({})".format(str(self)) + _UniffiTempGetSupplyError.UnknownValue = UnknownValue # type: ignore + +GetSupplyError = _UniffiTempGetSupplyError # type: ignore +del _UniffiTempGetSupplyError + + +class _UniffiFfiConverterTypeGetSupplyError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetSupplyError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetSupplyError.Statusdefault( + ) + if variant == 3: + return GetSupplyError.DefaultResponse( + ) + if variant == 4: + return GetSupplyError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetSupplyError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetSupplyError.Statusdefault): + return + if isinstance(value, GetSupplyError.DefaultResponse): + return + if isinstance(value, GetSupplyError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetSupplyError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetSupplyError.Statusdefault): + buf.write_i32(2) + if isinstance(value, GetSupplyError.DefaultResponse): + buf.write_i32(3) + if isinstance(value, GetSupplyError.UnknownValue): + buf.write_i32(4) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetParticipationKeysError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetParticipationKeysError(Exception): + """ + struct for typed errors of method [`get_participation_keys`] +""" + pass + +_UniffiTempGetParticipationKeysError = GetParticipationKeysError + +class GetParticipationKeysError: # type: ignore + """ + struct for typed errors of method [`get_participation_keys`] +""" + + class Status400(_UniffiTempGetParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeysError.Status400({})".format(str(self)) + _UniffiTempGetParticipationKeysError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeysError.Status401({})".format(str(self)) + _UniffiTempGetParticipationKeysError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeysError.Status404({})".format(str(self)) + _UniffiTempGetParticipationKeysError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeysError.Status500({})".format(str(self)) + _UniffiTempGetParticipationKeysError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetParticipationKeysError): + + def __init__(self): + pass + + def __repr__(self): + return "GetParticipationKeysError.Statusdefault({})".format(str(self)) + _UniffiTempGetParticipationKeysError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetParticipationKeysError): + + def __init__(self): + pass + + def __repr__(self): + return "GetParticipationKeysError.DefaultResponse({})".format(str(self)) + _UniffiTempGetParticipationKeysError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeysError.UnknownValue({})".format(str(self)) + _UniffiTempGetParticipationKeysError.UnknownValue = UnknownValue # type: ignore + +GetParticipationKeysError = _UniffiTempGetParticipationKeysError # type: ignore +del _UniffiTempGetParticipationKeysError + + +class _UniffiFfiConverterTypeGetParticipationKeysError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetParticipationKeysError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetParticipationKeysError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetParticipationKeysError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetParticipationKeysError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetParticipationKeysError.Statusdefault( + ) + if variant == 6: + return GetParticipationKeysError.DefaultResponse( + ) + if variant == 7: + return GetParticipationKeysError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetParticipationKeysError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeysError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeysError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeysError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeysError.Statusdefault): + return + if isinstance(value, GetParticipationKeysError.DefaultResponse): + return + if isinstance(value, GetParticipationKeysError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetParticipationKeysError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeysError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeysError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeysError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeysError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetParticipationKeysError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetParticipationKeysError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GenerateParticipationKeysError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GenerateParticipationKeysError(Exception): + """ + struct for typed errors of method [`generate_participation_keys`] +""" + pass + +_UniffiTempGenerateParticipationKeysError = GenerateParticipationKeysError + +class GenerateParticipationKeysError: # type: ignore + """ + struct for typed errors of method [`generate_participation_keys`] +""" + + class Status400(_UniffiTempGenerateParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GenerateParticipationKeysError.Status400({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGenerateParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GenerateParticipationKeysError.Status401({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempGenerateParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GenerateParticipationKeysError.Status500({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGenerateParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GenerateParticipationKeysError.Status503({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGenerateParticipationKeysError): + + def __init__(self): + pass + + def __repr__(self): + return "GenerateParticipationKeysError.Statusdefault({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGenerateParticipationKeysError): + + def __init__(self): + pass + + def __repr__(self): + return "GenerateParticipationKeysError.DefaultResponse({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGenerateParticipationKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GenerateParticipationKeysError.UnknownValue({})".format(str(self)) + _UniffiTempGenerateParticipationKeysError.UnknownValue = UnknownValue # type: ignore + +GenerateParticipationKeysError = _UniffiTempGenerateParticipationKeysError # type: ignore +del _UniffiTempGenerateParticipationKeysError + + +class _UniffiFfiConverterTypeGenerateParticipationKeysError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GenerateParticipationKeysError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GenerateParticipationKeysError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GenerateParticipationKeysError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GenerateParticipationKeysError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GenerateParticipationKeysError.Statusdefault( + ) + if variant == 6: + return GenerateParticipationKeysError.DefaultResponse( + ) + if variant == 7: + return GenerateParticipationKeysError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GenerateParticipationKeysError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GenerateParticipationKeysError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GenerateParticipationKeysError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GenerateParticipationKeysError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GenerateParticipationKeysError.Statusdefault): + return + if isinstance(value, GenerateParticipationKeysError.DefaultResponse): + return + if isinstance(value, GenerateParticipationKeysError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GenerateParticipationKeysError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GenerateParticipationKeysError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GenerateParticipationKeysError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GenerateParticipationKeysError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GenerateParticipationKeysError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GenerateParticipationKeysError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GenerateParticipationKeysError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetParticipationKeyByIdError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetParticipationKeyByIdError(Exception): + """ + struct for typed errors of method [`get_participation_key_by_id`] +""" + pass + +_UniffiTempGetParticipationKeyByIdError = GetParticipationKeyByIdError + +class GetParticipationKeyByIdError: # type: ignore + """ + struct for typed errors of method [`get_participation_key_by_id`] +""" + + class Status400(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeyByIdError.Status400({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeyByIdError.Status401({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeyByIdError.Status404({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeyByIdError.Status500({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "GetParticipationKeyByIdError.Statusdefault({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "GetParticipationKeyByIdError.DefaultResponse({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetParticipationKeyByIdError.UnknownValue({})".format(str(self)) + _UniffiTempGetParticipationKeyByIdError.UnknownValue = UnknownValue # type: ignore + +GetParticipationKeyByIdError = _UniffiTempGetParticipationKeyByIdError # type: ignore +del _UniffiTempGetParticipationKeyByIdError + + +class _UniffiFfiConverterTypeGetParticipationKeyByIdError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetParticipationKeyByIdError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetParticipationKeyByIdError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetParticipationKeyByIdError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetParticipationKeyByIdError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetParticipationKeyByIdError.Statusdefault( + ) + if variant == 6: + return GetParticipationKeyByIdError.DefaultResponse( + ) + if variant == 7: + return GetParticipationKeyByIdError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetParticipationKeyByIdError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeyByIdError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeyByIdError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeyByIdError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetParticipationKeyByIdError.Statusdefault): + return + if isinstance(value, GetParticipationKeyByIdError.DefaultResponse): + return + if isinstance(value, GetParticipationKeyByIdError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetParticipationKeyByIdError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeyByIdError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeyByIdError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeyByIdError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetParticipationKeyByIdError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetParticipationKeyByIdError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetParticipationKeyByIdError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AppendKeysError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AppendKeysError(Exception): + """ + struct for typed errors of method [`append_keys`] +""" + pass + +_UniffiTempAppendKeysError = AppendKeysError + +class AppendKeysError: # type: ignore + """ + struct for typed errors of method [`append_keys`] +""" + + class Status400(_UniffiTempAppendKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AppendKeysError.Status400({})".format(str(self)) + _UniffiTempAppendKeysError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempAppendKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AppendKeysError.Status401({})".format(str(self)) + _UniffiTempAppendKeysError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempAppendKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AppendKeysError.Status404({})".format(str(self)) + _UniffiTempAppendKeysError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempAppendKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AppendKeysError.Status500({})".format(str(self)) + _UniffiTempAppendKeysError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempAppendKeysError): + + def __init__(self): + pass + + def __repr__(self): + return "AppendKeysError.Statusdefault({})".format(str(self)) + _UniffiTempAppendKeysError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempAppendKeysError): + + def __init__(self): + pass + + def __repr__(self): + return "AppendKeysError.DefaultResponse({})".format(str(self)) + _UniffiTempAppendKeysError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempAppendKeysError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "AppendKeysError.UnknownValue({})".format(str(self)) + _UniffiTempAppendKeysError.UnknownValue = UnknownValue # type: ignore + +AppendKeysError = _UniffiTempAppendKeysError # type: ignore +del _UniffiTempAppendKeysError + + +class _UniffiFfiConverterTypeAppendKeysError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AppendKeysError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return AppendKeysError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return AppendKeysError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return AppendKeysError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return AppendKeysError.Statusdefault( + ) + if variant == 6: + return AppendKeysError.DefaultResponse( + ) + if variant == 7: + return AppendKeysError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AppendKeysError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AppendKeysError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AppendKeysError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AppendKeysError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, AppendKeysError.Statusdefault): + return + if isinstance(value, AppendKeysError.DefaultResponse): + return + if isinstance(value, AppendKeysError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AppendKeysError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AppendKeysError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AppendKeysError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AppendKeysError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, AppendKeysError.Statusdefault): + buf.write_i32(5) + if isinstance(value, AppendKeysError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, AppendKeysError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# DeleteParticipationKeyByIdError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class DeleteParticipationKeyByIdError(Exception): + """ + struct for typed errors of method [`delete_participation_key_by_id`] +""" + pass + +_UniffiTempDeleteParticipationKeyByIdError = DeleteParticipationKeyByIdError + +class DeleteParticipationKeyByIdError: # type: ignore + """ + struct for typed errors of method [`delete_participation_key_by_id`] +""" + + class Status400(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "DeleteParticipationKeyByIdError.Status400({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "DeleteParticipationKeyByIdError.Status401({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "DeleteParticipationKeyByIdError.Status404({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "DeleteParticipationKeyByIdError.Status500({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "DeleteParticipationKeyByIdError.Statusdefault({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "DeleteParticipationKeyByIdError.DefaultResponse({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempDeleteParticipationKeyByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "DeleteParticipationKeyByIdError.UnknownValue({})".format(str(self)) + _UniffiTempDeleteParticipationKeyByIdError.UnknownValue = UnknownValue # type: ignore + +DeleteParticipationKeyByIdError = _UniffiTempDeleteParticipationKeyByIdError # type: ignore +del _UniffiTempDeleteParticipationKeyByIdError + + +class _UniffiFfiConverterTypeDeleteParticipationKeyByIdError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return DeleteParticipationKeyByIdError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return DeleteParticipationKeyByIdError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return DeleteParticipationKeyByIdError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return DeleteParticipationKeyByIdError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return DeleteParticipationKeyByIdError.Statusdefault( + ) + if variant == 6: + return DeleteParticipationKeyByIdError.DefaultResponse( + ) + if variant == 7: + return DeleteParticipationKeyByIdError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, DeleteParticipationKeyByIdError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, DeleteParticipationKeyByIdError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, DeleteParticipationKeyByIdError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, DeleteParticipationKeyByIdError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, DeleteParticipationKeyByIdError.Statusdefault): + return + if isinstance(value, DeleteParticipationKeyByIdError.DefaultResponse): + return + if isinstance(value, DeleteParticipationKeyByIdError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, DeleteParticipationKeyByIdError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, DeleteParticipationKeyByIdError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, DeleteParticipationKeyByIdError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, DeleteParticipationKeyByIdError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, DeleteParticipationKeyByIdError.Statusdefault): + buf.write_i32(5) + if isinstance(value, DeleteParticipationKeyByIdError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, DeleteParticipationKeyByIdError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# ShutdownNodeError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class ShutdownNodeError(Exception): + """ + struct for typed errors of method [`shutdown_node`] +""" + pass + +_UniffiTempShutdownNodeError = ShutdownNodeError + +class ShutdownNodeError: # type: ignore + """ + struct for typed errors of method [`shutdown_node`] +""" + + class DefaultResponse(_UniffiTempShutdownNodeError): + + def __init__(self): + pass + + def __repr__(self): + return "ShutdownNodeError.DefaultResponse({})".format(str(self)) + _UniffiTempShutdownNodeError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempShutdownNodeError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "ShutdownNodeError.UnknownValue({})".format(str(self)) + _UniffiTempShutdownNodeError.UnknownValue = UnknownValue # type: ignore + +ShutdownNodeError = _UniffiTempShutdownNodeError # type: ignore +del _UniffiTempShutdownNodeError + + +class _UniffiFfiConverterTypeShutdownNodeError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return ShutdownNodeError.DefaultResponse( + ) + if variant == 2: + return ShutdownNodeError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, ShutdownNodeError.DefaultResponse): + return + if isinstance(value, ShutdownNodeError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, ShutdownNodeError.DefaultResponse): + buf.write_i32(1) + if isinstance(value, ShutdownNodeError.UnknownValue): + buf.write_i32(2) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetStatusError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetStatusError(Exception): + """ + struct for typed errors of method [`get_status`] +""" + pass + +_UniffiTempGetStatusError = GetStatusError + +class GetStatusError: # type: ignore + """ + struct for typed errors of method [`get_status`] +""" + + class Status401(_UniffiTempGetStatusError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStatusError.Status401({})".format(str(self)) + _UniffiTempGetStatusError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempGetStatusError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], str): + raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStatusError.Status500({})".format(str(self)) + _UniffiTempGetStatusError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetStatusError): + + def __init__(self): + pass + + def __repr__(self): + return "GetStatusError.Statusdefault({})".format(str(self)) + _UniffiTempGetStatusError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetStatusError): + + def __init__(self): + pass + + def __repr__(self): + return "GetStatusError.DefaultResponse({})".format(str(self)) + _UniffiTempGetStatusError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetStatusError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStatusError.UnknownValue({})".format(str(self)) + _UniffiTempGetStatusError.UnknownValue = UnknownValue # type: ignore + +GetStatusError = _UniffiTempGetStatusError # type: ignore +del _UniffiTempGetStatusError + + +class _UniffiFfiConverterTypeGetStatusError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetStatusError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetStatusError.Status500( + _UniffiFfiConverterString.read(buf), + ) + if variant == 3: + return GetStatusError.Statusdefault( + ) + if variant == 4: + return GetStatusError.DefaultResponse( + ) + if variant == 5: + return GetStatusError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetStatusError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetStatusError.Status500): + _UniffiFfiConverterString.check_lower(value._values[0]) + return + if isinstance(value, GetStatusError.Statusdefault): + return + if isinstance(value, GetStatusError.DefaultResponse): + return + if isinstance(value, GetStatusError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetStatusError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetStatusError.Status500): + buf.write_i32(2) + _UniffiFfiConverterString.write(value._values[0], buf) + if isinstance(value, GetStatusError.Statusdefault): + buf.write_i32(3) + if isinstance(value, GetStatusError.DefaultResponse): + buf.write_i32(4) + if isinstance(value, GetStatusError.UnknownValue): + buf.write_i32(5) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# WaitForBlockError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class WaitForBlockError(Exception): + """ + struct for typed errors of method [`wait_for_block`] +""" + pass + +_UniffiTempWaitForBlockError = WaitForBlockError + +class WaitForBlockError: # type: ignore + """ + struct for typed errors of method [`wait_for_block`] +""" + + class Status400(_UniffiTempWaitForBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "WaitForBlockError.Status400({})".format(str(self)) + _UniffiTempWaitForBlockError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempWaitForBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "WaitForBlockError.Status401({})".format(str(self)) + _UniffiTempWaitForBlockError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempWaitForBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "WaitForBlockError.Status500({})".format(str(self)) + _UniffiTempWaitForBlockError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempWaitForBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "WaitForBlockError.Status503({})".format(str(self)) + _UniffiTempWaitForBlockError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempWaitForBlockError): + + def __init__(self): + pass + + def __repr__(self): + return "WaitForBlockError.Statusdefault({})".format(str(self)) + _UniffiTempWaitForBlockError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempWaitForBlockError): + + def __init__(self): + pass + + def __repr__(self): + return "WaitForBlockError.DefaultResponse({})".format(str(self)) + _UniffiTempWaitForBlockError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempWaitForBlockError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "WaitForBlockError.UnknownValue({})".format(str(self)) + _UniffiTempWaitForBlockError.UnknownValue = UnknownValue # type: ignore + +WaitForBlockError = _UniffiTempWaitForBlockError # type: ignore +del _UniffiTempWaitForBlockError + + +class _UniffiFfiConverterTypeWaitForBlockError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return WaitForBlockError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return WaitForBlockError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return WaitForBlockError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return WaitForBlockError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return WaitForBlockError.Statusdefault( + ) + if variant == 6: + return WaitForBlockError.DefaultResponse( + ) + if variant == 7: + return WaitForBlockError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, WaitForBlockError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, WaitForBlockError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, WaitForBlockError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, WaitForBlockError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, WaitForBlockError.Statusdefault): + return + if isinstance(value, WaitForBlockError.DefaultResponse): + return + if isinstance(value, WaitForBlockError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, WaitForBlockError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, WaitForBlockError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, WaitForBlockError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, WaitForBlockError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, WaitForBlockError.Statusdefault): + buf.write_i32(5) + if isinstance(value, WaitForBlockError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, WaitForBlockError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# RawTransactionError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class RawTransactionError(Exception): + """ + struct for typed errors of method [`raw_transaction`] +""" + pass + +_UniffiTempRawTransactionError = RawTransactionError + +class RawTransactionError: # type: ignore + """ + struct for typed errors of method [`raw_transaction`] +""" + + class Status400(_UniffiTempRawTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionError.Status400({})".format(str(self)) + _UniffiTempRawTransactionError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempRawTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionError.Status401({})".format(str(self)) + _UniffiTempRawTransactionError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempRawTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionError.Status500({})".format(str(self)) + _UniffiTempRawTransactionError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempRawTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionError.Status503({})".format(str(self)) + _UniffiTempRawTransactionError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempRawTransactionError): + + def __init__(self): + pass + + def __repr__(self): + return "RawTransactionError.Statusdefault({})".format(str(self)) + _UniffiTempRawTransactionError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempRawTransactionError): + + def __init__(self): + pass + + def __repr__(self): + return "RawTransactionError.DefaultResponse({})".format(str(self)) + _UniffiTempRawTransactionError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempRawTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionError.UnknownValue({})".format(str(self)) + _UniffiTempRawTransactionError.UnknownValue = UnknownValue # type: ignore + +RawTransactionError = _UniffiTempRawTransactionError # type: ignore +del _UniffiTempRawTransactionError + + +class _UniffiFfiConverterTypeRawTransactionError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return RawTransactionError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return RawTransactionError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return RawTransactionError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return RawTransactionError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return RawTransactionError.Statusdefault( + ) + if variant == 6: + return RawTransactionError.DefaultResponse( + ) + if variant == 7: + return RawTransactionError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, RawTransactionError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionError.Statusdefault): + return + if isinstance(value, RawTransactionError.DefaultResponse): + return + if isinstance(value, RawTransactionError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, RawTransactionError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionError.Statusdefault): + buf.write_i32(5) + if isinstance(value, RawTransactionError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, RawTransactionError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# RawTransactionAsyncError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class RawTransactionAsyncError(Exception): + """ + struct for typed errors of method [`raw_transaction_async`] +""" + pass + +_UniffiTempRawTransactionAsyncError = RawTransactionAsyncError + +class RawTransactionAsyncError: # type: ignore + """ + struct for typed errors of method [`raw_transaction_async`] +""" + + class Status400(_UniffiTempRawTransactionAsyncError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionAsyncError.Status400({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempRawTransactionAsyncError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionAsyncError.Status401({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempRawTransactionAsyncError): + + def __init__(self): + pass + + def __repr__(self): + return "RawTransactionAsyncError.Status404({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempRawTransactionAsyncError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionAsyncError.Status500({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempRawTransactionAsyncError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionAsyncError.Status503({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempRawTransactionAsyncError): + + def __init__(self): + pass + + def __repr__(self): + return "RawTransactionAsyncError.Statusdefault({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempRawTransactionAsyncError): + + def __init__(self): + pass + + def __repr__(self): + return "RawTransactionAsyncError.DefaultResponse({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempRawTransactionAsyncError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "RawTransactionAsyncError.UnknownValue({})".format(str(self)) + _UniffiTempRawTransactionAsyncError.UnknownValue = UnknownValue # type: ignore + +RawTransactionAsyncError = _UniffiTempRawTransactionAsyncError # type: ignore +del _UniffiTempRawTransactionAsyncError + + +class _UniffiFfiConverterTypeRawTransactionAsyncError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return RawTransactionAsyncError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return RawTransactionAsyncError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return RawTransactionAsyncError.Status404( + ) + if variant == 4: + return RawTransactionAsyncError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return RawTransactionAsyncError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return RawTransactionAsyncError.Statusdefault( + ) + if variant == 7: + return RawTransactionAsyncError.DefaultResponse( + ) + if variant == 8: + return RawTransactionAsyncError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, RawTransactionAsyncError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionAsyncError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionAsyncError.Status404): + return + if isinstance(value, RawTransactionAsyncError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionAsyncError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, RawTransactionAsyncError.Statusdefault): + return + if isinstance(value, RawTransactionAsyncError.DefaultResponse): + return + if isinstance(value, RawTransactionAsyncError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, RawTransactionAsyncError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionAsyncError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionAsyncError.Status404): + buf.write_i32(3) + if isinstance(value, RawTransactionAsyncError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionAsyncError.Status503): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, RawTransactionAsyncError.Statusdefault): + buf.write_i32(6) + if isinstance(value, RawTransactionAsyncError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, RawTransactionAsyncError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# SimulateTransactionError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class SimulateTransactionError(Exception): + """ + struct for typed errors of method [`simulate_transaction`] +""" + pass + +_UniffiTempSimulateTransactionError = SimulateTransactionError + +class SimulateTransactionError: # type: ignore + """ + struct for typed errors of method [`simulate_transaction`] +""" + + class Status400(_UniffiTempSimulateTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SimulateTransactionError.Status400({})".format(str(self)) + _UniffiTempSimulateTransactionError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempSimulateTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SimulateTransactionError.Status401({})".format(str(self)) + _UniffiTempSimulateTransactionError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempSimulateTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SimulateTransactionError.Status500({})".format(str(self)) + _UniffiTempSimulateTransactionError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempSimulateTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SimulateTransactionError.Status503({})".format(str(self)) + _UniffiTempSimulateTransactionError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempSimulateTransactionError): + + def __init__(self): + pass + + def __repr__(self): + return "SimulateTransactionError.Statusdefault({})".format(str(self)) + _UniffiTempSimulateTransactionError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempSimulateTransactionError): + + def __init__(self): + pass + + def __repr__(self): + return "SimulateTransactionError.DefaultResponse({})".format(str(self)) + _UniffiTempSimulateTransactionError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempSimulateTransactionError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SimulateTransactionError.UnknownValue({})".format(str(self)) + _UniffiTempSimulateTransactionError.UnknownValue = UnknownValue # type: ignore + +SimulateTransactionError = _UniffiTempSimulateTransactionError # type: ignore +del _UniffiTempSimulateTransactionError + + +class _UniffiFfiConverterTypeSimulateTransactionError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return SimulateTransactionError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return SimulateTransactionError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return SimulateTransactionError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return SimulateTransactionError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return SimulateTransactionError.Statusdefault( + ) + if variant == 6: + return SimulateTransactionError.DefaultResponse( + ) + if variant == 7: + return SimulateTransactionError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, SimulateTransactionError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SimulateTransactionError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SimulateTransactionError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SimulateTransactionError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SimulateTransactionError.Statusdefault): + return + if isinstance(value, SimulateTransactionError.DefaultResponse): + return + if isinstance(value, SimulateTransactionError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, SimulateTransactionError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SimulateTransactionError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SimulateTransactionError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SimulateTransactionError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SimulateTransactionError.Statusdefault): + buf.write_i32(5) + if isinstance(value, SimulateTransactionError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, SimulateTransactionError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# TransactionParamsError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class TransactionParamsError(Exception): + """ + struct for typed errors of method [`transaction_params`] +""" + pass + +_UniffiTempTransactionParamsError = TransactionParamsError + +class TransactionParamsError: # type: ignore + """ + struct for typed errors of method [`transaction_params`] +""" + + class Status401(_UniffiTempTransactionParamsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TransactionParamsError.Status401({})".format(str(self)) + _UniffiTempTransactionParamsError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempTransactionParamsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TransactionParamsError.Status500({})".format(str(self)) + _UniffiTempTransactionParamsError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempTransactionParamsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TransactionParamsError.Status503({})".format(str(self)) + _UniffiTempTransactionParamsError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempTransactionParamsError): + + def __init__(self): + pass + + def __repr__(self): + return "TransactionParamsError.Statusdefault({})".format(str(self)) + _UniffiTempTransactionParamsError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempTransactionParamsError): + + def __init__(self): + pass + + def __repr__(self): + return "TransactionParamsError.DefaultResponse({})".format(str(self)) + _UniffiTempTransactionParamsError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempTransactionParamsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TransactionParamsError.UnknownValue({})".format(str(self)) + _UniffiTempTransactionParamsError.UnknownValue = UnknownValue # type: ignore + +TransactionParamsError = _UniffiTempTransactionParamsError # type: ignore +del _UniffiTempTransactionParamsError + + +class _UniffiFfiConverterTypeTransactionParamsError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TransactionParamsError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return TransactionParamsError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return TransactionParamsError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return TransactionParamsError.Statusdefault( + ) + if variant == 5: + return TransactionParamsError.DefaultResponse( + ) + if variant == 6: + return TransactionParamsError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, TransactionParamsError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TransactionParamsError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TransactionParamsError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TransactionParamsError.Statusdefault): + return + if isinstance(value, TransactionParamsError.DefaultResponse): + return + if isinstance(value, TransactionParamsError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, TransactionParamsError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TransactionParamsError.Status500): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TransactionParamsError.Status503): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TransactionParamsError.Statusdefault): + buf.write_i32(4) + if isinstance(value, TransactionParamsError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, TransactionParamsError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetPendingTransactionsError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetPendingTransactionsError(Exception): + """ + struct for typed errors of method [`get_pending_transactions`] +""" + pass + +_UniffiTempGetPendingTransactionsError = GetPendingTransactionsError + +class GetPendingTransactionsError: # type: ignore + """ + struct for typed errors of method [`get_pending_transactions`] +""" + + class Status401(_UniffiTempGetPendingTransactionsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsError.Status401({})".format(str(self)) + _UniffiTempGetPendingTransactionsError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempGetPendingTransactionsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsError.Status500({})".format(str(self)) + _UniffiTempGetPendingTransactionsError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetPendingTransactionsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsError.Status503({})".format(str(self)) + _UniffiTempGetPendingTransactionsError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetPendingTransactionsError): + + def __init__(self): + pass + + def __repr__(self): + return "GetPendingTransactionsError.Statusdefault({})".format(str(self)) + _UniffiTempGetPendingTransactionsError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetPendingTransactionsError): + + def __init__(self): + pass + + def __repr__(self): + return "GetPendingTransactionsError.DefaultResponse({})".format(str(self)) + _UniffiTempGetPendingTransactionsError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetPendingTransactionsError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetPendingTransactionsError.UnknownValue({})".format(str(self)) + _UniffiTempGetPendingTransactionsError.UnknownValue = UnknownValue # type: ignore + +GetPendingTransactionsError = _UniffiTempGetPendingTransactionsError # type: ignore +del _UniffiTempGetPendingTransactionsError + + +class _UniffiFfiConverterTypeGetPendingTransactionsError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetPendingTransactionsError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetPendingTransactionsError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetPendingTransactionsError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetPendingTransactionsError.Statusdefault( + ) + if variant == 5: + return GetPendingTransactionsError.DefaultResponse( + ) + if variant == 6: + return GetPendingTransactionsError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetPendingTransactionsError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetPendingTransactionsError.Statusdefault): + return + if isinstance(value, GetPendingTransactionsError.DefaultResponse): + return + if isinstance(value, GetPendingTransactionsError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetPendingTransactionsError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsError.Status500): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsError.Status503): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetPendingTransactionsError.Statusdefault): + buf.write_i32(4) + if isinstance(value, GetPendingTransactionsError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, GetPendingTransactionsError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# PendingTransactionInformationError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class PendingTransactionInformationError(Exception): + """ + struct for typed errors of method [`pending_transaction_information`] +""" + pass + +_UniffiTempPendingTransactionInformationError = PendingTransactionInformationError + +class PendingTransactionInformationError: # type: ignore + """ + struct for typed errors of method [`pending_transaction_information`] +""" + + class Status400(_UniffiTempPendingTransactionInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "PendingTransactionInformationError.Status400({})".format(str(self)) + _UniffiTempPendingTransactionInformationError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempPendingTransactionInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "PendingTransactionInformationError.Status401({})".format(str(self)) + _UniffiTempPendingTransactionInformationError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempPendingTransactionInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "PendingTransactionInformationError.Status404({})".format(str(self)) + _UniffiTempPendingTransactionInformationError.Status404 = Status404 # type: ignore + class Statusdefault(_UniffiTempPendingTransactionInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "PendingTransactionInformationError.Statusdefault({})".format(str(self)) + _UniffiTempPendingTransactionInformationError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempPendingTransactionInformationError): + + def __init__(self): + pass + + def __repr__(self): + return "PendingTransactionInformationError.DefaultResponse({})".format(str(self)) + _UniffiTempPendingTransactionInformationError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempPendingTransactionInformationError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "PendingTransactionInformationError.UnknownValue({})".format(str(self)) + _UniffiTempPendingTransactionInformationError.UnknownValue = UnknownValue # type: ignore + +PendingTransactionInformationError = _UniffiTempPendingTransactionInformationError # type: ignore +del _UniffiTempPendingTransactionInformationError + + +class _UniffiFfiConverterTypePendingTransactionInformationError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return PendingTransactionInformationError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return PendingTransactionInformationError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return PendingTransactionInformationError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return PendingTransactionInformationError.Statusdefault( + ) + if variant == 5: + return PendingTransactionInformationError.DefaultResponse( + ) + if variant == 6: + return PendingTransactionInformationError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, PendingTransactionInformationError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, PendingTransactionInformationError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, PendingTransactionInformationError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, PendingTransactionInformationError.Statusdefault): + return + if isinstance(value, PendingTransactionInformationError.DefaultResponse): + return + if isinstance(value, PendingTransactionInformationError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, PendingTransactionInformationError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, PendingTransactionInformationError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, PendingTransactionInformationError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, PendingTransactionInformationError.Statusdefault): + buf.write_i32(4) + if isinstance(value, PendingTransactionInformationError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, PendingTransactionInformationError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetLedgerStateDeltaError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetLedgerStateDeltaError(Exception): + """ + struct for typed errors of method [`get_ledger_state_delta`] +""" + pass + +_UniffiTempGetLedgerStateDeltaError = GetLedgerStateDeltaError + +class GetLedgerStateDeltaError: # type: ignore + """ + struct for typed errors of method [`get_ledger_state_delta`] +""" + + class Status401(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaError.Status401({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaError.Status404({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.Status404 = Status404 # type: ignore + class Status408(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaError.Status408({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.Status408 = Status408 # type: ignore + class Status500(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaError.Status500({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaError.Status503({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self): + pass + + def __repr__(self): + return "GetLedgerStateDeltaError.Statusdefault({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self): + pass + + def __repr__(self): + return "GetLedgerStateDeltaError.DefaultResponse({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetLedgerStateDeltaError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaError.UnknownValue({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaError.UnknownValue = UnknownValue # type: ignore + +GetLedgerStateDeltaError = _UniffiTempGetLedgerStateDeltaError # type: ignore +del _UniffiTempGetLedgerStateDeltaError + + +class _UniffiFfiConverterTypeGetLedgerStateDeltaError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetLedgerStateDeltaError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetLedgerStateDeltaError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetLedgerStateDeltaError.Status408( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetLedgerStateDeltaError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetLedgerStateDeltaError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return GetLedgerStateDeltaError.Statusdefault( + ) + if variant == 7: + return GetLedgerStateDeltaError.DefaultResponse( + ) + if variant == 8: + return GetLedgerStateDeltaError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetLedgerStateDeltaError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaError.Status408): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaError.Statusdefault): + return + if isinstance(value, GetLedgerStateDeltaError.DefaultResponse): + return + if isinstance(value, GetLedgerStateDeltaError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetLedgerStateDeltaError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaError.Status404): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaError.Status408): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaError.Status503): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaError.Statusdefault): + buf.write_i32(6) + if isinstance(value, GetLedgerStateDeltaError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, GetLedgerStateDeltaError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetTransactionGroupLedgerStateDeltasForRoundError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetTransactionGroupLedgerStateDeltasForRoundError(Exception): + """ + struct for typed errors of method [`get_transaction_group_ledger_state_deltas_for_round`] +""" + pass + +_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError = GetTransactionGroupLedgerStateDeltasForRoundError + +class GetTransactionGroupLedgerStateDeltasForRoundError: # type: ignore + """ + struct for typed errors of method [`get_transaction_group_ledger_state_deltas_for_round`] +""" + + class Status401(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.Status401({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.Status404({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.Status404 = Status404 # type: ignore + class Status408(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.Status408({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.Status408 = Status408 # type: ignore + class Status500(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.Status500({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.Status500 = Status500 # type: ignore + class Status501(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.Status501({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.Status501 = Status501 # type: ignore + class Statusdefault(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.Statusdefault({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.DefaultResponse({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetTransactionGroupLedgerStateDeltasForRoundError.UnknownValue({})".format(str(self)) + _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError.UnknownValue = UnknownValue # type: ignore + +GetTransactionGroupLedgerStateDeltasForRoundError = _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError # type: ignore +del _UniffiTempGetTransactionGroupLedgerStateDeltasForRoundError + + +class _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRoundError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetTransactionGroupLedgerStateDeltasForRoundError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetTransactionGroupLedgerStateDeltasForRoundError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetTransactionGroupLedgerStateDeltasForRoundError.Status408( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetTransactionGroupLedgerStateDeltasForRoundError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetTransactionGroupLedgerStateDeltasForRoundError.Status501( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return GetTransactionGroupLedgerStateDeltasForRoundError.Statusdefault( + ) + if variant == 7: + return GetTransactionGroupLedgerStateDeltasForRoundError.DefaultResponse( + ) + if variant == 8: + return GetTransactionGroupLedgerStateDeltasForRoundError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status408): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status501): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Statusdefault): + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.DefaultResponse): + return + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status404): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status408): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Status501): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.Statusdefault): + buf.write_i32(6) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, GetTransactionGroupLedgerStateDeltasForRoundError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetLedgerStateDeltaForTransactionGroupError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetLedgerStateDeltaForTransactionGroupError(Exception): + """ + struct for typed errors of method [`get_ledger_state_delta_for_transaction_group`] +""" + pass + +_UniffiTempGetLedgerStateDeltaForTransactionGroupError = GetLedgerStateDeltaForTransactionGroupError + +class GetLedgerStateDeltaForTransactionGroupError: # type: ignore + """ + struct for typed errors of method [`get_ledger_state_delta_for_transaction_group`] +""" + + class Status401(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.Status401({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.Status404({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.Status404 = Status404 # type: ignore + class Status408(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.Status408({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.Status408 = Status408 # type: ignore + class Status500(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.Status500({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.Status500 = Status500 # type: ignore + class Status501(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.Status501({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.Status501 = Status501 # type: ignore + class Statusdefault(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self): + pass + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.Statusdefault({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self): + pass + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.DefaultResponse({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetLedgerStateDeltaForTransactionGroupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLedgerStateDeltaForTransactionGroupError.UnknownValue({})".format(str(self)) + _UniffiTempGetLedgerStateDeltaForTransactionGroupError.UnknownValue = UnknownValue # type: ignore + +GetLedgerStateDeltaForTransactionGroupError = _UniffiTempGetLedgerStateDeltaForTransactionGroupError # type: ignore +del _UniffiTempGetLedgerStateDeltaForTransactionGroupError + + +class _UniffiFfiConverterTypeGetLedgerStateDeltaForTransactionGroupError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetLedgerStateDeltaForTransactionGroupError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetLedgerStateDeltaForTransactionGroupError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetLedgerStateDeltaForTransactionGroupError.Status408( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetLedgerStateDeltaForTransactionGroupError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetLedgerStateDeltaForTransactionGroupError.Status501( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return GetLedgerStateDeltaForTransactionGroupError.Statusdefault( + ) + if variant == 7: + return GetLedgerStateDeltaForTransactionGroupError.DefaultResponse( + ) + if variant == 8: + return GetLedgerStateDeltaForTransactionGroupError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status408): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status501): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Statusdefault): + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.DefaultResponse): + return + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status404): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status408): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Status501): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.Statusdefault): + buf.write_i32(6) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, GetLedgerStateDeltaForTransactionGroupError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetStateProofError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetStateProofError(Exception): + """ + struct for typed errors of method [`get_state_proof`] +""" + pass + +_UniffiTempGetStateProofError = GetStateProofError + +class GetStateProofError: # type: ignore + """ + struct for typed errors of method [`get_state_proof`] +""" + + class Status401(_UniffiTempGetStateProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStateProofError.Status401({})".format(str(self)) + _UniffiTempGetStateProofError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetStateProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStateProofError.Status404({})".format(str(self)) + _UniffiTempGetStateProofError.Status404 = Status404 # type: ignore + class Status408(_UniffiTempGetStateProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStateProofError.Status408({})".format(str(self)) + _UniffiTempGetStateProofError.Status408 = Status408 # type: ignore + class Status500(_UniffiTempGetStateProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStateProofError.Status500({})".format(str(self)) + _UniffiTempGetStateProofError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetStateProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStateProofError.Status503({})".format(str(self)) + _UniffiTempGetStateProofError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetStateProofError): + + def __init__(self): + pass + + def __repr__(self): + return "GetStateProofError.Statusdefault({})".format(str(self)) + _UniffiTempGetStateProofError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetStateProofError): + + def __init__(self): + pass + + def __repr__(self): + return "GetStateProofError.DefaultResponse({})".format(str(self)) + _UniffiTempGetStateProofError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetStateProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetStateProofError.UnknownValue({})".format(str(self)) + _UniffiTempGetStateProofError.UnknownValue = UnknownValue # type: ignore + +GetStateProofError = _UniffiTempGetStateProofError # type: ignore +del _UniffiTempGetStateProofError + + +class _UniffiFfiConverterTypeGetStateProofError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetStateProofError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetStateProofError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetStateProofError.Status408( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetStateProofError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetStateProofError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return GetStateProofError.Statusdefault( + ) + if variant == 7: + return GetStateProofError.DefaultResponse( + ) + if variant == 8: + return GetStateProofError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetStateProofError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetStateProofError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetStateProofError.Status408): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetStateProofError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetStateProofError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetStateProofError.Statusdefault): + return + if isinstance(value, GetStateProofError.DefaultResponse): + return + if isinstance(value, GetStateProofError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetStateProofError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetStateProofError.Status404): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetStateProofError.Status408): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetStateProofError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetStateProofError.Status503): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetStateProofError.Statusdefault): + buf.write_i32(6) + if isinstance(value, GetStateProofError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, GetStateProofError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetLightBlockHeaderProofError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetLightBlockHeaderProofError(Exception): + """ + struct for typed errors of method [`get_light_block_header_proof`] +""" + pass + +_UniffiTempGetLightBlockHeaderProofError = GetLightBlockHeaderProofError + +class GetLightBlockHeaderProofError: # type: ignore + """ + struct for typed errors of method [`get_light_block_header_proof`] +""" + + class Status401(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLightBlockHeaderProofError.Status401({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLightBlockHeaderProofError.Status404({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.Status404 = Status404 # type: ignore + class Status408(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLightBlockHeaderProofError.Status408({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.Status408 = Status408 # type: ignore + class Status500(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLightBlockHeaderProofError.Status500({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLightBlockHeaderProofError.Status503({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self): + pass + + def __repr__(self): + return "GetLightBlockHeaderProofError.Statusdefault({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self): + pass + + def __repr__(self): + return "GetLightBlockHeaderProofError.DefaultResponse({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetLightBlockHeaderProofError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetLightBlockHeaderProofError.UnknownValue({})".format(str(self)) + _UniffiTempGetLightBlockHeaderProofError.UnknownValue = UnknownValue # type: ignore + +GetLightBlockHeaderProofError = _UniffiTempGetLightBlockHeaderProofError # type: ignore +del _UniffiTempGetLightBlockHeaderProofError + + +class _UniffiFfiConverterTypeGetLightBlockHeaderProofError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetLightBlockHeaderProofError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetLightBlockHeaderProofError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetLightBlockHeaderProofError.Status408( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetLightBlockHeaderProofError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetLightBlockHeaderProofError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 6: + return GetLightBlockHeaderProofError.Statusdefault( + ) + if variant == 7: + return GetLightBlockHeaderProofError.DefaultResponse( + ) + if variant == 8: + return GetLightBlockHeaderProofError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetLightBlockHeaderProofError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLightBlockHeaderProofError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLightBlockHeaderProofError.Status408): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLightBlockHeaderProofError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLightBlockHeaderProofError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetLightBlockHeaderProofError.Statusdefault): + return + if isinstance(value, GetLightBlockHeaderProofError.DefaultResponse): + return + if isinstance(value, GetLightBlockHeaderProofError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetLightBlockHeaderProofError.Status401): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLightBlockHeaderProofError.Status404): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLightBlockHeaderProofError.Status408): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLightBlockHeaderProofError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLightBlockHeaderProofError.Status503): + buf.write_i32(5) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetLightBlockHeaderProofError.Statusdefault): + buf.write_i32(6) + if isinstance(value, GetLightBlockHeaderProofError.DefaultResponse): + buf.write_i32(7) + if isinstance(value, GetLightBlockHeaderProofError.UnknownValue): + buf.write_i32(8) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetApplicationByIdError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetApplicationByIdError(Exception): + """ + struct for typed errors of method [`get_application_by_id`] +""" + pass + +_UniffiTempGetApplicationByIdError = GetApplicationByIdError + +class GetApplicationByIdError: # type: ignore + """ + struct for typed errors of method [`get_application_by_id`] +""" + + class Status400(_UniffiTempGetApplicationByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationByIdError.Status400({})".format(str(self)) + _UniffiTempGetApplicationByIdError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetApplicationByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationByIdError.Status401({})".format(str(self)) + _UniffiTempGetApplicationByIdError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetApplicationByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationByIdError.Status404({})".format(str(self)) + _UniffiTempGetApplicationByIdError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetApplicationByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationByIdError.Status500({})".format(str(self)) + _UniffiTempGetApplicationByIdError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetApplicationByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "GetApplicationByIdError.Statusdefault({})".format(str(self)) + _UniffiTempGetApplicationByIdError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetApplicationByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "GetApplicationByIdError.DefaultResponse({})".format(str(self)) + _UniffiTempGetApplicationByIdError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetApplicationByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationByIdError.UnknownValue({})".format(str(self)) + _UniffiTempGetApplicationByIdError.UnknownValue = UnknownValue # type: ignore + +GetApplicationByIdError = _UniffiTempGetApplicationByIdError # type: ignore +del _UniffiTempGetApplicationByIdError + + +class _UniffiFfiConverterTypeGetApplicationByIdError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetApplicationByIdError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetApplicationByIdError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetApplicationByIdError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetApplicationByIdError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetApplicationByIdError.Statusdefault( + ) + if variant == 6: + return GetApplicationByIdError.DefaultResponse( + ) + if variant == 7: + return GetApplicationByIdError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetApplicationByIdError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationByIdError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationByIdError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationByIdError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationByIdError.Statusdefault): + return + if isinstance(value, GetApplicationByIdError.DefaultResponse): + return + if isinstance(value, GetApplicationByIdError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetApplicationByIdError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationByIdError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationByIdError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationByIdError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationByIdError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetApplicationByIdError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetApplicationByIdError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetApplicationBoxesError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetApplicationBoxesError(Exception): + """ + struct for typed errors of method [`get_application_boxes`] +""" + pass + +_UniffiTempGetApplicationBoxesError = GetApplicationBoxesError + +class GetApplicationBoxesError: # type: ignore + """ + struct for typed errors of method [`get_application_boxes`] +""" + + class Status400(_UniffiTempGetApplicationBoxesError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxesError.Status400({})".format(str(self)) + _UniffiTempGetApplicationBoxesError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetApplicationBoxesError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxesError.Status401({})".format(str(self)) + _UniffiTempGetApplicationBoxesError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempGetApplicationBoxesError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxesError.Status500({})".format(str(self)) + _UniffiTempGetApplicationBoxesError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetApplicationBoxesError): + + def __init__(self): + pass + + def __repr__(self): + return "GetApplicationBoxesError.Statusdefault({})".format(str(self)) + _UniffiTempGetApplicationBoxesError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetApplicationBoxesError): + + def __init__(self): + pass + + def __repr__(self): + return "GetApplicationBoxesError.DefaultResponse({})".format(str(self)) + _UniffiTempGetApplicationBoxesError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetApplicationBoxesError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxesError.UnknownValue({})".format(str(self)) + _UniffiTempGetApplicationBoxesError.UnknownValue = UnknownValue # type: ignore + +GetApplicationBoxesError = _UniffiTempGetApplicationBoxesError # type: ignore +del _UniffiTempGetApplicationBoxesError + + +class _UniffiFfiConverterTypeGetApplicationBoxesError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetApplicationBoxesError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetApplicationBoxesError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetApplicationBoxesError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetApplicationBoxesError.Statusdefault( + ) + if variant == 5: + return GetApplicationBoxesError.DefaultResponse( + ) + if variant == 6: + return GetApplicationBoxesError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetApplicationBoxesError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxesError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxesError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxesError.Statusdefault): + return + if isinstance(value, GetApplicationBoxesError.DefaultResponse): + return + if isinstance(value, GetApplicationBoxesError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetApplicationBoxesError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxesError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxesError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxesError.Statusdefault): + buf.write_i32(4) + if isinstance(value, GetApplicationBoxesError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, GetApplicationBoxesError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetApplicationBoxByNameError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetApplicationBoxByNameError(Exception): + """ + struct for typed errors of method [`get_application_box_by_name`] +""" + pass + +_UniffiTempGetApplicationBoxByNameError = GetApplicationBoxByNameError + +class GetApplicationBoxByNameError: # type: ignore + """ + struct for typed errors of method [`get_application_box_by_name`] +""" + + class Status400(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxByNameError.Status400({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxByNameError.Status401({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxByNameError.Status404({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxByNameError.Status500({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self): + pass + + def __repr__(self): + return "GetApplicationBoxByNameError.Statusdefault({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self): + pass + + def __repr__(self): + return "GetApplicationBoxByNameError.DefaultResponse({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetApplicationBoxByNameError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetApplicationBoxByNameError.UnknownValue({})".format(str(self)) + _UniffiTempGetApplicationBoxByNameError.UnknownValue = UnknownValue # type: ignore + +GetApplicationBoxByNameError = _UniffiTempGetApplicationBoxByNameError # type: ignore +del _UniffiTempGetApplicationBoxByNameError + + +class _UniffiFfiConverterTypeGetApplicationBoxByNameError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetApplicationBoxByNameError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetApplicationBoxByNameError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetApplicationBoxByNameError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetApplicationBoxByNameError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetApplicationBoxByNameError.Statusdefault( + ) + if variant == 6: + return GetApplicationBoxByNameError.DefaultResponse( + ) + if variant == 7: + return GetApplicationBoxByNameError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetApplicationBoxByNameError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxByNameError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxByNameError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxByNameError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetApplicationBoxByNameError.Statusdefault): + return + if isinstance(value, GetApplicationBoxByNameError.DefaultResponse): + return + if isinstance(value, GetApplicationBoxByNameError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetApplicationBoxByNameError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxByNameError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxByNameError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxByNameError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetApplicationBoxByNameError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetApplicationBoxByNameError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetApplicationBoxByNameError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetAssetByIdError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetAssetByIdError(Exception): + """ + struct for typed errors of method [`get_asset_by_id`] +""" + pass + +_UniffiTempGetAssetByIdError = GetAssetByIdError + +class GetAssetByIdError: # type: ignore + """ + struct for typed errors of method [`get_asset_by_id`] +""" + + class Status400(_UniffiTempGetAssetByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetAssetByIdError.Status400({})".format(str(self)) + _UniffiTempGetAssetByIdError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetAssetByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetAssetByIdError.Status401({})".format(str(self)) + _UniffiTempGetAssetByIdError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempGetAssetByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetAssetByIdError.Status404({})".format(str(self)) + _UniffiTempGetAssetByIdError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempGetAssetByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetAssetByIdError.Status500({})".format(str(self)) + _UniffiTempGetAssetByIdError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempGetAssetByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "GetAssetByIdError.Statusdefault({})".format(str(self)) + _UniffiTempGetAssetByIdError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetAssetByIdError): + + def __init__(self): + pass + + def __repr__(self): + return "GetAssetByIdError.DefaultResponse({})".format(str(self)) + _UniffiTempGetAssetByIdError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetAssetByIdError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetAssetByIdError.UnknownValue({})".format(str(self)) + _UniffiTempGetAssetByIdError.UnknownValue = UnknownValue # type: ignore + +GetAssetByIdError = _UniffiTempGetAssetByIdError # type: ignore +del _UniffiTempGetAssetByIdError + + +class _UniffiFfiConverterTypeGetAssetByIdError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetAssetByIdError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetAssetByIdError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetAssetByIdError.Status404( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetAssetByIdError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetAssetByIdError.Statusdefault( + ) + if variant == 6: + return GetAssetByIdError.DefaultResponse( + ) + if variant == 7: + return GetAssetByIdError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetAssetByIdError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetAssetByIdError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetAssetByIdError.Status404): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetAssetByIdError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetAssetByIdError.Statusdefault): + return + if isinstance(value, GetAssetByIdError.DefaultResponse): + return + if isinstance(value, GetAssetByIdError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetAssetByIdError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetAssetByIdError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetAssetByIdError.Status404): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetAssetByIdError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetAssetByIdError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetAssetByIdError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetAssetByIdError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetSyncRoundError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetSyncRoundError(Exception): + """ + struct for typed errors of method [`get_sync_round`] +""" + pass + +_UniffiTempGetSyncRoundError = GetSyncRoundError + +class GetSyncRoundError: # type: ignore + """ + struct for typed errors of method [`get_sync_round`] +""" + + class Status400(_UniffiTempGetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSyncRoundError.Status400({})".format(str(self)) + _UniffiTempGetSyncRoundError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempGetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSyncRoundError.Status401({})".format(str(self)) + _UniffiTempGetSyncRoundError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempGetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSyncRoundError.Status500({})".format(str(self)) + _UniffiTempGetSyncRoundError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempGetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSyncRoundError.Status503({})".format(str(self)) + _UniffiTempGetSyncRoundError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempGetSyncRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "GetSyncRoundError.Statusdefault({})".format(str(self)) + _UniffiTempGetSyncRoundError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetSyncRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "GetSyncRoundError.DefaultResponse({})".format(str(self)) + _UniffiTempGetSyncRoundError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetSyncRoundError.UnknownValue({})".format(str(self)) + _UniffiTempGetSyncRoundError.UnknownValue = UnknownValue # type: ignore + +GetSyncRoundError = _UniffiTempGetSyncRoundError # type: ignore +del _UniffiTempGetSyncRoundError + + +class _UniffiFfiConverterTypeGetSyncRoundError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetSyncRoundError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetSyncRoundError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return GetSyncRoundError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return GetSyncRoundError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return GetSyncRoundError.Statusdefault( + ) + if variant == 6: + return GetSyncRoundError.DefaultResponse( + ) + if variant == 7: + return GetSyncRoundError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetSyncRoundError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetSyncRoundError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetSyncRoundError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetSyncRoundError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetSyncRoundError.Statusdefault): + return + if isinstance(value, GetSyncRoundError.DefaultResponse): + return + if isinstance(value, GetSyncRoundError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetSyncRoundError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetSyncRoundError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetSyncRoundError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetSyncRoundError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetSyncRoundError.Statusdefault): + buf.write_i32(5) + if isinstance(value, GetSyncRoundError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, GetSyncRoundError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# UnsetSyncRoundError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class UnsetSyncRoundError(Exception): + """ + struct for typed errors of method [`unset_sync_round`] +""" + pass + +_UniffiTempUnsetSyncRoundError = UnsetSyncRoundError + +class UnsetSyncRoundError: # type: ignore + """ + struct for typed errors of method [`unset_sync_round`] +""" + + class Status400(_UniffiTempUnsetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "UnsetSyncRoundError.Status400({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempUnsetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "UnsetSyncRoundError.Status401({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempUnsetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "UnsetSyncRoundError.Status500({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempUnsetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "UnsetSyncRoundError.Status503({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempUnsetSyncRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "UnsetSyncRoundError.Statusdefault({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempUnsetSyncRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "UnsetSyncRoundError.DefaultResponse({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempUnsetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "UnsetSyncRoundError.UnknownValue({})".format(str(self)) + _UniffiTempUnsetSyncRoundError.UnknownValue = UnknownValue # type: ignore + +UnsetSyncRoundError = _UniffiTempUnsetSyncRoundError # type: ignore +del _UniffiTempUnsetSyncRoundError + + +class _UniffiFfiConverterTypeUnsetSyncRoundError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return UnsetSyncRoundError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return UnsetSyncRoundError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return UnsetSyncRoundError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return UnsetSyncRoundError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return UnsetSyncRoundError.Statusdefault( + ) + if variant == 6: + return UnsetSyncRoundError.DefaultResponse( + ) + if variant == 7: + return UnsetSyncRoundError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, UnsetSyncRoundError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, UnsetSyncRoundError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, UnsetSyncRoundError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, UnsetSyncRoundError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, UnsetSyncRoundError.Statusdefault): + return + if isinstance(value, UnsetSyncRoundError.DefaultResponse): + return + if isinstance(value, UnsetSyncRoundError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, UnsetSyncRoundError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, UnsetSyncRoundError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, UnsetSyncRoundError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, UnsetSyncRoundError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, UnsetSyncRoundError.Statusdefault): + buf.write_i32(5) + if isinstance(value, UnsetSyncRoundError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, UnsetSyncRoundError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# SetSyncRoundError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class SetSyncRoundError(Exception): + """ + struct for typed errors of method [`set_sync_round`] +""" + pass + +_UniffiTempSetSyncRoundError = SetSyncRoundError + +class SetSyncRoundError: # type: ignore + """ + struct for typed errors of method [`set_sync_round`] +""" + + class Status400(_UniffiTempSetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetSyncRoundError.Status400({})".format(str(self)) + _UniffiTempSetSyncRoundError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempSetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetSyncRoundError.Status401({})".format(str(self)) + _UniffiTempSetSyncRoundError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempSetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetSyncRoundError.Status500({})".format(str(self)) + _UniffiTempSetSyncRoundError.Status500 = Status500 # type: ignore + class Status503(_UniffiTempSetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetSyncRoundError.Status503({})".format(str(self)) + _UniffiTempSetSyncRoundError.Status503 = Status503 # type: ignore + class Statusdefault(_UniffiTempSetSyncRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "SetSyncRoundError.Statusdefault({})".format(str(self)) + _UniffiTempSetSyncRoundError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempSetSyncRoundError): + + def __init__(self): + pass + + def __repr__(self): + return "SetSyncRoundError.DefaultResponse({})".format(str(self)) + _UniffiTempSetSyncRoundError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempSetSyncRoundError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetSyncRoundError.UnknownValue({})".format(str(self)) + _UniffiTempSetSyncRoundError.UnknownValue = UnknownValue # type: ignore + +SetSyncRoundError = _UniffiTempSetSyncRoundError # type: ignore +del _UniffiTempSetSyncRoundError + + +class _UniffiFfiConverterTypeSetSyncRoundError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return SetSyncRoundError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return SetSyncRoundError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return SetSyncRoundError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return SetSyncRoundError.Status503( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return SetSyncRoundError.Statusdefault( + ) + if variant == 6: + return SetSyncRoundError.DefaultResponse( + ) + if variant == 7: + return SetSyncRoundError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, SetSyncRoundError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetSyncRoundError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetSyncRoundError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetSyncRoundError.Status503): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetSyncRoundError.Statusdefault): + return + if isinstance(value, SetSyncRoundError.DefaultResponse): + return + if isinstance(value, SetSyncRoundError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, SetSyncRoundError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetSyncRoundError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetSyncRoundError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetSyncRoundError.Status503): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetSyncRoundError.Statusdefault): + buf.write_i32(5) + if isinstance(value, SetSyncRoundError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, SetSyncRoundError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# TealCompileError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class TealCompileError(Exception): + """ + struct for typed errors of method [`teal_compile`] +""" + pass + +_UniffiTempTealCompileError = TealCompileError + +class TealCompileError: # type: ignore + """ + struct for typed errors of method [`teal_compile`] +""" + + class Status400(_UniffiTempTealCompileError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealCompileError.Status400({})".format(str(self)) + _UniffiTempTealCompileError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempTealCompileError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealCompileError.Status401({})".format(str(self)) + _UniffiTempTealCompileError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempTealCompileError): + + def __init__(self): + pass + + def __repr__(self): + return "TealCompileError.Status404({})".format(str(self)) + _UniffiTempTealCompileError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempTealCompileError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealCompileError.Status500({})".format(str(self)) + _UniffiTempTealCompileError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempTealCompileError): + + def __init__(self): + pass + + def __repr__(self): + return "TealCompileError.Statusdefault({})".format(str(self)) + _UniffiTempTealCompileError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempTealCompileError): + + def __init__(self): + pass + + def __repr__(self): + return "TealCompileError.DefaultResponse({})".format(str(self)) + _UniffiTempTealCompileError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempTealCompileError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealCompileError.UnknownValue({})".format(str(self)) + _UniffiTempTealCompileError.UnknownValue = UnknownValue # type: ignore + +TealCompileError = _UniffiTempTealCompileError # type: ignore +del _UniffiTempTealCompileError + + +class _UniffiFfiConverterTypeTealCompileError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TealCompileError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return TealCompileError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return TealCompileError.Status404( + ) + if variant == 4: + return TealCompileError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return TealCompileError.Statusdefault( + ) + if variant == 6: + return TealCompileError.DefaultResponse( + ) + if variant == 7: + return TealCompileError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, TealCompileError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealCompileError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealCompileError.Status404): + return + if isinstance(value, TealCompileError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealCompileError.Statusdefault): + return + if isinstance(value, TealCompileError.DefaultResponse): + return + if isinstance(value, TealCompileError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, TealCompileError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealCompileError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealCompileError.Status404): + buf.write_i32(3) + if isinstance(value, TealCompileError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealCompileError.Statusdefault): + buf.write_i32(5) + if isinstance(value, TealCompileError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, TealCompileError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# TealDisassembleError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class TealDisassembleError(Exception): + """ + struct for typed errors of method [`teal_disassemble`] +""" + pass + +_UniffiTempTealDisassembleError = TealDisassembleError + +class TealDisassembleError: # type: ignore + """ + struct for typed errors of method [`teal_disassemble`] +""" + + class Status400(_UniffiTempTealDisassembleError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDisassembleError.Status400({})".format(str(self)) + _UniffiTempTealDisassembleError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempTealDisassembleError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDisassembleError.Status401({})".format(str(self)) + _UniffiTempTealDisassembleError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempTealDisassembleError): + + def __init__(self): + pass + + def __repr__(self): + return "TealDisassembleError.Status404({})".format(str(self)) + _UniffiTempTealDisassembleError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempTealDisassembleError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDisassembleError.Status500({})".format(str(self)) + _UniffiTempTealDisassembleError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempTealDisassembleError): + + def __init__(self): + pass + + def __repr__(self): + return "TealDisassembleError.Statusdefault({})".format(str(self)) + _UniffiTempTealDisassembleError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempTealDisassembleError): + + def __init__(self): + pass + + def __repr__(self): + return "TealDisassembleError.DefaultResponse({})".format(str(self)) + _UniffiTempTealDisassembleError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempTealDisassembleError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDisassembleError.UnknownValue({})".format(str(self)) + _UniffiTempTealDisassembleError.UnknownValue = UnknownValue # type: ignore + +TealDisassembleError = _UniffiTempTealDisassembleError # type: ignore +del _UniffiTempTealDisassembleError + + +class _UniffiFfiConverterTypeTealDisassembleError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TealDisassembleError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return TealDisassembleError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return TealDisassembleError.Status404( + ) + if variant == 4: + return TealDisassembleError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return TealDisassembleError.Statusdefault( + ) + if variant == 6: + return TealDisassembleError.DefaultResponse( + ) + if variant == 7: + return TealDisassembleError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, TealDisassembleError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealDisassembleError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealDisassembleError.Status404): + return + if isinstance(value, TealDisassembleError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealDisassembleError.Statusdefault): + return + if isinstance(value, TealDisassembleError.DefaultResponse): + return + if isinstance(value, TealDisassembleError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, TealDisassembleError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealDisassembleError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealDisassembleError.Status404): + buf.write_i32(3) + if isinstance(value, TealDisassembleError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealDisassembleError.Statusdefault): + buf.write_i32(5) + if isinstance(value, TealDisassembleError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, TealDisassembleError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# StartCatchupError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class StartCatchupError(Exception): + """ + struct for typed errors of method [`start_catchup`] +""" + pass + +_UniffiTempStartCatchupError = StartCatchupError + +class StartCatchupError: # type: ignore + """ + struct for typed errors of method [`start_catchup`] +""" + + class Status400(_UniffiTempStartCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "StartCatchupError.Status400({})".format(str(self)) + _UniffiTempStartCatchupError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempStartCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "StartCatchupError.Status401({})".format(str(self)) + _UniffiTempStartCatchupError.Status401 = Status401 # type: ignore + class Status408(_UniffiTempStartCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "StartCatchupError.Status408({})".format(str(self)) + _UniffiTempStartCatchupError.Status408 = Status408 # type: ignore + class Status500(_UniffiTempStartCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "StartCatchupError.Status500({})".format(str(self)) + _UniffiTempStartCatchupError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempStartCatchupError): + + def __init__(self): + pass + + def __repr__(self): + return "StartCatchupError.Statusdefault({})".format(str(self)) + _UniffiTempStartCatchupError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempStartCatchupError): + + def __init__(self): + pass + + def __repr__(self): + return "StartCatchupError.DefaultResponse({})".format(str(self)) + _UniffiTempStartCatchupError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempStartCatchupError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "StartCatchupError.UnknownValue({})".format(str(self)) + _UniffiTempStartCatchupError.UnknownValue = UnknownValue # type: ignore + +StartCatchupError = _UniffiTempStartCatchupError # type: ignore +del _UniffiTempStartCatchupError + + +class _UniffiFfiConverterTypeStartCatchupError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return StartCatchupError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return StartCatchupError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return StartCatchupError.Status408( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return StartCatchupError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return StartCatchupError.Statusdefault( + ) + if variant == 6: + return StartCatchupError.DefaultResponse( + ) + if variant == 7: + return StartCatchupError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, StartCatchupError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, StartCatchupError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, StartCatchupError.Status408): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, StartCatchupError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, StartCatchupError.Statusdefault): + return + if isinstance(value, StartCatchupError.DefaultResponse): + return + if isinstance(value, StartCatchupError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, StartCatchupError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, StartCatchupError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, StartCatchupError.Status408): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, StartCatchupError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, StartCatchupError.Statusdefault): + buf.write_i32(5) + if isinstance(value, StartCatchupError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, StartCatchupError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# TealDryrunError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class TealDryrunError(Exception): + """ + struct for typed errors of method [`teal_dryrun`] +""" + pass + +_UniffiTempTealDryrunError = TealDryrunError + +class TealDryrunError: # type: ignore + """ + struct for typed errors of method [`teal_dryrun`] +""" + + class Status400(_UniffiTempTealDryrunError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDryrunError.Status400({})".format(str(self)) + _UniffiTempTealDryrunError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempTealDryrunError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDryrunError.Status401({})".format(str(self)) + _UniffiTempTealDryrunError.Status401 = Status401 # type: ignore + class Status404(_UniffiTempTealDryrunError): + + def __init__(self): + pass + + def __repr__(self): + return "TealDryrunError.Status404({})".format(str(self)) + _UniffiTempTealDryrunError.Status404 = Status404 # type: ignore + class Status500(_UniffiTempTealDryrunError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDryrunError.Status500({})".format(str(self)) + _UniffiTempTealDryrunError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempTealDryrunError): + + def __init__(self): + pass + + def __repr__(self): + return "TealDryrunError.Statusdefault({})".format(str(self)) + _UniffiTempTealDryrunError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempTealDryrunError): + + def __init__(self): + pass + + def __repr__(self): + return "TealDryrunError.DefaultResponse({})".format(str(self)) + _UniffiTempTealDryrunError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempTealDryrunError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "TealDryrunError.UnknownValue({})".format(str(self)) + _UniffiTempTealDryrunError.UnknownValue = UnknownValue # type: ignore + +TealDryrunError = _UniffiTempTealDryrunError # type: ignore +del _UniffiTempTealDryrunError + + +class _UniffiFfiConverterTypeTealDryrunError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TealDryrunError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return TealDryrunError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return TealDryrunError.Status404( + ) + if variant == 4: + return TealDryrunError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 5: + return TealDryrunError.Statusdefault( + ) + if variant == 6: + return TealDryrunError.DefaultResponse( + ) + if variant == 7: + return TealDryrunError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, TealDryrunError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealDryrunError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealDryrunError.Status404): + return + if isinstance(value, TealDryrunError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, TealDryrunError.Statusdefault): + return + if isinstance(value, TealDryrunError.DefaultResponse): + return + if isinstance(value, TealDryrunError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, TealDryrunError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealDryrunError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealDryrunError.Status404): + buf.write_i32(3) + if isinstance(value, TealDryrunError.Status500): + buf.write_i32(4) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, TealDryrunError.Statusdefault): + buf.write_i32(5) + if isinstance(value, TealDryrunError.DefaultResponse): + buf.write_i32(6) + if isinstance(value, TealDryrunError.UnknownValue): + buf.write_i32(7) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# ExperimentalCheckError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class ExperimentalCheckError(Exception): + """ + struct for typed errors of method [`experimental_check`] +""" + pass + +_UniffiTempExperimentalCheckError = ExperimentalCheckError + +class ExperimentalCheckError: # type: ignore + """ + struct for typed errors of method [`experimental_check`] +""" + + class Status404(_UniffiTempExperimentalCheckError): + + def __init__(self): + pass + + def __repr__(self): + return "ExperimentalCheckError.Status404({})".format(str(self)) + _UniffiTempExperimentalCheckError.Status404 = Status404 # type: ignore + class Statusdefault(_UniffiTempExperimentalCheckError): + + def __init__(self): + pass + + def __repr__(self): + return "ExperimentalCheckError.Statusdefault({})".format(str(self)) + _UniffiTempExperimentalCheckError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempExperimentalCheckError): + + def __init__(self): + pass + + def __repr__(self): + return "ExperimentalCheckError.DefaultResponse({})".format(str(self)) + _UniffiTempExperimentalCheckError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempExperimentalCheckError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "ExperimentalCheckError.UnknownValue({})".format(str(self)) + _UniffiTempExperimentalCheckError.UnknownValue = UnknownValue # type: ignore + +ExperimentalCheckError = _UniffiTempExperimentalCheckError # type: ignore +del _UniffiTempExperimentalCheckError + + +class _UniffiFfiConverterTypeExperimentalCheckError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return ExperimentalCheckError.Status404( + ) + if variant == 2: + return ExperimentalCheckError.Statusdefault( + ) + if variant == 3: + return ExperimentalCheckError.DefaultResponse( + ) + if variant == 4: + return ExperimentalCheckError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, ExperimentalCheckError.Status404): + return + if isinstance(value, ExperimentalCheckError.Statusdefault): + return + if isinstance(value, ExperimentalCheckError.DefaultResponse): + return + if isinstance(value, ExperimentalCheckError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, ExperimentalCheckError.Status404): + buf.write_i32(1) + if isinstance(value, ExperimentalCheckError.Statusdefault): + buf.write_i32(2) + if isinstance(value, ExperimentalCheckError.DefaultResponse): + buf.write_i32(3) + if isinstance(value, ExperimentalCheckError.UnknownValue): + buf.write_i32(4) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# GetBlockTimeStampOffsetError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class GetBlockTimeStampOffsetError(Exception): + """ + struct for typed errors of method [`get_block_time_stamp_offset`] +""" + pass + +_UniffiTempGetBlockTimeStampOffsetError = GetBlockTimeStampOffsetError + +class GetBlockTimeStampOffsetError: # type: ignore + """ + struct for typed errors of method [`get_block_time_stamp_offset`] +""" + + class Status400(_UniffiTempGetBlockTimeStampOffsetError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTimeStampOffsetError.Status400({})".format(str(self)) + _UniffiTempGetBlockTimeStampOffsetError.Status400 = Status400 # type: ignore + class Statusdefault(_UniffiTempGetBlockTimeStampOffsetError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockTimeStampOffsetError.Statusdefault({})".format(str(self)) + _UniffiTempGetBlockTimeStampOffsetError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempGetBlockTimeStampOffsetError): + + def __init__(self): + pass + + def __repr__(self): + return "GetBlockTimeStampOffsetError.DefaultResponse({})".format(str(self)) + _UniffiTempGetBlockTimeStampOffsetError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempGetBlockTimeStampOffsetError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "GetBlockTimeStampOffsetError.UnknownValue({})".format(str(self)) + _UniffiTempGetBlockTimeStampOffsetError.UnknownValue = UnknownValue # type: ignore + +GetBlockTimeStampOffsetError = _UniffiTempGetBlockTimeStampOffsetError # type: ignore +del _UniffiTempGetBlockTimeStampOffsetError + + +class _UniffiFfiConverterTypeGetBlockTimeStampOffsetError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return GetBlockTimeStampOffsetError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return GetBlockTimeStampOffsetError.Statusdefault( + ) + if variant == 3: + return GetBlockTimeStampOffsetError.DefaultResponse( + ) + if variant == 4: + return GetBlockTimeStampOffsetError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, GetBlockTimeStampOffsetError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, GetBlockTimeStampOffsetError.Statusdefault): + return + if isinstance(value, GetBlockTimeStampOffsetError.DefaultResponse): + return + if isinstance(value, GetBlockTimeStampOffsetError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, GetBlockTimeStampOffsetError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, GetBlockTimeStampOffsetError.Statusdefault): + buf.write_i32(2) + if isinstance(value, GetBlockTimeStampOffsetError.DefaultResponse): + buf.write_i32(3) + if isinstance(value, GetBlockTimeStampOffsetError.UnknownValue): + buf.write_i32(4) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# SetBlockTimeStampOffsetError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class SetBlockTimeStampOffsetError(Exception): + """ + struct for typed errors of method [`set_block_time_stamp_offset`] +""" + pass + +_UniffiTempSetBlockTimeStampOffsetError = SetBlockTimeStampOffsetError + +class SetBlockTimeStampOffsetError: # type: ignore + """ + struct for typed errors of method [`set_block_time_stamp_offset`] +""" + + class Status400(_UniffiTempSetBlockTimeStampOffsetError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetBlockTimeStampOffsetError.Status400({})".format(str(self)) + _UniffiTempSetBlockTimeStampOffsetError.Status400 = Status400 # type: ignore + class Status401(_UniffiTempSetBlockTimeStampOffsetError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetBlockTimeStampOffsetError.Status401({})".format(str(self)) + _UniffiTempSetBlockTimeStampOffsetError.Status401 = Status401 # type: ignore + class Status500(_UniffiTempSetBlockTimeStampOffsetError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], ErrorResponse): + raise TypeError(f"unexpected type for tuple element 0 - expected 'ErrorResponse', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetBlockTimeStampOffsetError.Status500({})".format(str(self)) + _UniffiTempSetBlockTimeStampOffsetError.Status500 = Status500 # type: ignore + class Statusdefault(_UniffiTempSetBlockTimeStampOffsetError): + + def __init__(self): + pass + + def __repr__(self): + return "SetBlockTimeStampOffsetError.Statusdefault({})".format(str(self)) + _UniffiTempSetBlockTimeStampOffsetError.Statusdefault = Statusdefault # type: ignore + class DefaultResponse(_UniffiTempSetBlockTimeStampOffsetError): + + def __init__(self): + pass + + def __repr__(self): + return "SetBlockTimeStampOffsetError.DefaultResponse({})".format(str(self)) + _UniffiTempSetBlockTimeStampOffsetError.DefaultResponse = DefaultResponse # type: ignore + class UnknownValue(_UniffiTempSetBlockTimeStampOffsetError): + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + if not isinstance(values[0], UnknownJsonValue): + raise TypeError(f"unexpected type for tuple element 0 - expected 'UnknownJsonValue', got '{type(values[0])}'") + super().__init__(", ".join(map(repr, values))) + self._values = values + + def __getitem__(self, index): + return self._values[index] + + def __repr__(self): + return "SetBlockTimeStampOffsetError.UnknownValue({})".format(str(self)) + _UniffiTempSetBlockTimeStampOffsetError.UnknownValue = UnknownValue # type: ignore + +SetBlockTimeStampOffsetError = _UniffiTempSetBlockTimeStampOffsetError # type: ignore +del _UniffiTempSetBlockTimeStampOffsetError + + +class _UniffiFfiConverterTypeSetBlockTimeStampOffsetError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return SetBlockTimeStampOffsetError.Status400( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 2: + return SetBlockTimeStampOffsetError.Status401( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 3: + return SetBlockTimeStampOffsetError.Status500( + _UniffiFfiConverterTypeErrorResponse.read(buf), + ) + if variant == 4: + return SetBlockTimeStampOffsetError.Statusdefault( + ) + if variant == 5: + return SetBlockTimeStampOffsetError.DefaultResponse( + ) + if variant == 6: + return SetBlockTimeStampOffsetError.UnknownValue( + _UniffiFfiConverterTypeUnknownJsonValue.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, SetBlockTimeStampOffsetError.Status400): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetBlockTimeStampOffsetError.Status401): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetBlockTimeStampOffsetError.Status500): + _UniffiFfiConverterTypeErrorResponse.check_lower(value._values[0]) + return + if isinstance(value, SetBlockTimeStampOffsetError.Statusdefault): + return + if isinstance(value, SetBlockTimeStampOffsetError.DefaultResponse): + return + if isinstance(value, SetBlockTimeStampOffsetError.UnknownValue): + _UniffiFfiConverterTypeUnknownJsonValue.check_lower(value._values[0]) + return + + @staticmethod + def write(value, buf): + if isinstance(value, SetBlockTimeStampOffsetError.Status400): + buf.write_i32(1) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetBlockTimeStampOffsetError.Status401): + buf.write_i32(2) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetBlockTimeStampOffsetError.Status500): + buf.write_i32(3) + _UniffiFfiConverterTypeErrorResponse.write(value._values[0], buf) + if isinstance(value, SetBlockTimeStampOffsetError.Statusdefault): + buf.write_i32(4) + if isinstance(value, SetBlockTimeStampOffsetError.DefaultResponse): + buf.write_i32(5) + if isinstance(value, SetBlockTimeStampOffsetError.UnknownValue): + buf.write_i32(6) + _UniffiFfiConverterTypeUnknownJsonValue.write(value._values[0], buf) + + + +# AlgodApiError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AlgodApiError(Exception): + """ + Unified error type that can represent any API error from any endpoint +""" + pass + +_UniffiTempAlgodApiError = AlgodApiError + +class AlgodApiError: # type: ignore + """ + Unified error type that can represent any API error from any endpoint +""" + + class HealthCheck(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.HealthCheck({})".format(str(self)) + _UniffiTempAlgodApiError.HealthCheck = HealthCheck # type: ignore + class GetReady(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetReady({})".format(str(self)) + _UniffiTempAlgodApiError.GetReady = GetReady # type: ignore + class Metrics(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.Metrics({})".format(str(self)) + _UniffiTempAlgodApiError.Metrics = Metrics # type: ignore + class GetGenesis(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetGenesis({})".format(str(self)) + _UniffiTempAlgodApiError.GetGenesis = GetGenesis # type: ignore + class SwaggerJson(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.SwaggerJson({})".format(str(self)) + _UniffiTempAlgodApiError.SwaggerJson = SwaggerJson # type: ignore + class GetVersion(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetVersion({})".format(str(self)) + _UniffiTempAlgodApiError.GetVersion = GetVersion # type: ignore + class GetDebugSettingsProf(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetDebugSettingsProf({})".format(str(self)) + _UniffiTempAlgodApiError.GetDebugSettingsProf = GetDebugSettingsProf # type: ignore + class PutDebugSettingsProf(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.PutDebugSettingsProf({})".format(str(self)) + _UniffiTempAlgodApiError.PutDebugSettingsProf = PutDebugSettingsProf # type: ignore + class GetConfig(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetConfig({})".format(str(self)) + _UniffiTempAlgodApiError.GetConfig = GetConfig # type: ignore + class AccountInformation(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AccountInformation({})".format(str(self)) + _UniffiTempAlgodApiError.AccountInformation = AccountInformation # type: ignore + class AccountAssetInformation(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AccountAssetInformation({})".format(str(self)) + _UniffiTempAlgodApiError.AccountAssetInformation = AccountAssetInformation # type: ignore + class AccountAssetsInformation(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AccountAssetsInformation({})".format(str(self)) + _UniffiTempAlgodApiError.AccountAssetsInformation = AccountAssetsInformation # type: ignore + class AccountApplicationInformation(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AccountApplicationInformation({})".format(str(self)) + _UniffiTempAlgodApiError.AccountApplicationInformation = AccountApplicationInformation # type: ignore + class GetPendingTransactionsByAddress(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetPendingTransactionsByAddress({})".format(str(self)) + _UniffiTempAlgodApiError.GetPendingTransactionsByAddress = GetPendingTransactionsByAddress # type: ignore + class GetBlock(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetBlock({})".format(str(self)) + _UniffiTempAlgodApiError.GetBlock = GetBlock # type: ignore + class GetBlockTxids(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetBlockTxids({})".format(str(self)) + _UniffiTempAlgodApiError.GetBlockTxids = GetBlockTxids # type: ignore + class GetBlockHash(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetBlockHash({})".format(str(self)) + _UniffiTempAlgodApiError.GetBlockHash = GetBlockHash # type: ignore + class GetTransactionProof(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetTransactionProof({})".format(str(self)) + _UniffiTempAlgodApiError.GetTransactionProof = GetTransactionProof # type: ignore + class GetBlockLogs(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetBlockLogs({})".format(str(self)) + _UniffiTempAlgodApiError.GetBlockLogs = GetBlockLogs # type: ignore + class GetSupply(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetSupply({})".format(str(self)) + _UniffiTempAlgodApiError.GetSupply = GetSupply # type: ignore + class GetParticipationKeys(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetParticipationKeys({})".format(str(self)) + _UniffiTempAlgodApiError.GetParticipationKeys = GetParticipationKeys # type: ignore + class AddParticipationKey(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AddParticipationKey({})".format(str(self)) + _UniffiTempAlgodApiError.AddParticipationKey = AddParticipationKey # type: ignore + class GenerateParticipationKeys(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GenerateParticipationKeys({})".format(str(self)) + _UniffiTempAlgodApiError.GenerateParticipationKeys = GenerateParticipationKeys # type: ignore + class GetParticipationKeyById(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetParticipationKeyById({})".format(str(self)) + _UniffiTempAlgodApiError.GetParticipationKeyById = GetParticipationKeyById # type: ignore + class AppendKeys(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AppendKeys({})".format(str(self)) + _UniffiTempAlgodApiError.AppendKeys = AppendKeys # type: ignore + class DeleteParticipationKeyById(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.DeleteParticipationKeyById({})".format(str(self)) + _UniffiTempAlgodApiError.DeleteParticipationKeyById = DeleteParticipationKeyById # type: ignore + class ShutdownNode(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.ShutdownNode({})".format(str(self)) + _UniffiTempAlgodApiError.ShutdownNode = ShutdownNode # type: ignore + class GetStatus(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetStatus({})".format(str(self)) + _UniffiTempAlgodApiError.GetStatus = GetStatus # type: ignore + class WaitForBlock(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.WaitForBlock({})".format(str(self)) + _UniffiTempAlgodApiError.WaitForBlock = WaitForBlock # type: ignore + class RawTransaction(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.RawTransaction({})".format(str(self)) + _UniffiTempAlgodApiError.RawTransaction = RawTransaction # type: ignore + class RawTransactionAsync(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.RawTransactionAsync({})".format(str(self)) + _UniffiTempAlgodApiError.RawTransactionAsync = RawTransactionAsync # type: ignore + class SimulateTransaction(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.SimulateTransaction({})".format(str(self)) + _UniffiTempAlgodApiError.SimulateTransaction = SimulateTransaction # type: ignore + class TransactionParams(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.TransactionParams({})".format(str(self)) + _UniffiTempAlgodApiError.TransactionParams = TransactionParams # type: ignore + class GetPendingTransactions(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetPendingTransactions({})".format(str(self)) + _UniffiTempAlgodApiError.GetPendingTransactions = GetPendingTransactions # type: ignore + class PendingTransactionInformation(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.PendingTransactionInformation({})".format(str(self)) + _UniffiTempAlgodApiError.PendingTransactionInformation = PendingTransactionInformation # type: ignore + class GetLedgerStateDelta(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetLedgerStateDelta({})".format(str(self)) + _UniffiTempAlgodApiError.GetLedgerStateDelta = GetLedgerStateDelta # type: ignore + class GetTransactionGroupLedgerStateDeltasForRound(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetTransactionGroupLedgerStateDeltasForRound({})".format(str(self)) + _UniffiTempAlgodApiError.GetTransactionGroupLedgerStateDeltasForRound = GetTransactionGroupLedgerStateDeltasForRound # type: ignore + class GetLedgerStateDeltaForTransactionGroup(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetLedgerStateDeltaForTransactionGroup({})".format(str(self)) + _UniffiTempAlgodApiError.GetLedgerStateDeltaForTransactionGroup = GetLedgerStateDeltaForTransactionGroup # type: ignore + class GetStateProof(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetStateProof({})".format(str(self)) + _UniffiTempAlgodApiError.GetStateProof = GetStateProof # type: ignore + class GetLightBlockHeaderProof(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetLightBlockHeaderProof({})".format(str(self)) + _UniffiTempAlgodApiError.GetLightBlockHeaderProof = GetLightBlockHeaderProof # type: ignore + class GetApplicationById(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetApplicationById({})".format(str(self)) + _UniffiTempAlgodApiError.GetApplicationById = GetApplicationById # type: ignore + class GetApplicationBoxes(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetApplicationBoxes({})".format(str(self)) + _UniffiTempAlgodApiError.GetApplicationBoxes = GetApplicationBoxes # type: ignore + class GetApplicationBoxByName(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetApplicationBoxByName({})".format(str(self)) + _UniffiTempAlgodApiError.GetApplicationBoxByName = GetApplicationBoxByName # type: ignore + class GetAssetById(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetAssetById({})".format(str(self)) + _UniffiTempAlgodApiError.GetAssetById = GetAssetById # type: ignore + class GetSyncRound(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetSyncRound({})".format(str(self)) + _UniffiTempAlgodApiError.GetSyncRound = GetSyncRound # type: ignore + class UnsetSyncRound(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.UnsetSyncRound({})".format(str(self)) + _UniffiTempAlgodApiError.UnsetSyncRound = UnsetSyncRound # type: ignore + class SetSyncRound(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.SetSyncRound({})".format(str(self)) + _UniffiTempAlgodApiError.SetSyncRound = SetSyncRound # type: ignore + class TealCompile(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.TealCompile({})".format(str(self)) + _UniffiTempAlgodApiError.TealCompile = TealCompile # type: ignore + class TealDisassemble(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.TealDisassemble({})".format(str(self)) + _UniffiTempAlgodApiError.TealDisassemble = TealDisassemble # type: ignore + class StartCatchup(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.StartCatchup({})".format(str(self)) + _UniffiTempAlgodApiError.StartCatchup = StartCatchup # type: ignore + class AbortCatchup(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.AbortCatchup({})".format(str(self)) + _UniffiTempAlgodApiError.AbortCatchup = AbortCatchup # type: ignore + class TealDryrun(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.TealDryrun({})".format(str(self)) + _UniffiTempAlgodApiError.TealDryrun = TealDryrun # type: ignore + class ExperimentalCheck(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.ExperimentalCheck({})".format(str(self)) + _UniffiTempAlgodApiError.ExperimentalCheck = ExperimentalCheck # type: ignore + class GetBlockTimeStampOffset(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.GetBlockTimeStampOffset({})".format(str(self)) + _UniffiTempAlgodApiError.GetBlockTimeStampOffset = GetBlockTimeStampOffset # type: ignore + class SetBlockTimeStampOffset(_UniffiTempAlgodApiError): + + def __init__(self, error): + super().__init__(", ".join([ + "error={!r}".format(error), + ])) + self.error = error + + def __repr__(self): + return "AlgodApiError.SetBlockTimeStampOffset({})".format(str(self)) + _UniffiTempAlgodApiError.SetBlockTimeStampOffset = SetBlockTimeStampOffset # type: ignore + class Unknown(_UniffiTempAlgodApiError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "AlgodApiError.Unknown({})".format(str(self)) + _UniffiTempAlgodApiError.Unknown = Unknown # type: ignore + +AlgodApiError = _UniffiTempAlgodApiError # type: ignore +del _UniffiTempAlgodApiError + + +class _UniffiFfiConverterTypeAlgodApiError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AlgodApiError.HealthCheck( + _UniffiFfiConverterTypeHealthCheckError.read(buf), + ) + if variant == 2: + return AlgodApiError.GetReady( + _UniffiFfiConverterTypeGetReadyError.read(buf), + ) + if variant == 3: + return AlgodApiError.Metrics( + _UniffiFfiConverterTypeMetricsError.read(buf), + ) + if variant == 4: + return AlgodApiError.GetGenesis( + _UniffiFfiConverterTypeGetGenesisError.read(buf), + ) + if variant == 5: + return AlgodApiError.SwaggerJson( + _UniffiFfiConverterTypeSwaggerJsonError.read(buf), + ) + if variant == 6: + return AlgodApiError.GetVersion( + _UniffiFfiConverterTypeGetVersionError.read(buf), + ) + if variant == 7: + return AlgodApiError.GetDebugSettingsProf( + _UniffiFfiConverterTypeGetDebugSettingsProfError.read(buf), + ) + if variant == 8: + return AlgodApiError.PutDebugSettingsProf( + _UniffiFfiConverterTypePutDebugSettingsProfError.read(buf), + ) + if variant == 9: + return AlgodApiError.GetConfig( + _UniffiFfiConverterTypeGetConfigError.read(buf), + ) + if variant == 10: + return AlgodApiError.AccountInformation( + _UniffiFfiConverterTypeAccountInformationError.read(buf), + ) + if variant == 11: + return AlgodApiError.AccountAssetInformation( + _UniffiFfiConverterTypeAccountAssetInformationError.read(buf), + ) + if variant == 12: + return AlgodApiError.AccountAssetsInformation( + _UniffiFfiConverterTypeAccountAssetsInformationError.read(buf), + ) + if variant == 13: + return AlgodApiError.AccountApplicationInformation( + _UniffiFfiConverterTypeAccountApplicationInformationError.read(buf), + ) + if variant == 14: + return AlgodApiError.GetPendingTransactionsByAddress( + _UniffiFfiConverterTypeGetPendingTransactionsByAddressError.read(buf), + ) + if variant == 15: + return AlgodApiError.GetBlock( + _UniffiFfiConverterTypeGetBlockError.read(buf), + ) + if variant == 16: + return AlgodApiError.GetBlockTxids( + _UniffiFfiConverterTypeGetBlockTxidsError.read(buf), + ) + if variant == 17: + return AlgodApiError.GetBlockHash( + _UniffiFfiConverterTypeGetBlockHashError.read(buf), + ) + if variant == 18: + return AlgodApiError.GetTransactionProof( + _UniffiFfiConverterTypeGetTransactionProofError.read(buf), + ) + if variant == 19: + return AlgodApiError.GetBlockLogs( + _UniffiFfiConverterTypeGetBlockLogsError.read(buf), + ) + if variant == 20: + return AlgodApiError.GetSupply( + _UniffiFfiConverterTypeGetSupplyError.read(buf), + ) + if variant == 21: + return AlgodApiError.GetParticipationKeys( + _UniffiFfiConverterTypeGetParticipationKeysError.read(buf), + ) + if variant == 22: + return AlgodApiError.AddParticipationKey( + _UniffiFfiConverterTypeAddParticipationKeyError.read(buf), + ) + if variant == 23: + return AlgodApiError.GenerateParticipationKeys( + _UniffiFfiConverterTypeGenerateParticipationKeysError.read(buf), + ) + if variant == 24: + return AlgodApiError.GetParticipationKeyById( + _UniffiFfiConverterTypeGetParticipationKeyByIdError.read(buf), + ) + if variant == 25: + return AlgodApiError.AppendKeys( + _UniffiFfiConverterTypeAppendKeysError.read(buf), + ) + if variant == 26: + return AlgodApiError.DeleteParticipationKeyById( + _UniffiFfiConverterTypeDeleteParticipationKeyByIdError.read(buf), + ) + if variant == 27: + return AlgodApiError.ShutdownNode( + _UniffiFfiConverterTypeShutdownNodeError.read(buf), + ) + if variant == 28: + return AlgodApiError.GetStatus( + _UniffiFfiConverterTypeGetStatusError.read(buf), + ) + if variant == 29: + return AlgodApiError.WaitForBlock( + _UniffiFfiConverterTypeWaitForBlockError.read(buf), + ) + if variant == 30: + return AlgodApiError.RawTransaction( + _UniffiFfiConverterTypeRawTransactionError.read(buf), + ) + if variant == 31: + return AlgodApiError.RawTransactionAsync( + _UniffiFfiConverterTypeRawTransactionAsyncError.read(buf), + ) + if variant == 32: + return AlgodApiError.SimulateTransaction( + _UniffiFfiConverterTypeSimulateTransactionError.read(buf), + ) + if variant == 33: + return AlgodApiError.TransactionParams( + _UniffiFfiConverterTypeTransactionParamsError.read(buf), + ) + if variant == 34: + return AlgodApiError.GetPendingTransactions( + _UniffiFfiConverterTypeGetPendingTransactionsError.read(buf), + ) + if variant == 35: + return AlgodApiError.PendingTransactionInformation( + _UniffiFfiConverterTypePendingTransactionInformationError.read(buf), + ) + if variant == 36: + return AlgodApiError.GetLedgerStateDelta( + _UniffiFfiConverterTypeGetLedgerStateDeltaError.read(buf), + ) + if variant == 37: + return AlgodApiError.GetTransactionGroupLedgerStateDeltasForRound( + _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRoundError.read(buf), + ) + if variant == 38: + return AlgodApiError.GetLedgerStateDeltaForTransactionGroup( + _UniffiFfiConverterTypeGetLedgerStateDeltaForTransactionGroupError.read(buf), + ) + if variant == 39: + return AlgodApiError.GetStateProof( + _UniffiFfiConverterTypeGetStateProofError.read(buf), + ) + if variant == 40: + return AlgodApiError.GetLightBlockHeaderProof( + _UniffiFfiConverterTypeGetLightBlockHeaderProofError.read(buf), + ) + if variant == 41: + return AlgodApiError.GetApplicationById( + _UniffiFfiConverterTypeGetApplicationByIdError.read(buf), + ) + if variant == 42: + return AlgodApiError.GetApplicationBoxes( + _UniffiFfiConverterTypeGetApplicationBoxesError.read(buf), + ) + if variant == 43: + return AlgodApiError.GetApplicationBoxByName( + _UniffiFfiConverterTypeGetApplicationBoxByNameError.read(buf), + ) + if variant == 44: + return AlgodApiError.GetAssetById( + _UniffiFfiConverterTypeGetAssetByIdError.read(buf), + ) + if variant == 45: + return AlgodApiError.GetSyncRound( + _UniffiFfiConverterTypeGetSyncRoundError.read(buf), + ) + if variant == 46: + return AlgodApiError.UnsetSyncRound( + _UniffiFfiConverterTypeUnsetSyncRoundError.read(buf), + ) + if variant == 47: + return AlgodApiError.SetSyncRound( + _UniffiFfiConverterTypeSetSyncRoundError.read(buf), + ) + if variant == 48: + return AlgodApiError.TealCompile( + _UniffiFfiConverterTypeTealCompileError.read(buf), + ) + if variant == 49: + return AlgodApiError.TealDisassemble( + _UniffiFfiConverterTypeTealDisassembleError.read(buf), + ) + if variant == 50: + return AlgodApiError.StartCatchup( + _UniffiFfiConverterTypeStartCatchupError.read(buf), + ) + if variant == 51: + return AlgodApiError.AbortCatchup( + _UniffiFfiConverterTypeAbortCatchupError.read(buf), + ) + if variant == 52: + return AlgodApiError.TealDryrun( + _UniffiFfiConverterTypeTealDryrunError.read(buf), + ) + if variant == 53: + return AlgodApiError.ExperimentalCheck( + _UniffiFfiConverterTypeExperimentalCheckError.read(buf), + ) + if variant == 54: + return AlgodApiError.GetBlockTimeStampOffset( + _UniffiFfiConverterTypeGetBlockTimeStampOffsetError.read(buf), + ) + if variant == 55: + return AlgodApiError.SetBlockTimeStampOffset( + _UniffiFfiConverterTypeSetBlockTimeStampOffsetError.read(buf), + ) + if variant == 56: + return AlgodApiError.Unknown( + _UniffiFfiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AlgodApiError.HealthCheck): + _UniffiFfiConverterTypeHealthCheckError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetReady): + _UniffiFfiConverterTypeGetReadyError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.Metrics): + _UniffiFfiConverterTypeMetricsError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetGenesis): + _UniffiFfiConverterTypeGetGenesisError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.SwaggerJson): + _UniffiFfiConverterTypeSwaggerJsonError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetVersion): + _UniffiFfiConverterTypeGetVersionError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetDebugSettingsProf): + _UniffiFfiConverterTypeGetDebugSettingsProfError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.PutDebugSettingsProf): + _UniffiFfiConverterTypePutDebugSettingsProfError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetConfig): + _UniffiFfiConverterTypeGetConfigError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AccountInformation): + _UniffiFfiConverterTypeAccountInformationError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AccountAssetInformation): + _UniffiFfiConverterTypeAccountAssetInformationError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AccountAssetsInformation): + _UniffiFfiConverterTypeAccountAssetsInformationError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AccountApplicationInformation): + _UniffiFfiConverterTypeAccountApplicationInformationError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetPendingTransactionsByAddress): + _UniffiFfiConverterTypeGetPendingTransactionsByAddressError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetBlock): + _UniffiFfiConverterTypeGetBlockError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetBlockTxids): + _UniffiFfiConverterTypeGetBlockTxidsError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetBlockHash): + _UniffiFfiConverterTypeGetBlockHashError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetTransactionProof): + _UniffiFfiConverterTypeGetTransactionProofError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetBlockLogs): + _UniffiFfiConverterTypeGetBlockLogsError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetSupply): + _UniffiFfiConverterTypeGetSupplyError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetParticipationKeys): + _UniffiFfiConverterTypeGetParticipationKeysError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AddParticipationKey): + _UniffiFfiConverterTypeAddParticipationKeyError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GenerateParticipationKeys): + _UniffiFfiConverterTypeGenerateParticipationKeysError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetParticipationKeyById): + _UniffiFfiConverterTypeGetParticipationKeyByIdError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AppendKeys): + _UniffiFfiConverterTypeAppendKeysError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.DeleteParticipationKeyById): + _UniffiFfiConverterTypeDeleteParticipationKeyByIdError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.ShutdownNode): + _UniffiFfiConverterTypeShutdownNodeError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetStatus): + _UniffiFfiConverterTypeGetStatusError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.WaitForBlock): + _UniffiFfiConverterTypeWaitForBlockError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.RawTransaction): + _UniffiFfiConverterTypeRawTransactionError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.RawTransactionAsync): + _UniffiFfiConverterTypeRawTransactionAsyncError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.SimulateTransaction): + _UniffiFfiConverterTypeSimulateTransactionError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.TransactionParams): + _UniffiFfiConverterTypeTransactionParamsError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetPendingTransactions): + _UniffiFfiConverterTypeGetPendingTransactionsError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.PendingTransactionInformation): + _UniffiFfiConverterTypePendingTransactionInformationError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetLedgerStateDelta): + _UniffiFfiConverterTypeGetLedgerStateDeltaError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetTransactionGroupLedgerStateDeltasForRound): + _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRoundError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetLedgerStateDeltaForTransactionGroup): + _UniffiFfiConverterTypeGetLedgerStateDeltaForTransactionGroupError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetStateProof): + _UniffiFfiConverterTypeGetStateProofError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetLightBlockHeaderProof): + _UniffiFfiConverterTypeGetLightBlockHeaderProofError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetApplicationById): + _UniffiFfiConverterTypeGetApplicationByIdError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetApplicationBoxes): + _UniffiFfiConverterTypeGetApplicationBoxesError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetApplicationBoxByName): + _UniffiFfiConverterTypeGetApplicationBoxByNameError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetAssetById): + _UniffiFfiConverterTypeGetAssetByIdError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetSyncRound): + _UniffiFfiConverterTypeGetSyncRoundError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.UnsetSyncRound): + _UniffiFfiConverterTypeUnsetSyncRoundError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.SetSyncRound): + _UniffiFfiConverterTypeSetSyncRoundError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.TealCompile): + _UniffiFfiConverterTypeTealCompileError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.TealDisassemble): + _UniffiFfiConverterTypeTealDisassembleError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.StartCatchup): + _UniffiFfiConverterTypeStartCatchupError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.AbortCatchup): + _UniffiFfiConverterTypeAbortCatchupError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.TealDryrun): + _UniffiFfiConverterTypeTealDryrunError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.ExperimentalCheck): + _UniffiFfiConverterTypeExperimentalCheckError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.GetBlockTimeStampOffset): + _UniffiFfiConverterTypeGetBlockTimeStampOffsetError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.SetBlockTimeStampOffset): + _UniffiFfiConverterTypeSetBlockTimeStampOffsetError.check_lower(value.error) + return + if isinstance(value, AlgodApiError.Unknown): + _UniffiFfiConverterString.check_lower(value.message) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AlgodApiError.HealthCheck): + buf.write_i32(1) + _UniffiFfiConverterTypeHealthCheckError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetReady): + buf.write_i32(2) + _UniffiFfiConverterTypeGetReadyError.write(value.error, buf) + if isinstance(value, AlgodApiError.Metrics): + buf.write_i32(3) + _UniffiFfiConverterTypeMetricsError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetGenesis): + buf.write_i32(4) + _UniffiFfiConverterTypeGetGenesisError.write(value.error, buf) + if isinstance(value, AlgodApiError.SwaggerJson): + buf.write_i32(5) + _UniffiFfiConverterTypeSwaggerJsonError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetVersion): + buf.write_i32(6) + _UniffiFfiConverterTypeGetVersionError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetDebugSettingsProf): + buf.write_i32(7) + _UniffiFfiConverterTypeGetDebugSettingsProfError.write(value.error, buf) + if isinstance(value, AlgodApiError.PutDebugSettingsProf): + buf.write_i32(8) + _UniffiFfiConverterTypePutDebugSettingsProfError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetConfig): + buf.write_i32(9) + _UniffiFfiConverterTypeGetConfigError.write(value.error, buf) + if isinstance(value, AlgodApiError.AccountInformation): + buf.write_i32(10) + _UniffiFfiConverterTypeAccountInformationError.write(value.error, buf) + if isinstance(value, AlgodApiError.AccountAssetInformation): + buf.write_i32(11) + _UniffiFfiConverterTypeAccountAssetInformationError.write(value.error, buf) + if isinstance(value, AlgodApiError.AccountAssetsInformation): + buf.write_i32(12) + _UniffiFfiConverterTypeAccountAssetsInformationError.write(value.error, buf) + if isinstance(value, AlgodApiError.AccountApplicationInformation): + buf.write_i32(13) + _UniffiFfiConverterTypeAccountApplicationInformationError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetPendingTransactionsByAddress): + buf.write_i32(14) + _UniffiFfiConverterTypeGetPendingTransactionsByAddressError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetBlock): + buf.write_i32(15) + _UniffiFfiConverterTypeGetBlockError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetBlockTxids): + buf.write_i32(16) + _UniffiFfiConverterTypeGetBlockTxidsError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetBlockHash): + buf.write_i32(17) + _UniffiFfiConverterTypeGetBlockHashError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetTransactionProof): + buf.write_i32(18) + _UniffiFfiConverterTypeGetTransactionProofError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetBlockLogs): + buf.write_i32(19) + _UniffiFfiConverterTypeGetBlockLogsError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetSupply): + buf.write_i32(20) + _UniffiFfiConverterTypeGetSupplyError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetParticipationKeys): + buf.write_i32(21) + _UniffiFfiConverterTypeGetParticipationKeysError.write(value.error, buf) + if isinstance(value, AlgodApiError.AddParticipationKey): + buf.write_i32(22) + _UniffiFfiConverterTypeAddParticipationKeyError.write(value.error, buf) + if isinstance(value, AlgodApiError.GenerateParticipationKeys): + buf.write_i32(23) + _UniffiFfiConverterTypeGenerateParticipationKeysError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetParticipationKeyById): + buf.write_i32(24) + _UniffiFfiConverterTypeGetParticipationKeyByIdError.write(value.error, buf) + if isinstance(value, AlgodApiError.AppendKeys): + buf.write_i32(25) + _UniffiFfiConverterTypeAppendKeysError.write(value.error, buf) + if isinstance(value, AlgodApiError.DeleteParticipationKeyById): + buf.write_i32(26) + _UniffiFfiConverterTypeDeleteParticipationKeyByIdError.write(value.error, buf) + if isinstance(value, AlgodApiError.ShutdownNode): + buf.write_i32(27) + _UniffiFfiConverterTypeShutdownNodeError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetStatus): + buf.write_i32(28) + _UniffiFfiConverterTypeGetStatusError.write(value.error, buf) + if isinstance(value, AlgodApiError.WaitForBlock): + buf.write_i32(29) + _UniffiFfiConverterTypeWaitForBlockError.write(value.error, buf) + if isinstance(value, AlgodApiError.RawTransaction): + buf.write_i32(30) + _UniffiFfiConverterTypeRawTransactionError.write(value.error, buf) + if isinstance(value, AlgodApiError.RawTransactionAsync): + buf.write_i32(31) + _UniffiFfiConverterTypeRawTransactionAsyncError.write(value.error, buf) + if isinstance(value, AlgodApiError.SimulateTransaction): + buf.write_i32(32) + _UniffiFfiConverterTypeSimulateTransactionError.write(value.error, buf) + if isinstance(value, AlgodApiError.TransactionParams): + buf.write_i32(33) + _UniffiFfiConverterTypeTransactionParamsError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetPendingTransactions): + buf.write_i32(34) + _UniffiFfiConverterTypeGetPendingTransactionsError.write(value.error, buf) + if isinstance(value, AlgodApiError.PendingTransactionInformation): + buf.write_i32(35) + _UniffiFfiConverterTypePendingTransactionInformationError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetLedgerStateDelta): + buf.write_i32(36) + _UniffiFfiConverterTypeGetLedgerStateDeltaError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetTransactionGroupLedgerStateDeltasForRound): + buf.write_i32(37) + _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRoundError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetLedgerStateDeltaForTransactionGroup): + buf.write_i32(38) + _UniffiFfiConverterTypeGetLedgerStateDeltaForTransactionGroupError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetStateProof): + buf.write_i32(39) + _UniffiFfiConverterTypeGetStateProofError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetLightBlockHeaderProof): + buf.write_i32(40) + _UniffiFfiConverterTypeGetLightBlockHeaderProofError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetApplicationById): + buf.write_i32(41) + _UniffiFfiConverterTypeGetApplicationByIdError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetApplicationBoxes): + buf.write_i32(42) + _UniffiFfiConverterTypeGetApplicationBoxesError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetApplicationBoxByName): + buf.write_i32(43) + _UniffiFfiConverterTypeGetApplicationBoxByNameError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetAssetById): + buf.write_i32(44) + _UniffiFfiConverterTypeGetAssetByIdError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetSyncRound): + buf.write_i32(45) + _UniffiFfiConverterTypeGetSyncRoundError.write(value.error, buf) + if isinstance(value, AlgodApiError.UnsetSyncRound): + buf.write_i32(46) + _UniffiFfiConverterTypeUnsetSyncRoundError.write(value.error, buf) + if isinstance(value, AlgodApiError.SetSyncRound): + buf.write_i32(47) + _UniffiFfiConverterTypeSetSyncRoundError.write(value.error, buf) + if isinstance(value, AlgodApiError.TealCompile): + buf.write_i32(48) + _UniffiFfiConverterTypeTealCompileError.write(value.error, buf) + if isinstance(value, AlgodApiError.TealDisassemble): + buf.write_i32(49) + _UniffiFfiConverterTypeTealDisassembleError.write(value.error, buf) + if isinstance(value, AlgodApiError.StartCatchup): + buf.write_i32(50) + _UniffiFfiConverterTypeStartCatchupError.write(value.error, buf) + if isinstance(value, AlgodApiError.AbortCatchup): + buf.write_i32(51) + _UniffiFfiConverterTypeAbortCatchupError.write(value.error, buf) + if isinstance(value, AlgodApiError.TealDryrun): + buf.write_i32(52) + _UniffiFfiConverterTypeTealDryrunError.write(value.error, buf) + if isinstance(value, AlgodApiError.ExperimentalCheck): + buf.write_i32(53) + _UniffiFfiConverterTypeExperimentalCheckError.write(value.error, buf) + if isinstance(value, AlgodApiError.GetBlockTimeStampOffset): + buf.write_i32(54) + _UniffiFfiConverterTypeGetBlockTimeStampOffsetError.write(value.error, buf) + if isinstance(value, AlgodApiError.SetBlockTimeStampOffset): + buf.write_i32(55) + _UniffiFfiConverterTypeSetBlockTimeStampOffsetError.write(value.error, buf) + if isinstance(value, AlgodApiError.Unknown): + buf.write_i32(56) + _UniffiFfiConverterString.write(value.message, buf) + + + + + +# Error +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class Error(Exception): + """ + The main error type for all algod client operations +""" + pass + +_UniffiTempError = Error + +class Error: # type: ignore + """ + The main error type for all algod client operations +""" + + class Http(_UniffiTempError): + + def __init__(self, source): + super().__init__(", ".join([ + "source={!r}".format(source), + ])) + self.source = source + + def __repr__(self): + return "Error.Http({})".format(str(self)) + _UniffiTempError.Http = Http # type: ignore + class Serde(_UniffiTempError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "Error.Serde({})".format(str(self)) + _UniffiTempError.Serde = Serde # type: ignore + class Api(_UniffiTempError): + + def __init__(self, source): + super().__init__(", ".join([ + "source={!r}".format(source), + ])) + self.source = source + + def __repr__(self): + return "Error.Api({})".format(str(self)) + _UniffiTempError.Api = Api # type: ignore + +Error = _UniffiTempError # type: ignore +del _UniffiTempError + + +class _UniffiFfiConverterTypeError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Error.Http( + algokit_http_client._UniffiFfiConverterTypeHttpError.read(buf), + ) + if variant == 2: + return Error.Serde( + _UniffiFfiConverterString.read(buf), + ) + if variant == 3: + return Error.Api( + _UniffiFfiConverterTypeAlgodApiError.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, Error.Http): + algokit_http_client._UniffiFfiConverterTypeHttpError.check_lower(value.source) + return + if isinstance(value, Error.Serde): + _UniffiFfiConverterString.check_lower(value.message) + return + if isinstance(value, Error.Api): + _UniffiFfiConverterTypeAlgodApiError.check_lower(value.source) + return + + @staticmethod + def write(value, buf): + if isinstance(value, Error.Http): + buf.write_i32(1) + algokit_http_client._UniffiFfiConverterTypeHttpError.write(value.source, buf) + if isinstance(value, Error.Serde): + buf.write_i32(2) + _UniffiFfiConverterString.write(value.message, buf) + if isinstance(value, Error.Api): + buf.write_i32(3) + _UniffiFfiConverterTypeAlgodApiError.write(value.source, buf) + + + + + + +class Exclude(enum.Enum): + """ + When set to `all` will exclude asset holdings, application local state, created asset parameters, any created application parameters. Defaults to `none`. +""" + + ALL = 0 + """ + all +""" + + NONE = 1 + """ + none +""" + + + +class _UniffiFfiConverterTypeExclude(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Exclude.ALL + if variant == 2: + return Exclude.NONE + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == Exclude.ALL: + return + if value == Exclude.NONE: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == Exclude.ALL: + buf.write_i32(1) + if value == Exclude.NONE: + buf.write_i32(2) + + + + + + + + +class Format(enum.Enum): + """ + Configures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON. +""" + + JSON = 0 + """ + json +""" + + MSGPACK = 1 + """ + msgpack +""" + + + +class _UniffiFfiConverterTypeFormat(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Format.JSON + if variant == 2: + return Format.MSGPACK + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == Format.JSON: + return + if value == Format.MSGPACK: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == Format.JSON: + buf.write_i32(1) + if value == Format.MSGPACK: + buf.write_i32(2) + + + + + + + + +class Hashtype(enum.Enum): + """ + The type of hash function used to create the proof, must be one of: + * sha512_256 + * sha256 +""" + + SHA512256 = 0 + """ + sha512_256 +""" + + SHA256 = 1 + """ + sha256 +""" + + + +class _UniffiFfiConverterTypeHashtype(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Hashtype.SHA512256 + if variant == 2: + return Hashtype.SHA256 + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == Hashtype.SHA512256: + return + if value == Hashtype.SHA256: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == Hashtype.SHA512256: + buf.write_i32(1) + if value == Hashtype.SHA256: + buf.write_i32(2) + + + +class _UniffiFfiConverterOptionalTypeExclude(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeExclude.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeExclude.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeExclude.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeFormat(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeFormat.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeFormat.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeFormat.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeHashtype(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeHashtype.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeHashtype.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeHashtype.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeParticipationKey(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeParticipationKey.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeParticipationKey.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeParticipationKey.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalTypeDryrunRequest(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeDryrunRequest.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeDryrunRequest.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeDryrunRequest.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + +class AlgodClientTrait(): + + async def health_check(self, ) -> None: + """ + Returns OK if healthy. +""" + raise NotImplementedError + async def get_ready(self, ) -> None: + """ + Returns OK if healthy and fully caught up. +""" + raise NotImplementedError + async def metrics(self, ) -> None: + """ + Return metrics about algod functioning. +""" + raise NotImplementedError + async def get_genesis(self, ) -> Genesis: + """ + Gets the genesis information. +""" + raise NotImplementedError + async def swagger_json(self, ) -> str: + """ + Gets the current swagger spec. +""" + raise NotImplementedError + async def get_version(self, ) -> Version: + """ + Retrieves the supported API versions, binary build versions, and genesis information. +""" + raise NotImplementedError + async def get_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Retrieves the current settings for blocking and mutex profiles +""" + raise NotImplementedError + async def put_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Enables blocking and mutex profiles, and returns the old settings +""" + raise NotImplementedError + async def get_config(self, ) -> str: + """ + Gets the merged config file. +""" + raise NotImplementedError + async def account_information(self, address: str,exclude: typing.Optional[Exclude],format: typing.Optional[Format]) -> Account: + """ + Get account information. +""" + raise NotImplementedError + async def account_asset_information(self, address: str,asset_id: int,format: typing.Optional[Format]) -> AccountAssetInformation: + """ + Get account information about a given asset. +""" + raise NotImplementedError + async def account_assets_information(self, address: str,limit: typing.Optional[int],next: typing.Optional[str]) -> AccountAssetsInformation: + """ + Get a list of assets held by an account, inclusive of asset params. +""" + raise NotImplementedError + async def account_application_information(self, address: str,application_id: int,format: typing.Optional[Format]) -> AccountApplicationInformation: + """ + Get account information about a given app. +""" + raise NotImplementedError + async def get_pending_transactions_by_address(self, address: str,max: typing.Optional[int]) -> GetPendingTransactionsByAddress: + """ + Get a list of unconfirmed transactions currently in the transaction pool by address. +""" + raise NotImplementedError + async def get_block(self, round: int,header_only: typing.Optional[bool]) -> GetBlock: + """ + Get the block for the given round. +""" + raise NotImplementedError + async def get_block_txids(self, round: int) -> GetBlockTxids: + """ + Get the top level transaction IDs for the block on the given round. +""" + raise NotImplementedError + async def get_block_hash(self, round: int) -> GetBlockHash: + """ + Get the block hash for the block on the given round. +""" + raise NotImplementedError + async def get_transaction_proof(self, round: int,txid: str,hashtype: typing.Optional[Hashtype],format: typing.Optional[Format]) -> TransactionProof: + """ + Get a proof for a transaction in a block. +""" + raise NotImplementedError + async def get_block_logs(self, round: int) -> GetBlockLogs: + """ + Get all of the logs from outer and inner app calls in the given round +""" + raise NotImplementedError + async def get_supply(self, ) -> GetSupply: + """ + Get the current supply reported by the ledger. +""" + raise NotImplementedError + async def get_participation_keys(self, ) -> typing.List[ParticipationKey]: + """ + Return a list of participation keys +""" + raise NotImplementedError + async def add_participation_key(self, request: bytes) -> AddParticipationKey: + """ + Add a participation key to the node +""" + raise NotImplementedError + async def generate_participation_keys(self, address: str,dilution: typing.Optional[int],first: int,last: int) -> str: + """ + Generate and install participation keys to the node. +""" + raise NotImplementedError + async def get_participation_key_by_id(self, participation_id: str) -> ParticipationKey: + """ + Get participation key info given a participation ID +""" + raise NotImplementedError + async def append_keys(self, request: bytes,participation_id: str) -> ParticipationKey: + """ + Append state proof keys to a participation key +""" + raise NotImplementedError + async def delete_participation_key_by_id(self, participation_id: str) -> None: + """ + Delete a given participation key by ID +""" + raise NotImplementedError + async def shutdown_node(self, timeout: typing.Optional[int]) -> UnknownJsonValue: + """ + Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. +""" + raise NotImplementedError + async def get_status(self, ) -> GetStatus: + """ + Gets the current node status. +""" + raise NotImplementedError + async def wait_for_block(self, round: int) -> WaitForBlock: + """ + Gets the node status after waiting for a round after the given round. +""" + raise NotImplementedError + async def raw_transaction(self, request: bytes) -> RawTransaction: + """ + Broadcasts a raw transaction or transaction group to the network. +""" + raise NotImplementedError + async def raw_transaction_async(self, request: bytes) -> None: + """ + Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. +""" + raise NotImplementedError + async def simulate_transaction(self, request: SimulateRequest,format: typing.Optional[Format]) -> SimulateTransaction: + """ + Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. +""" + raise NotImplementedError + async def transaction_params(self, ) -> TransactionParams: + """ + Get parameters for constructing a new transaction +""" + raise NotImplementedError + async def get_pending_transactions(self, max: typing.Optional[int]) -> GetPendingTransactions: + """ + Get a list of unconfirmed transactions currently in the transaction pool. +""" + raise NotImplementedError + async def pending_transaction_information(self, txid: str) -> PendingTransactionResponse: + """ + Get a specific pending transaction. +""" + raise NotImplementedError + async def get_ledger_state_delta(self, round: int) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given round +""" + raise NotImplementedError + async def get_transaction_group_ledger_state_deltas_for_round(self, round: int) -> GetTransactionGroupLedgerStateDeltasForRound: + """ + Get LedgerStateDelta objects for all transaction groups in a given round +""" + raise NotImplementedError + async def get_ledger_state_delta_for_transaction_group(self, id: str) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given transaction group +""" + raise NotImplementedError + async def get_state_proof(self, round: int) -> StateProof: + """ + Get a state proof that covers a given round +""" + raise NotImplementedError + async def get_light_block_header_proof(self, round: int) -> LightBlockHeaderProof: + """ + Gets a proof for a given light block header inside a state proof commitment +""" + raise NotImplementedError + async def get_application_by_id(self, application_id: int) -> Application: + """ + Get application information. +""" + raise NotImplementedError + async def get_application_boxes(self, application_id: int,max: typing.Optional[int]) -> GetApplicationBoxes: + """ + Get all box names for a given application. +""" + raise NotImplementedError + async def get_application_box_by_name(self, application_id: int,name: str) -> Box: + """ + Get box information for a given application. +""" + raise NotImplementedError + async def get_asset_by_id(self, asset_id: int) -> Asset: + """ + Get asset information. +""" + raise NotImplementedError + async def get_sync_round(self, ) -> GetSyncRound: + """ + Returns the minimum sync round the ledger is keeping in cache. +""" + raise NotImplementedError + async def unset_sync_round(self, ) -> None: + """ + Removes minimum sync round restriction from the ledger. +""" + raise NotImplementedError + async def set_sync_round(self, round: int) -> None: + """ + Given a round, tells the ledger to keep that round in its cache. +""" + raise NotImplementedError + async def teal_compile(self, request: bytes,sourcemap: typing.Optional[bool]) -> TealCompile: + """ + Compile TEAL source code to binary, produce its hash +""" + raise NotImplementedError + async def teal_disassemble(self, request: str) -> TealDisassemble: + """ + Disassemble program bytes into the TEAL source code. +""" + raise NotImplementedError + async def start_catchup(self, catchpoint: str,min: typing.Optional[int]) -> StartCatchup: + """ + Starts a catchpoint catchup. +""" + raise NotImplementedError + async def abort_catchup(self, catchpoint: str) -> AbortCatchup: + """ + Aborts a catchpoint catchup. +""" + raise NotImplementedError + async def teal_dryrun(self, request: typing.Optional[DryrunRequest]) -> TealDryrun: + """ + Provide debugging information for a transaction (or group). +""" + raise NotImplementedError + async def experimental_check(self, ) -> None: + """ + Returns OK if experimental API is enabled. +""" + raise NotImplementedError + async def get_block_time_stamp_offset(self, ) -> GetBlockTimeStampOffset: + """ + Returns the timestamp offset. Timestamp offsets can only be set in dev mode. +""" + raise NotImplementedError + async def set_block_time_stamp_offset(self, offset: int) -> None: + """ + Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. +""" + raise NotImplementedError + +class AlgodClientTraitImpl(AlgodClientTrait): + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algod_client_ffi_fn_free_algodclienttrait, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algod_client_ffi_fn_clone_algodclienttrait, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + async def health_check(self, ) -> None: + """ + Returns OK if healthy. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_health_check(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_ready(self, ) -> None: + """ + Returns OK if healthy and fully caught up. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ready(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def metrics(self, ) -> None: + """ + Return metrics about algod functioning. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_metrics(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_genesis(self, ) -> Genesis: + """ + Gets the genesis information. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGenesis.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_genesis(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def swagger_json(self, ) -> str: + """ + Gets the current swagger spec. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_swagger_json(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_version(self, ) -> Version: + """ + Retrieves the supported API versions, binary build versions, and genesis information. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeVersion.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_version(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Retrieves the current settings for blocking and mutex profiles +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeDebugSettingsProf.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_debug_settings_prof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def put_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Enables blocking and mutex profiles, and returns the old settings +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeDebugSettingsProf.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_put_debug_settings_prof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_config(self, ) -> str: + """ + Gets the merged config file. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_config(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_information(self, address: str,exclude: typing.Optional[Exclude],format: typing.Optional[Format]) -> Account: + """ + Get account information. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalTypeExclude.check_lower(exclude) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalTypeExclude.lower(exclude), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccount.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_asset_information(self, address: str,asset_id: int,format: typing.Optional[Format]) -> AccountAssetInformation: + """ + Get account information about a given asset. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterUInt64.check_lower(asset_id) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterUInt64.lower(asset_id), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccountAssetInformation.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_asset_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_assets_information(self, address: str,limit: typing.Optional[int],next: typing.Optional[str]) -> AccountAssetsInformation: + """ + Get a list of assets held by an account, inclusive of asset params. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalUInt64.check_lower(limit) + + _UniffiFfiConverterOptionalString.check_lower(next) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalUInt64.lower(limit), + _UniffiFfiConverterOptionalString.lower(next), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccountAssetsInformation.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_assets_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_application_information(self, address: str,application_id: int,format: typing.Optional[Format]) -> AccountApplicationInformation: + """ + Get account information about a given app. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterUInt64.check_lower(application_id) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterUInt64.lower(application_id), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccountApplicationInformation.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_account_application_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_pending_transactions_by_address(self, address: str,max: typing.Optional[int]) -> GetPendingTransactionsByAddress: + """ + Get a list of unconfirmed transactions currently in the transaction pool by address. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalUInt64.check_lower(max) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalUInt64.lower(max), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetPendingTransactionsByAddress.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_pending_transactions_by_address(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block(self, round: int,header_only: typing.Optional[bool]) -> GetBlock: + """ + Get the block for the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + + _UniffiFfiConverterOptionalBoolean.check_lower(header_only) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + _UniffiFfiConverterOptionalBoolean.lower(header_only), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlock.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_txids(self, round: int) -> GetBlockTxids: + """ + Get the top level transaction IDs for the block on the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockTxids.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_txids(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_hash(self, round: int) -> GetBlockHash: + """ + Get the block hash for the block on the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockHash.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_hash(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_transaction_proof(self, round: int,txid: str,hashtype: typing.Optional[Hashtype],format: typing.Optional[Format]) -> TransactionProof: + """ + Get a proof for a transaction in a block. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + + _UniffiFfiConverterString.check_lower(txid) + + _UniffiFfiConverterOptionalTypeHashtype.check_lower(hashtype) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + _UniffiFfiConverterString.lower(txid), + _UniffiFfiConverterOptionalTypeHashtype.lower(hashtype), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionProof.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_transaction_proof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_logs(self, round: int) -> GetBlockLogs: + """ + Get all of the logs from outer and inner app calls in the given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockLogs.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_logs(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_supply(self, ) -> GetSupply: + """ + Get the current supply reported by the ledger. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetSupply.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_supply(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_participation_keys(self, ) -> typing.List[ParticipationKey]: + """ + Return a list of participation keys +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_participation_keys(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def add_participation_key(self, request: bytes) -> AddParticipationKey: + """ + Add a participation key to the node +""" + + _UniffiFfiConverterBytes.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAddParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_add_participation_key(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def generate_participation_keys(self, address: str,dilution: typing.Optional[int],first: int,last: int) -> str: + """ + Generate and install participation keys to the node. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalUInt64.check_lower(dilution) + + _UniffiFfiConverterUInt64.check_lower(first) + + _UniffiFfiConverterUInt64.check_lower(last) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalUInt64.lower(dilution), + _UniffiFfiConverterUInt64.lower(first), + _UniffiFfiConverterUInt64.lower(last), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_generate_participation_keys(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_participation_key_by_id(self, participation_id: str) -> ParticipationKey: + """ + Get participation key info given a participation ID +""" + + _UniffiFfiConverterString.check_lower(participation_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(participation_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_participation_key_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def append_keys(self, request: bytes,participation_id: str) -> ParticipationKey: + """ + Append state proof keys to a participation key +""" + + _UniffiFfiConverterBytes.check_lower(request) + + _UniffiFfiConverterString.check_lower(participation_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + _UniffiFfiConverterString.lower(participation_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_append_keys(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def delete_participation_key_by_id(self, participation_id: str) -> None: + """ + Delete a given participation key by ID +""" + + _UniffiFfiConverterString.check_lower(participation_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(participation_id), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_delete_participation_key_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def shutdown_node(self, timeout: typing.Optional[int]) -> UnknownJsonValue: + """ + Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. +""" + + _UniffiFfiConverterOptionalUInt64.check_lower(timeout) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterOptionalUInt64.lower(timeout), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeUnknownJsonValue.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_shutdown_node(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_status(self, ) -> GetStatus: + """ + Gets the current node status. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetStatus.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_status(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def wait_for_block(self, round: int) -> WaitForBlock: + """ + Gets the node status after waiting for a round after the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeWaitForBlock.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_wait_for_block(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def raw_transaction(self, request: bytes) -> RawTransaction: + """ + Broadcasts a raw transaction or transaction group to the network. +""" + + _UniffiFfiConverterBytes.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeRawTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_raw_transaction(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def raw_transaction_async(self, request: bytes) -> None: + """ + Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. +""" + + _UniffiFfiConverterBytes.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_raw_transaction_async(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def simulate_transaction(self, request: SimulateRequest,format: typing.Optional[Format]) -> SimulateTransaction: + """ + Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. +""" + + _UniffiFfiConverterTypeSimulateRequest.check_lower(request) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeSimulateRequest.lower(request), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeSimulateTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_simulate_transaction(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def transaction_params(self, ) -> TransactionParams: + """ + Get parameters for constructing a new transaction +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionParams.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_transaction_params(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_pending_transactions(self, max: typing.Optional[int]) -> GetPendingTransactions: + """ + Get a list of unconfirmed transactions currently in the transaction pool. +""" + + _UniffiFfiConverterOptionalUInt64.check_lower(max) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterOptionalUInt64.lower(max), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetPendingTransactions.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_pending_transactions(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def pending_transaction_information(self, txid: str) -> PendingTransactionResponse: + """ + Get a specific pending transaction. +""" + + _UniffiFfiConverterString.check_lower(txid) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(txid), + ) + _uniffi_lift_return = _UniffiFfiConverterTypePendingTransactionResponse.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_pending_transaction_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_ledger_state_delta(self, round: int) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeLedgerStateDelta.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ledger_state_delta(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_transaction_group_ledger_state_deltas_for_round(self, round: int) -> GetTransactionGroupLedgerStateDeltasForRound: + """ + Get LedgerStateDelta objects for all transaction groups in a given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRound.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_transaction_group_ledger_state_deltas_for_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_ledger_state_delta_for_transaction_group(self, id: str) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given transaction group +""" + + _UniffiFfiConverterString.check_lower(id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeLedgerStateDelta.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_ledger_state_delta_for_transaction_group(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_state_proof(self, round: int) -> StateProof: + """ + Get a state proof that covers a given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeStateProof.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_state_proof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_light_block_header_proof(self, round: int) -> LightBlockHeaderProof: + """ + Gets a proof for a given light block header inside a state proof commitment +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeLightBlockHeaderProof.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_light_block_header_proof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_application_by_id(self, application_id: int) -> Application: + """ + Get application information. +""" + + _UniffiFfiConverterUInt64.check_lower(application_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(application_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeApplication.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_application_boxes(self, application_id: int,max: typing.Optional[int]) -> GetApplicationBoxes: + """ + Get all box names for a given application. +""" + + _UniffiFfiConverterUInt64.check_lower(application_id) + + _UniffiFfiConverterOptionalUInt64.check_lower(max) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(application_id), + _UniffiFfiConverterOptionalUInt64.lower(max), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetApplicationBoxes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_boxes(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_application_box_by_name(self, application_id: int,name: str) -> Box: + """ + Get box information for a given application. +""" + + _UniffiFfiConverterUInt64.check_lower(application_id) + + _UniffiFfiConverterString.check_lower(name) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(application_id), + _UniffiFfiConverterString.lower(name), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeBox.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_application_box_by_name(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_asset_by_id(self, asset_id: int) -> Asset: + """ + Get asset information. +""" + + _UniffiFfiConverterUInt64.check_lower(asset_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(asset_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAsset.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_asset_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_sync_round(self, ) -> GetSyncRound: + """ + Returns the minimum sync round the ledger is keeping in cache. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetSyncRound.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_sync_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def unset_sync_round(self, ) -> None: + """ + Removes minimum sync round restriction from the ledger. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_unset_sync_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def set_sync_round(self, round: int) -> None: + """ + Given a round, tells the ledger to keep that round in its cache. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_set_sync_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def teal_compile(self, request: bytes,sourcemap: typing.Optional[bool]) -> TealCompile: + """ + Compile TEAL source code to binary, produce its hash +""" + + _UniffiFfiConverterBytes.check_lower(request) + + _UniffiFfiConverterOptionalBoolean.check_lower(sourcemap) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + _UniffiFfiConverterOptionalBoolean.lower(sourcemap), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTealCompile.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_compile(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def teal_disassemble(self, request: str) -> TealDisassemble: + """ + Disassemble program bytes into the TEAL source code. +""" + + _UniffiFfiConverterString.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTealDisassemble.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_disassemble(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def start_catchup(self, catchpoint: str,min: typing.Optional[int]) -> StartCatchup: + """ + Starts a catchpoint catchup. +""" + + _UniffiFfiConverterString.check_lower(catchpoint) + + _UniffiFfiConverterOptionalUInt64.check_lower(min) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(catchpoint), + _UniffiFfiConverterOptionalUInt64.lower(min), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeStartCatchup.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_start_catchup(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def abort_catchup(self, catchpoint: str) -> AbortCatchup: + """ + Aborts a catchpoint catchup. +""" + + _UniffiFfiConverterString.check_lower(catchpoint) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(catchpoint), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAbortCatchup.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_abort_catchup(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def teal_dryrun(self, request: typing.Optional[DryrunRequest]) -> TealDryrun: + """ + Provide debugging information for a transaction (or group). +""" + + _UniffiFfiConverterOptionalTypeDryrunRequest.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterOptionalTypeDryrunRequest.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTealDryrun.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_teal_dryrun(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def experimental_check(self, ) -> None: + """ + Returns OK if experimental API is enabled. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_experimental_check(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_time_stamp_offset(self, ) -> GetBlockTimeStampOffset: + """ + Returns the timestamp offset. Timestamp offsets can only be set in dev mode. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockTimeStampOffset.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_get_block_time_stamp_offset(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def set_block_time_stamp_offset(self, offset: int) -> None: + """ + Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. +""" + + _UniffiFfiConverterUInt64.check_lower(offset) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(offset), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclienttrait_set_block_time_stamp_offset(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + + + + +# Put all the bits inside a class to keep the top-level namespace clean +class _UniffiTraitImplAlgodClientTraitImpl: + # For each method, generate a callback function to pass to Rust + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD0 + def health_check( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.health_check + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD1 + def get_ready( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_ready + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD2 + def metrics( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.metrics + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD3 + def get_genesis( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_genesis + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGenesis.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD4 + def swagger_json( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.swagger_json + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterString.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD5 + def get_version( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_version + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeVersion.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD6 + def get_debug_settings_prof( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_debug_settings_prof + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeDebugSettingsProf.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD7 + def put_debug_settings_prof( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.put_debug_settings_prof + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeDebugSettingsProf.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD8 + def get_config( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_config + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterString.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD9 + def account_information( + uniffi_handle, + address, + exclude, + format, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterOptionalTypeExclude.lift(exclude), _UniffiFfiConverterOptionalTypeFormat.lift(format), ) + uniffi_method = uniffi_obj.account_information + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAccount.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD10 + def account_asset_information( + uniffi_handle, + address, + asset_id, + format, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterUInt64.lift(asset_id), _UniffiFfiConverterOptionalTypeFormat.lift(format), ) + uniffi_method = uniffi_obj.account_asset_information + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAccountAssetInformation.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD11 + def account_assets_information( + uniffi_handle, + address, + limit, + next, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterOptionalUInt64.lift(limit), _UniffiFfiConverterOptionalString.lift(next), ) + uniffi_method = uniffi_obj.account_assets_information + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAccountAssetsInformation.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD12 + def account_application_information( + uniffi_handle, + address, + application_id, + format, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterUInt64.lift(application_id), _UniffiFfiConverterOptionalTypeFormat.lift(format), ) + uniffi_method = uniffi_obj.account_application_information + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAccountApplicationInformation.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD13 + def get_pending_transactions_by_address( + uniffi_handle, + address, + max, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterOptionalUInt64.lift(max), ) + uniffi_method = uniffi_obj.get_pending_transactions_by_address + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetPendingTransactionsByAddress.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD14 + def get_block( + uniffi_handle, + round, + header_only, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), _UniffiFfiConverterOptionalBoolean.lift(header_only), ) + uniffi_method = uniffi_obj.get_block + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetBlock.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD15 + def get_block_txids( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_block_txids + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetBlockTxids.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD16 + def get_block_hash( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_block_hash + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetBlockHash.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD17 + def get_transaction_proof( + uniffi_handle, + round, + txid, + hashtype, + format, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), _UniffiFfiConverterString.lift(txid), _UniffiFfiConverterOptionalTypeHashtype.lift(hashtype), _UniffiFfiConverterOptionalTypeFormat.lift(format), ) + uniffi_method = uniffi_obj.get_transaction_proof + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeTransactionProof.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD18 + def get_block_logs( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_block_logs + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetBlockLogs.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD19 + def get_supply( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_supply + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetSupply.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD20 + def get_participation_keys( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_participation_keys + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterSequenceTypeParticipationKey.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD21 + def add_participation_key( + uniffi_handle, + request, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterBytes.lift(request), ) + uniffi_method = uniffi_obj.add_participation_key + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAddParticipationKey.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD22 + def generate_participation_keys( + uniffi_handle, + address, + dilution, + first, + last, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterOptionalUInt64.lift(dilution), _UniffiFfiConverterUInt64.lift(first), _UniffiFfiConverterUInt64.lift(last), ) + uniffi_method = uniffi_obj.generate_participation_keys + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterString.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD23 + def get_participation_key_by_id( + uniffi_handle, + participation_id, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(participation_id), ) + uniffi_method = uniffi_obj.get_participation_key_by_id + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeParticipationKey.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD24 + def append_keys( + uniffi_handle, + request, + participation_id, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterBytes.lift(request), _UniffiFfiConverterString.lift(participation_id), ) + uniffi_method = uniffi_obj.append_keys + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeParticipationKey.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD25 + def delete_participation_key_by_id( + uniffi_handle, + participation_id, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(participation_id), ) + uniffi_method = uniffi_obj.delete_participation_key_by_id + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD26 + def shutdown_node( + uniffi_handle, + timeout, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterOptionalUInt64.lift(timeout), ) + uniffi_method = uniffi_obj.shutdown_node + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeUnknownJsonValue.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD27 + def get_status( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_status + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetStatus.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD28 + def wait_for_block( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.wait_for_block + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeWaitForBlock.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD29 + def raw_transaction( + uniffi_handle, + request, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterBytes.lift(request), ) + uniffi_method = uniffi_obj.raw_transaction + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeRawTransaction.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD30 + def raw_transaction_async( + uniffi_handle, + request, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterBytes.lift(request), ) + uniffi_method = uniffi_obj.raw_transaction_async + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD31 + def simulate_transaction( + uniffi_handle, + request, + format, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeSimulateRequest.lift(request), _UniffiFfiConverterOptionalTypeFormat.lift(format), ) + uniffi_method = uniffi_obj.simulate_transaction + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeSimulateTransaction.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD32 + def transaction_params( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.transaction_params + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeTransactionParams.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD33 + def get_pending_transactions( + uniffi_handle, + max, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterOptionalUInt64.lift(max), ) + uniffi_method = uniffi_obj.get_pending_transactions + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetPendingTransactions.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD34 + def pending_transaction_information( + uniffi_handle, + txid, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(txid), ) + uniffi_method = uniffi_obj.pending_transaction_information + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypePendingTransactionResponse.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD35 + def get_ledger_state_delta( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_ledger_state_delta + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeLedgerStateDelta.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD36 + def get_transaction_group_ledger_state_deltas_for_round( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_transaction_group_ledger_state_deltas_for_round + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRound.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD37 + def get_ledger_state_delta_for_transaction_group( + uniffi_handle, + id, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(id), ) + uniffi_method = uniffi_obj.get_ledger_state_delta_for_transaction_group + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeLedgerStateDelta.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD38 + def get_state_proof( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_state_proof + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeStateProof.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD39 + def get_light_block_header_proof( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.get_light_block_header_proof + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeLightBlockHeaderProof.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD40 + def get_application_by_id( + uniffi_handle, + application_id, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(application_id), ) + uniffi_method = uniffi_obj.get_application_by_id + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeApplication.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD41 + def get_application_boxes( + uniffi_handle, + application_id, + max, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(application_id), _UniffiFfiConverterOptionalUInt64.lift(max), ) + uniffi_method = uniffi_obj.get_application_boxes + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetApplicationBoxes.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD42 + def get_application_box_by_name( + uniffi_handle, + application_id, + name, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(application_id), _UniffiFfiConverterString.lift(name), ) + uniffi_method = uniffi_obj.get_application_box_by_name + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeBox.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD43 + def get_asset_by_id( + uniffi_handle, + asset_id, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(asset_id), ) + uniffi_method = uniffi_obj.get_asset_by_id + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAsset.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD44 + def get_sync_round( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_sync_round + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetSyncRound.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD45 + def unset_sync_round( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.unset_sync_round + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD46 + def set_sync_round( + uniffi_handle, + round, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(round), ) + uniffi_method = uniffi_obj.set_sync_round + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD47 + def teal_compile( + uniffi_handle, + request, + sourcemap, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterBytes.lift(request), _UniffiFfiConverterOptionalBoolean.lift(sourcemap), ) + uniffi_method = uniffi_obj.teal_compile + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeTealCompile.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD48 + def teal_disassemble( + uniffi_handle, + request, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(request), ) + uniffi_method = uniffi_obj.teal_disassemble + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeTealDisassemble.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD49 + def start_catchup( + uniffi_handle, + catchpoint, + min, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(catchpoint), _UniffiFfiConverterOptionalUInt64.lift(min), ) + uniffi_method = uniffi_obj.start_catchup + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeStartCatchup.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD50 + def abort_catchup( + uniffi_handle, + catchpoint, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(catchpoint), ) + uniffi_method = uniffi_obj.abort_catchup + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeAbortCatchup.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD51 + def teal_dryrun( + uniffi_handle, + request, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterOptionalTypeDryrunRequest.lift(request), ) + uniffi_method = uniffi_obj.teal_dryrun + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeTealDryrun.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD52 + def experimental_check( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.experimental_check + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD53 + def get_block_time_stamp_offset( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.get_block_time_stamp_offset + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeGetBlockTimeStampOffset.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT_METHOD54 + def set_block_time_stamp_offset( + uniffi_handle, + offset, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeAlgodClientTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterUInt64.lift(offset), ) + uniffi_method = uniffi_obj.set_block_time_stamp_offset + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + Error, + _UniffiFfiConverterTypeError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT + def _uniffi_free(uniffi_handle): + _UniffiFfiConverterTypeAlgodClientTrait._handle_map.remove(uniffi_handle) + + @_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOD_CLIENT_FFI_ALGOD_CLIENT_TRAIT + def _uniffi_clone(uniffi_handle): + return _UniffiFfiConverterTypeAlgodClientTrait._handle_map.clone(uniffi_handle) + + # Generate the FFI VTable. This has a field for each callback interface method. + _uniffi_vtable = _UniffiVTableCallbackInterfaceAlgodClientFfiAlgodClientTrait( + _uniffi_free, + _uniffi_clone, + health_check, + get_ready, + metrics, + get_genesis, + swagger_json, + get_version, + get_debug_settings_prof, + put_debug_settings_prof, + get_config, + account_information, + account_asset_information, + account_assets_information, + account_application_information, + get_pending_transactions_by_address, + get_block, + get_block_txids, + get_block_hash, + get_transaction_proof, + get_block_logs, + get_supply, + get_participation_keys, + add_participation_key, + generate_participation_keys, + get_participation_key_by_id, + append_keys, + delete_participation_key_by_id, + shutdown_node, + get_status, + wait_for_block, + raw_transaction, + raw_transaction_async, + simulate_transaction, + transaction_params, + get_pending_transactions, + pending_transaction_information, + get_ledger_state_delta, + get_transaction_group_ledger_state_deltas_for_round, + get_ledger_state_delta_for_transaction_group, + get_state_proof, + get_light_block_header_proof, + get_application_by_id, + get_application_boxes, + get_application_box_by_name, + get_asset_by_id, + get_sync_round, + unset_sync_round, + set_sync_round, + teal_compile, + teal_disassemble, + start_catchup, + abort_catchup, + teal_dryrun, + experimental_check, + get_block_time_stamp_offset, + set_block_time_stamp_offset, + ) + # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever, + # or else bad things will happen when Rust tries to access it. + _UniffiLib.uniffi_algod_client_ffi_fn_init_callback_vtable_algodclienttrait(ctypes.byref(_uniffi_vtable)) + +class _UniffiFfiConverterTypeAlgodClientTrait: + _handle_map = _UniffiHandleMap() + + @staticmethod + def lift(value: int): + if (value & 1) == 0: + # Rust-generated handle, construct a new class that uses the handle to implement the + # interface + return AlgodClientTraitImpl._uniffi_make_instance(value) + else: + # Python-generated handle, get the object from the handle map + return _UniffiFfiConverterTypeAlgodClientTrait._handle_map.remove(value) + + @staticmethod + def check_lower(value: AlgodClientTrait): + if not isinstance(value, AlgodClientTrait): + raise TypeError("Expected AlgodClientTrait subclass, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: AlgodClientTrait): + if isinstance(value, AlgodClientTraitImpl): + # Rust-implementated object. Clone the handle and return it + return value._uniffi_clone_handle() + else: + # Python-implementated object, generate a new vtable handle and return that. + return _UniffiFfiConverterTypeAlgodClientTrait._handle_map.insert(value) + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: AlgodClientTrait, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class AlgodClientProtocol(typing.Protocol): + """ + The main Algod API client. + + This client provides convenient access to all Algod API endpoints. + It wraps the lower-level endpoint functions with a more ergonomic interface. + All methods return a unified `Error` type that can represent any endpoint error. +""" + + async def abort_catchup(self, catchpoint: str) -> AbortCatchup: + """ + Aborts a catchpoint catchup. +""" + raise NotImplementedError + async def account_application_information(self, address: str,application_id: int,format: typing.Optional[Format]) -> AccountApplicationInformation: + """ + Get account information about a given app. +""" + raise NotImplementedError + async def account_asset_information(self, address: str,asset_id: int,format: typing.Optional[Format]) -> AccountAssetInformation: + """ + Get account information about a given asset. +""" + raise NotImplementedError + async def account_assets_information(self, address: str,limit: typing.Optional[int],next: typing.Optional[str]) -> AccountAssetsInformation: + """ + Get a list of assets held by an account, inclusive of asset params. +""" + raise NotImplementedError + async def account_information(self, address: str,exclude: typing.Optional[Exclude],format: typing.Optional[Format]) -> Account: + """ + Get account information. +""" + raise NotImplementedError + async def add_participation_key(self, request: bytes) -> AddParticipationKey: + """ + Add a participation key to the node +""" + raise NotImplementedError + async def append_keys(self, request: bytes,participation_id: str) -> ParticipationKey: + """ + Append state proof keys to a participation key +""" + raise NotImplementedError + async def delete_participation_key_by_id(self, participation_id: str) -> None: + """ + Delete a given participation key by ID +""" + raise NotImplementedError + async def experimental_check(self, ) -> None: + """ + Returns OK if experimental API is enabled. +""" + raise NotImplementedError + async def generate_participation_keys(self, address: str,dilution: typing.Optional[int],first: int,last: int) -> str: + """ + Generate and install participation keys to the node. +""" + raise NotImplementedError + async def get_application_box_by_name(self, application_id: int,name: str) -> Box: + """ + Get box information for a given application. +""" + raise NotImplementedError + async def get_application_boxes(self, application_id: int,max: typing.Optional[int]) -> GetApplicationBoxes: + """ + Get all box names for a given application. +""" + raise NotImplementedError + async def get_application_by_id(self, application_id: int) -> Application: + """ + Get application information. +""" + raise NotImplementedError + async def get_asset_by_id(self, asset_id: int) -> Asset: + """ + Get asset information. +""" + raise NotImplementedError + async def get_block(self, round: int,header_only: typing.Optional[bool]) -> GetBlock: + """ + Get the block for the given round. +""" + raise NotImplementedError + async def get_block_hash(self, round: int) -> GetBlockHash: + """ + Get the block hash for the block on the given round. +""" + raise NotImplementedError + async def get_block_logs(self, round: int) -> GetBlockLogs: + """ + Get all of the logs from outer and inner app calls in the given round +""" + raise NotImplementedError + async def get_block_time_stamp_offset(self, ) -> GetBlockTimeStampOffset: + """ + Returns the timestamp offset. Timestamp offsets can only be set in dev mode. +""" + raise NotImplementedError + async def get_block_txids(self, round: int) -> GetBlockTxids: + """ + Get the top level transaction IDs for the block on the given round. +""" + raise NotImplementedError + async def get_config(self, ) -> str: + """ + Gets the merged config file. +""" + raise NotImplementedError + async def get_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Retrieves the current settings for blocking and mutex profiles +""" + raise NotImplementedError + async def get_genesis(self, ) -> Genesis: + """ + Gets the genesis information. +""" + raise NotImplementedError + async def get_ledger_state_delta(self, round: int) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given round +""" + raise NotImplementedError + async def get_ledger_state_delta_for_transaction_group(self, id: str) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given transaction group +""" + raise NotImplementedError + async def get_light_block_header_proof(self, round: int) -> LightBlockHeaderProof: + """ + Gets a proof for a given light block header inside a state proof commitment +""" + raise NotImplementedError + async def get_participation_key_by_id(self, participation_id: str) -> ParticipationKey: + """ + Get participation key info given a participation ID +""" + raise NotImplementedError + async def get_participation_keys(self, ) -> typing.List[ParticipationKey]: + """ + Return a list of participation keys +""" + raise NotImplementedError + async def get_pending_transactions(self, max: typing.Optional[int]) -> GetPendingTransactions: + """ + Get a list of unconfirmed transactions currently in the transaction pool. +""" + raise NotImplementedError + async def get_pending_transactions_by_address(self, address: str,max: typing.Optional[int]) -> GetPendingTransactionsByAddress: + """ + Get a list of unconfirmed transactions currently in the transaction pool by address. +""" + raise NotImplementedError + async def get_ready(self, ) -> None: + """ + Returns OK if healthy and fully caught up. +""" + raise NotImplementedError + async def get_state_proof(self, round: int) -> StateProof: + """ + Get a state proof that covers a given round +""" + raise NotImplementedError + async def get_status(self, ) -> GetStatus: + """ + Gets the current node status. +""" + raise NotImplementedError + async def get_supply(self, ) -> GetSupply: + """ + Get the current supply reported by the ledger. +""" + raise NotImplementedError + async def get_sync_round(self, ) -> GetSyncRound: + """ + Returns the minimum sync round the ledger is keeping in cache. +""" + raise NotImplementedError + async def get_transaction_group_ledger_state_deltas_for_round(self, round: int) -> GetTransactionGroupLedgerStateDeltasForRound: + """ + Get LedgerStateDelta objects for all transaction groups in a given round +""" + raise NotImplementedError + async def get_transaction_proof(self, round: int,txid: str,hashtype: typing.Optional[Hashtype],format: typing.Optional[Format]) -> TransactionProof: + """ + Get a proof for a transaction in a block. +""" + raise NotImplementedError + async def get_version(self, ) -> Version: + """ + Retrieves the supported API versions, binary build versions, and genesis information. +""" + raise NotImplementedError + async def health_check(self, ) -> None: + """ + Returns OK if healthy. +""" + raise NotImplementedError + async def metrics(self, ) -> None: + """ + Return metrics about algod functioning. +""" + raise NotImplementedError + async def pending_transaction_information(self, txid: str) -> PendingTransactionResponse: + """ + Get a specific pending transaction. +""" + raise NotImplementedError + async def put_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Enables blocking and mutex profiles, and returns the old settings +""" + raise NotImplementedError + async def raw_transaction(self, request: bytes) -> RawTransaction: + """ + Broadcasts a raw transaction or transaction group to the network. +""" + raise NotImplementedError + async def raw_transaction_async(self, request: bytes) -> None: + """ + Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. +""" + raise NotImplementedError + async def set_block_time_stamp_offset(self, offset: int) -> None: + """ + Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. +""" + raise NotImplementedError + async def set_sync_round(self, round: int) -> None: + """ + Given a round, tells the ledger to keep that round in its cache. +""" + raise NotImplementedError + async def shutdown_node(self, timeout: typing.Optional[int]) -> UnknownJsonValue: + """ + Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. +""" + raise NotImplementedError + async def simulate_transaction(self, request: SimulateRequest,format: typing.Optional[Format]) -> SimulateTransaction: + """ + Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. +""" + raise NotImplementedError + async def start_catchup(self, catchpoint: str,min: typing.Optional[int]) -> StartCatchup: + """ + Starts a catchpoint catchup. +""" + raise NotImplementedError + async def swagger_json(self, ) -> str: + """ + Gets the current swagger spec. +""" + raise NotImplementedError + async def teal_compile(self, request: bytes,sourcemap: typing.Optional[bool]) -> TealCompile: + """ + Compile TEAL source code to binary, produce its hash +""" + raise NotImplementedError + async def teal_disassemble(self, request: str) -> TealDisassemble: + """ + Disassemble program bytes into the TEAL source code. +""" + raise NotImplementedError + async def teal_dryrun(self, request: typing.Optional[DryrunRequest]) -> TealDryrun: + """ + Provide debugging information for a transaction (or group). +""" + raise NotImplementedError + async def transaction_params(self, ) -> TransactionParams: + """ + Get parameters for constructing a new transaction +""" + raise NotImplementedError + async def unset_sync_round(self, ) -> None: + """ + Removes minimum sync round restriction from the ledger. +""" + raise NotImplementedError + async def wait_for_block(self, round: int) -> WaitForBlock: + """ + Gets the node status after waiting for a round after the given round. +""" + raise NotImplementedError + +class AlgodClient(AlgodClientProtocol, AlgodClientTrait): + """ + The main Algod API client. + + This client provides convenient access to all Algod API endpoints. + It wraps the lower-level endpoint functions with a more ergonomic interface. + All methods return a unified `Error` type that can represent any endpoint error. +""" + + _handle: ctypes.c_uint64 + def __init__(self, http_client: algokit_http_client.HttpClient): + """ + Create a new AlgodClient with a custom http client. +""" + + algokit_http_client._UniffiFfiConverterTypeHttpClient.check_lower(http_client) + _uniffi_lowered_args = ( + algokit_http_client._UniffiFfiConverterTypeHttpClient.lower(http_client), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAlgodClient.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algod_client_ffi_fn_constructor_algodclient_new, + *_uniffi_lowered_args, + ) + self._handle = _uniffi_ffi_result + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algod_client_ffi_fn_free_algodclient, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algod_client_ffi_fn_clone_algodclient, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + async def abort_catchup(self, catchpoint: str) -> AbortCatchup: + """ + Aborts a catchpoint catchup. +""" + + _UniffiFfiConverterString.check_lower(catchpoint) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(catchpoint), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAbortCatchup.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_abort_catchup(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_application_information(self, address: str,application_id: int,format: typing.Optional[Format]) -> AccountApplicationInformation: + """ + Get account information about a given app. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterUInt64.check_lower(application_id) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterUInt64.lower(application_id), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccountApplicationInformation.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_application_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_asset_information(self, address: str,asset_id: int,format: typing.Optional[Format]) -> AccountAssetInformation: + """ + Get account information about a given asset. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterUInt64.check_lower(asset_id) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterUInt64.lower(asset_id), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccountAssetInformation.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_asset_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_assets_information(self, address: str,limit: typing.Optional[int],next: typing.Optional[str]) -> AccountAssetsInformation: + """ + Get a list of assets held by an account, inclusive of asset params. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalUInt64.check_lower(limit) + + _UniffiFfiConverterOptionalString.check_lower(next) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalUInt64.lower(limit), + _UniffiFfiConverterOptionalString.lower(next), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccountAssetsInformation.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_assets_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def account_information(self, address: str,exclude: typing.Optional[Exclude],format: typing.Optional[Format]) -> Account: + """ + Get account information. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalTypeExclude.check_lower(exclude) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalTypeExclude.lower(exclude), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAccount.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_account_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def add_participation_key(self, request: bytes) -> AddParticipationKey: + """ + Add a participation key to the node +""" + + _UniffiFfiConverterBytes.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAddParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_add_participation_key(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def append_keys(self, request: bytes,participation_id: str) -> ParticipationKey: + """ + Append state proof keys to a participation key +""" + + _UniffiFfiConverterBytes.check_lower(request) + + _UniffiFfiConverterString.check_lower(participation_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + _UniffiFfiConverterString.lower(participation_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_append_keys(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def delete_participation_key_by_id(self, participation_id: str) -> None: + """ + Delete a given participation key by ID +""" + + _UniffiFfiConverterString.check_lower(participation_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(participation_id), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_delete_participation_key_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def experimental_check(self, ) -> None: + """ + Returns OK if experimental API is enabled. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_experimental_check(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def generate_participation_keys(self, address: str,dilution: typing.Optional[int],first: int,last: int) -> str: + """ + Generate and install participation keys to the node. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalUInt64.check_lower(dilution) + + _UniffiFfiConverterUInt64.check_lower(first) + + _UniffiFfiConverterUInt64.check_lower(last) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalUInt64.lower(dilution), + _UniffiFfiConverterUInt64.lower(first), + _UniffiFfiConverterUInt64.lower(last), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_generate_participation_keys(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_application_box_by_name(self, application_id: int,name: str) -> Box: + """ + Get box information for a given application. +""" + + _UniffiFfiConverterUInt64.check_lower(application_id) + + _UniffiFfiConverterString.check_lower(name) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(application_id), + _UniffiFfiConverterString.lower(name), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeBox.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_box_by_name(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_application_boxes(self, application_id: int,max: typing.Optional[int]) -> GetApplicationBoxes: + """ + Get all box names for a given application. +""" + + _UniffiFfiConverterUInt64.check_lower(application_id) + + _UniffiFfiConverterOptionalUInt64.check_lower(max) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(application_id), + _UniffiFfiConverterOptionalUInt64.lower(max), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetApplicationBoxes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_boxes(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_application_by_id(self, application_id: int) -> Application: + """ + Get application information. +""" + + _UniffiFfiConverterUInt64.check_lower(application_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(application_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeApplication.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_application_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_asset_by_id(self, asset_id: int) -> Asset: + """ + Get asset information. +""" + + _UniffiFfiConverterUInt64.check_lower(asset_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(asset_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeAsset.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_asset_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block(self, round: int,header_only: typing.Optional[bool]) -> GetBlock: + """ + Get the block for the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + + _UniffiFfiConverterOptionalBoolean.check_lower(header_only) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + _UniffiFfiConverterOptionalBoolean.lower(header_only), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlock.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_hash(self, round: int) -> GetBlockHash: + """ + Get the block hash for the block on the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockHash.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_hash(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_logs(self, round: int) -> GetBlockLogs: + """ + Get all of the logs from outer and inner app calls in the given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockLogs.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_logs(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_time_stamp_offset(self, ) -> GetBlockTimeStampOffset: + """ + Returns the timestamp offset. Timestamp offsets can only be set in dev mode. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockTimeStampOffset.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_time_stamp_offset(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_block_txids(self, round: int) -> GetBlockTxids: + """ + Get the top level transaction IDs for the block on the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetBlockTxids.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_block_txids(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_config(self, ) -> str: + """ + Gets the merged config file. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_config(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Retrieves the current settings for blocking and mutex profiles +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeDebugSettingsProf.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_debug_settings_prof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_genesis(self, ) -> Genesis: + """ + Gets the genesis information. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGenesis.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_genesis(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_ledger_state_delta(self, round: int) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeLedgerStateDelta.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ledger_state_delta(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_ledger_state_delta_for_transaction_group(self, id: str) -> LedgerStateDelta: + """ + Get a LedgerStateDelta object for a given transaction group +""" + + _UniffiFfiConverterString.check_lower(id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeLedgerStateDelta.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ledger_state_delta_for_transaction_group(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_light_block_header_proof(self, round: int) -> LightBlockHeaderProof: + """ + Gets a proof for a given light block header inside a state proof commitment +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeLightBlockHeaderProof.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_light_block_header_proof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_participation_key_by_id(self, participation_id: str) -> ParticipationKey: + """ + Get participation key info given a participation ID +""" + + _UniffiFfiConverterString.check_lower(participation_id) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(participation_id), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_participation_key_by_id(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_participation_keys(self, ) -> typing.List[ParticipationKey]: + """ + Return a list of participation keys +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeParticipationKey.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_participation_keys(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_pending_transactions(self, max: typing.Optional[int]) -> GetPendingTransactions: + """ + Get a list of unconfirmed transactions currently in the transaction pool. +""" + + _UniffiFfiConverterOptionalUInt64.check_lower(max) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterOptionalUInt64.lower(max), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetPendingTransactions.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_pending_transactions(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_pending_transactions_by_address(self, address: str,max: typing.Optional[int]) -> GetPendingTransactionsByAddress: + """ + Get a list of unconfirmed transactions currently in the transaction pool by address. +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterOptionalUInt64.check_lower(max) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterOptionalUInt64.lower(max), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetPendingTransactionsByAddress.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_pending_transactions_by_address(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_ready(self, ) -> None: + """ + Returns OK if healthy and fully caught up. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_ready(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_state_proof(self, round: int) -> StateProof: + """ + Get a state proof that covers a given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeStateProof.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_state_proof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_status(self, ) -> GetStatus: + """ + Gets the current node status. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetStatus.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_status(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_supply(self, ) -> GetSupply: + """ + Get the current supply reported by the ledger. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetSupply.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_supply(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_sync_round(self, ) -> GetSyncRound: + """ + Returns the minimum sync round the ledger is keeping in cache. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetSyncRound.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_sync_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_transaction_group_ledger_state_deltas_for_round(self, round: int) -> GetTransactionGroupLedgerStateDeltasForRound: + """ + Get LedgerStateDelta objects for all transaction groups in a given round +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeGetTransactionGroupLedgerStateDeltasForRound.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_transaction_group_ledger_state_deltas_for_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_transaction_proof(self, round: int,txid: str,hashtype: typing.Optional[Hashtype],format: typing.Optional[Format]) -> TransactionProof: + """ + Get a proof for a transaction in a block. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + + _UniffiFfiConverterString.check_lower(txid) + + _UniffiFfiConverterOptionalTypeHashtype.check_lower(hashtype) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + _UniffiFfiConverterString.lower(txid), + _UniffiFfiConverterOptionalTypeHashtype.lower(hashtype), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionProof.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_transaction_proof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def get_version(self, ) -> Version: + """ + Retrieves the supported API versions, binary build versions, and genesis information. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeVersion.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_get_version(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def health_check(self, ) -> None: + """ + Returns OK if healthy. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_health_check(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def metrics(self, ) -> None: + """ + Return metrics about algod functioning. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_metrics(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def pending_transaction_information(self, txid: str) -> PendingTransactionResponse: + """ + Get a specific pending transaction. +""" + + _UniffiFfiConverterString.check_lower(txid) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(txid), + ) + _uniffi_lift_return = _UniffiFfiConverterTypePendingTransactionResponse.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_pending_transaction_information(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def put_debug_settings_prof(self, ) -> DebugSettingsProf: + """ + Enables blocking and mutex profiles, and returns the old settings +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeDebugSettingsProf.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_put_debug_settings_prof(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def raw_transaction(self, request: bytes) -> RawTransaction: + """ + Broadcasts a raw transaction or transaction group to the network. +""" + + _UniffiFfiConverterBytes.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeRawTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_raw_transaction(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def raw_transaction_async(self, request: bytes) -> None: + """ + Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing. +""" + + _UniffiFfiConverterBytes.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_raw_transaction_async(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def set_block_time_stamp_offset(self, offset: int) -> None: + """ + Given a timestamp offset in seconds, adds the offset to every subsequent block header's timestamp. +""" + + _UniffiFfiConverterUInt64.check_lower(offset) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(offset), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_set_block_time_stamp_offset(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def set_sync_round(self, round: int) -> None: + """ + Given a round, tells the ledger to keep that round in its cache. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_set_sync_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def shutdown_node(self, timeout: typing.Optional[int]) -> UnknownJsonValue: + """ + Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds. +""" + + _UniffiFfiConverterOptionalUInt64.check_lower(timeout) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterOptionalUInt64.lower(timeout), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeUnknownJsonValue.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_shutdown_node(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def simulate_transaction(self, request: SimulateRequest,format: typing.Optional[Format]) -> SimulateTransaction: + """ + Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round. +""" + + _UniffiFfiConverterTypeSimulateRequest.check_lower(request) + + _UniffiFfiConverterOptionalTypeFormat.check_lower(format) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeSimulateRequest.lower(request), + _UniffiFfiConverterOptionalTypeFormat.lower(format), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeSimulateTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_simulate_transaction(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def start_catchup(self, catchpoint: str,min: typing.Optional[int]) -> StartCatchup: + """ + Starts a catchpoint catchup. +""" + + _UniffiFfiConverterString.check_lower(catchpoint) + + _UniffiFfiConverterOptionalUInt64.check_lower(min) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(catchpoint), + _UniffiFfiConverterOptionalUInt64.lower(min), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeStartCatchup.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_start_catchup(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def swagger_json(self, ) -> str: + """ + Gets the current swagger spec. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_swagger_json(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def teal_compile(self, request: bytes,sourcemap: typing.Optional[bool]) -> TealCompile: + """ + Compile TEAL source code to binary, produce its hash +""" + + _UniffiFfiConverterBytes.check_lower(request) + + _UniffiFfiConverterOptionalBoolean.check_lower(sourcemap) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(request), + _UniffiFfiConverterOptionalBoolean.lower(sourcemap), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTealCompile.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_compile(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def teal_disassemble(self, request: str) -> TealDisassemble: + """ + Disassemble program bytes into the TEAL source code. +""" + + _UniffiFfiConverterString.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTealDisassemble.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_disassemble(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def teal_dryrun(self, request: typing.Optional[DryrunRequest]) -> TealDryrun: + """ + Provide debugging information for a transaction (or group). +""" + + _UniffiFfiConverterOptionalTypeDryrunRequest.check_lower(request) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterOptionalTypeDryrunRequest.lower(request), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTealDryrun.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_teal_dryrun(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def transaction_params(self, ) -> TransactionParams: + """ + Get parameters for constructing a new transaction +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionParams.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_transaction_params(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def unset_sync_round(self, ) -> None: + """ + Removes minimum sync round restriction from the ledger. +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_unset_sync_round(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_void, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def wait_for_block(self, round: int) -> WaitForBlock: + """ + Gets the node status after waiting for a round after the given round. +""" + + _UniffiFfiConverterUInt64.check_lower(round) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterUInt64.lower(round), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeWaitForBlock.lift + _uniffi_error_converter = _UniffiFfiConverterTypeError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algod_client_ffi_fn_method_algodclient_wait_for_block(*_uniffi_lowered_args), + _UniffiLib.ffi_algod_client_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algod_client_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + + + + + +class _UniffiFfiConverterTypeAlgodClient: + @staticmethod + def lift(value: int) -> AlgodClient: + return AlgodClient._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: AlgodClient): + if not isinstance(value, AlgodClient): + raise TypeError("Expected AlgodClient instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: AlgodClient) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> AlgodClient: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: AlgodClient, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + +class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u8" + VALUE_MIN = 0 + VALUE_MAX = 2**8 + + @staticmethod + def read(buf): + return buf.read_u8() + + @staticmethod + def write(value, buf): + buf.write_u8(value) + + + +__all__ = [ + "InternalError", + "AbortCatchupError", + "AccountApplicationInformationError", + "AccountAssetInformationError", + "AccountAssetsInformationError", + "AccountInformationError", + "AddParticipationKeyError", + "HealthCheckError", + "GetReadyError", + "MetricsError", + "GetGenesisError", + "SwaggerJsonError", + "GetVersionError", + "GetDebugSettingsProfError", + "PutDebugSettingsProfError", + "GetConfigError", + "GetPendingTransactionsByAddressError", + "GetBlockError", + "GetBlockTxidsError", + "GetBlockHashError", + "GetTransactionProofError", + "GetBlockLogsError", + "GetSupplyError", + "GetParticipationKeysError", + "GenerateParticipationKeysError", + "GetParticipationKeyByIdError", + "AppendKeysError", + "DeleteParticipationKeyByIdError", + "ShutdownNodeError", + "GetStatusError", + "WaitForBlockError", + "RawTransactionError", + "RawTransactionAsyncError", + "SimulateTransactionError", + "TransactionParamsError", + "GetPendingTransactionsError", + "PendingTransactionInformationError", + "GetLedgerStateDeltaError", + "GetTransactionGroupLedgerStateDeltasForRoundError", + "GetLedgerStateDeltaForTransactionGroupError", + "GetStateProofError", + "GetLightBlockHeaderProofError", + "GetApplicationByIdError", + "GetApplicationBoxesError", + "GetApplicationBoxByNameError", + "GetAssetByIdError", + "GetSyncRoundError", + "UnsetSyncRoundError", + "SetSyncRoundError", + "TealCompileError", + "TealDisassembleError", + "StartCatchupError", + "TealDryrunError", + "ExperimentalCheckError", + "GetBlockTimeStampOffsetError", + "SetBlockTimeStampOffsetError", + "AlgodApiError", + "Error", + "Exclude", + "Format", + "Hashtype", + "AbortCatchup", + "ApplicationStateSchema", + "TealValue", + "TealKeyValue", + "ApplicationLocalState", + "AssetHolding", + "ApplicationParams", + "Application", + "AssetParams", + "Asset", + "AccountParticipation", + "Account", + "AccountApplicationInformation", + "AccountAssetHolding", + "AccountAssetInformation", + "AccountAssetsInformation", + "EvalDelta", + "EvalDeltaKeyValue", + "AccountStateDelta", + "AddParticipationKey", + "AppCallLogs", + "AvmValue", + "AvmKeyValue", + "ApplicationKvStorage", + "ApplicationInitialStates", + "ApplicationLocalReference", + "ApplicationStateOperation", + "AssetHoldingReference", + "BlockStateProofTrackingData", + "BlockEvalDelta", + "BlockAppEvalDelta", + "SignedTxnInBlock", + "Block", + "BlockAccountStateDelta", + "Box", + "BoxDescriptor", + "BoxReference", + "BuildVersion", + "DebugSettingsProf", + "DryrunSource", + "DryrunRequest", + "DryrunState", + "DryrunTxnResult", + "ErrorResponse", + "GenesisAllocation", + "Genesis", + "GetApplicationBoxes", + "GetBlock", + "GetBlockHash", + "GetBlockLogs", + "GetBlockTimeStampOffset", + "GetBlockTxids", + "GetPendingTransactions", + "GetPendingTransactionsByAddress", + "GetStatus", + "GetSupply", + "GetSyncRound", + "LedgerStateDelta", + "LedgerStateDeltaForTransactionGroup", + "GetTransactionGroupLedgerStateDeltasForRound", + "LightBlockHeaderProof", + "ParticipationKey", + "PendingTransactionResponse", + "RawTransaction", + "ScratchChange", + "SimulateInitialStates", + "SimulateRequestTransactionGroup", + "SimulateTraceConfig", + "SimulateRequest", + "SimulationOpcodeTraceUnit", + "SimulationTransactionExecTrace", + "SimulateUnnamedResourcesAccessed", + "SimulateTransactionResult", + "SimulateTransactionGroupResult", + "SimulationEvalOverrides", + "SimulateTransaction", + "StartCatchup", + "StateProofMessage", + "StateProof", + "TealCompile", + "TealDisassemble", + "TealDryrun", + "TransactionParams", + "TransactionProof", + "Version", + "WaitForBlock", + "AlgodClientTraitImpl", + "AlgodClientTrait", + "AlgodClient", + "AlgodClientProtocol", +] \ No newline at end of file diff --git a/packages/python/algokit_utils/algokit_utils/algokit_http_client.py b/packages/python/algokit_utils/algokit_utils/algokit_http_client.py new file mode 100644 index 000000000..bcfbe8783 --- /dev/null +++ b/packages/python/algokit_utils/algokit_utils/algokit_http_client.py @@ -0,0 +1,1414 @@ +# This file was autogenerated by some hot garbage in the `uniffi` crate. +# Trust me, you don't want to mess with it! + +# Common helper code. +# +# Ideally this would live in a separate .py file where it can be unittested etc +# in isolation, and perhaps even published as a re-useable package. +# +# However, it's important that the details of how this helper code works (e.g. the +# way that different builtin types are passed across the FFI) exactly match what's +# expected by the rust code on the other side of the interface. In practice right +# now that means coming from the exact some version of `uniffi` that was used to +# compile the rust component. The easiest way to ensure this is to bundle the Python +# helpers directly inline like we're doing here. + +from __future__ import annotations +import os +import sys +import ctypes +from dataclasses import dataclass +import enum +import struct +import contextlib +import datetime +import threading +import itertools +import traceback +import typing +import asyncio +import platform + + +# Used for default argument values +_DEFAULT = object() # type: typing.Any + + +class _UniffiRustBuffer(ctypes.Structure): + _fields_ = [ + ("capacity", ctypes.c_uint64), + ("len", ctypes.c_uint64), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + @staticmethod + def default(): + return _UniffiRustBuffer(0, 0, None) + + @staticmethod + def alloc(size): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_http_client_rustbuffer_alloc, size) + + @staticmethod + def reserve(rbuf, additional): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_http_client_rustbuffer_reserve, rbuf, additional) + + def free(self): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_http_client_rustbuffer_free, self) + + def __str__(self): + return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( + self.capacity, + self.len, + self.data[0:self.len] + ) + + @contextlib.contextmanager + def alloc_with_builder(*args): + """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. + + The allocated buffer will be automatically freed if an error occurs, ensuring that + we don't accidentally leak it. + """ + builder = _UniffiRustBufferBuilder() + try: + yield builder + except: + builder.discard() + raise + + @contextlib.contextmanager + def consume_with_stream(self): + """Context-manager to consume a buffer using a _UniffiRustBufferStream. + + The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't + leak it even if an error occurs. + """ + try: + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of consume_with_stream {s.remaining()}") + finally: + self.free() + + @contextlib.contextmanager + def read_with_stream(self): + """Context-manager to read a buffer using a _UniffiRustBufferStream. + + This is like consume_with_stream, but doesn't free the buffer afterwards. + It should only be used with borrowed `_UniffiRustBuffer` data. + """ + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of read_with_stream {s.remaining()}") + +class _UniffiForeignBytes(ctypes.Structure): + _fields_ = [ + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + def __str__(self): + return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) + + +class _UniffiRustBufferStream: + """ + Helper for structured reading of bytes from a _UniffiRustBuffer + """ + + def __init__(self, data, len): + self.data = data + self.len = len + self.offset = 0 + + @classmethod + def from_rust_buffer(cls, buf): + return cls(buf.data, buf.len) + + def remaining(self): + return self.len - self.offset + + def _unpack_from(self, size, format): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] + self.offset += size + return value + + def read(self, size): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + data = self.data[self.offset:self.offset+size] + self.offset += size + return data + + def read_i8(self): + return self._unpack_from(1, ">b") + + def read_u8(self): + return self._unpack_from(1, ">B") + + def read_i16(self): + return self._unpack_from(2, ">h") + + def read_u16(self): + return self._unpack_from(2, ">H") + + def read_i32(self): + return self._unpack_from(4, ">i") + + def read_u32(self): + return self._unpack_from(4, ">I") + + def read_i64(self): + return self._unpack_from(8, ">q") + + def read_u64(self): + return self._unpack_from(8, ">Q") + + def read_float(self): + v = self._unpack_from(4, ">f") + return v + + def read_double(self): + return self._unpack_from(8, ">d") + +class _UniffiRustBufferBuilder: + """ + Helper for structured writing of bytes into a _UniffiRustBuffer. + """ + + def __init__(self): + self.rbuf = _UniffiRustBuffer.alloc(16) + self.rbuf.len = 0 + + def finalize(self): + rbuf = self.rbuf + self.rbuf = None + return rbuf + + def discard(self): + if self.rbuf is not None: + rbuf = self.finalize() + rbuf.free() + + @contextlib.contextmanager + def _reserve(self, num_bytes): + if self.rbuf.len + num_bytes > self.rbuf.capacity: + self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) + yield None + self.rbuf.len += num_bytes + + def _pack_into(self, size, format, value): + with self._reserve(size): + # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. + for i, byte in enumerate(struct.pack(format, value)): + self.rbuf.data[self.rbuf.len + i] = byte + + def write(self, value): + with self._reserve(len(value)): + for i, byte in enumerate(value): + self.rbuf.data[self.rbuf.len + i] = byte + + def write_i8(self, v): + self._pack_into(1, ">b", v) + + def write_u8(self, v): + self._pack_into(1, ">B", v) + + def write_i16(self, v): + self._pack_into(2, ">h", v) + + def write_u16(self, v): + self._pack_into(2, ">H", v) + + def write_i32(self, v): + self._pack_into(4, ">i", v) + + def write_u32(self, v): + self._pack_into(4, ">I", v) + + def write_i64(self, v): + self._pack_into(8, ">q", v) + + def write_u64(self, v): + self._pack_into(8, ">Q", v) + + def write_float(self, v): + self._pack_into(4, ">f", v) + + def write_double(self, v): + self._pack_into(8, ">d", v) + + def write_c_size_t(self, v): + self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) +# A handful of classes and functions to support the generated data structures. +# This would be a good candidate for isolating in its own ffi-support lib. + +class InternalError(Exception): + pass + +class _UniffiRustCallStatus(ctypes.Structure): + """ + Error runtime. + """ + _fields_ = [ + ("code", ctypes.c_int8), + ("error_buf", _UniffiRustBuffer), + ] + + # These match the values from the uniffi::rustcalls module + CALL_SUCCESS = 0 + CALL_ERROR = 1 + CALL_UNEXPECTED_ERROR = 2 + + @staticmethod + def default(): + return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default()) + + def __str__(self): + if self.code == _UniffiRustCallStatus.CALL_SUCCESS: + return "_UniffiRustCallStatus(CALL_SUCCESS)" + elif self.code == _UniffiRustCallStatus.CALL_ERROR: + return "_UniffiRustCallStatus(CALL_ERROR)" + elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)" + else: + return "_UniffiRustCallStatus()" + +def _uniffi_rust_call(fn, *args): + # Call a rust function + return _uniffi_rust_call_with_error(None, fn, *args) + +def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args): + # Call a rust function and handle any errors + # + # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. + # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. + call_status = _UniffiRustCallStatus.default() + + args_with_error = args + (ctypes.byref(call_status),) + result = fn(*args_with_error) + _uniffi_check_call_status(error_ffi_converter, call_status) + return result + +def _uniffi_check_call_status(error_ffi_converter, call_status): + if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: + pass + elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: + if error_ffi_converter is None: + call_status.error_buf.free() + raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") + else: + raise error_ffi_converter.lift(call_status.error_buf) + elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer + # with the message. But if that code panics, then it just sends back + # an empty buffer. + if call_status.error_buf.len > 0: + msg = _UniffiFfiConverterString.lift(call_status.error_buf) + else: + msg = "Unknown rust panic" + raise InternalError(msg) + else: + raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( + call_status.code)) + +def _uniffi_trait_interface_call(call_status, make_call, write_return_value): + try: + return write_return_value(make_call()) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) + +def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error): + try: + try: + return write_return_value(make_call()) + except error_type as e: + call_status.code = _UniffiRustCallStatus.CALL_ERROR + call_status.error_buf = lower_error(e) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) +# Initial value and increment amount for handles. +# These ensure that Python-generated handles always have the lowest bit set +_UNIFFI_HANDLEMAP_INITIAL = 1 +_UNIFFI_HANDLEMAP_DELTA = 2 + +class _UniffiHandleMap: + """ + A map where inserting, getting and removing data is synchronized with a lock. + """ + + def __init__(self): + # type Handle = int + self._map = {} # type: Dict[Handle, Any] + self._lock = threading.Lock() + self._counter = _UNIFFI_HANDLEMAP_INITIAL + + def insert(self, obj): + with self._lock: + return self._insert(obj) + + """Low-level insert, this assumes `self._lock` is held.""" + def _insert(self, obj): + handle = self._counter + self._counter += _UNIFFI_HANDLEMAP_DELTA + self._map[handle] = obj + return handle + + def get(self, handle): + try: + with self._lock: + return self._map[handle] + except KeyError: + raise InternalError(f"_UniffiHandleMap.get: Invalid handle {handle}") + + def clone(self, handle): + try: + with self._lock: + obj = self._map[handle] + return self._insert(obj) + except KeyError: + raise InternalError(f"_UniffiHandleMap.clone: Invalid handle {handle}") + + def remove(self, handle): + try: + with self._lock: + return self._map.pop(handle) + except KeyError: + raise InternalError(f"_UniffiHandleMap.remove: Invalid handle: {handle}") + + def __len__(self): + return len(self._map) +# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. +class _UniffiConverterPrimitive: + @classmethod + def lift(cls, value): + return value + + @classmethod + def lower(cls, value): + return value + +class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__index__() + except Exception: + raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) + if not isinstance(value, int): + raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) + if not cls.VALUE_MIN <= value < cls.VALUE_MAX: + raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) + +class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__float__() + except Exception: + raise TypeError("must be real number, not {}".format(type(value).__name__)) + if not isinstance(value, float): + raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) + +# Helper class for wrapper types that will always go through a _UniffiRustBuffer. +# Classes should inherit from this and implement the `read` and `write` static methods. +class _UniffiConverterRustBuffer: + @classmethod + def lift(cls, rbuf): + with rbuf.consume_with_stream() as stream: + return cls.read(stream) + + @classmethod + def lower(cls, value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + cls.write(value, builder) + return builder.finalize() + +# Contains loading, initialization code, and the FFI Function declarations. +# Define some ctypes FFI types that we use in the library + +""" +Function pointer for a Rust task, which a callback function that takes a opaque pointer +""" +_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) + +def _uniffi_future_callback_t(return_type): + """ + Factory function to create callback function types for async functions + """ + return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus) + +def _uniffi_load_indirect(): + """ + This is how we find and load the dynamic library provided by the component. + For now we just look it up by name. + """ + if sys.platform == "darwin": + libname = "lib{}.dylib" + elif sys.platform.startswith("win"): + # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. + # We could use `os.add_dll_directory` to configure the search path, but + # it doesn't feel right to mess with application-wide settings. Let's + # assume that the `.dll` is next to the `.py` file and load by full path. + libname = os.path.join( + os.path.dirname(__file__), + "{}.dll", + ) + else: + # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos + libname = "lib{}.so" + + libname = libname.format("algokit_utils_ffi") + path = os.path.join(os.path.dirname(__file__), libname) + lib = ctypes.cdll.LoadLibrary(path) + return lib + +def _uniffi_check_contract_api_version(lib): + # Get the bindings contract version from our ComponentInterface + bindings_contract_version = 30 + # Get the scaffolding contract version by calling the into the dylib + scaffolding_contract_version = lib.ffi_algokit_http_client_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version: + raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + +def _uniffi_check_api_checksums(lib): + if lib.uniffi_algokit_http_client_checksum_method_httpclient_request() != 1454: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +# A ctypes library to expose the extern-C FFI definitions. +# This is an implementation detail which will be called internally by the public API. + +_UniffiLib = _uniffi_load_indirect() +_UniffiLib.ffi_algokit_http_client_rustbuffer_alloc.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rustbuffer_alloc.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_http_client_rustbuffer_from_bytes.argtypes = ( + _UniffiForeignBytes, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rustbuffer_from_bytes.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_http_client_rustbuffer_free.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rustbuffer_free.restype = None +_UniffiLib.ffi_algokit_http_client_rustbuffer_reserve.argtypes = ( + _UniffiRustBuffer, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rustbuffer_reserve.restype = _UniffiRustBuffer +_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8, +) +_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure): + _fields_ = [ + ("handle", ctypes.c_uint64), + ("free", _UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK), + ] +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u8.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u8.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u8.restype = ctypes.c_uint8 +_UniffiLib.ffi_algokit_http_client_rust_future_free_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_u8.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i8.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i8.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i8.restype = ctypes.c_int8 +_UniffiLib.ffi_algokit_http_client_rust_future_free_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_i8.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u16.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u16.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u16.restype = ctypes.c_uint16 +_UniffiLib.ffi_algokit_http_client_rust_future_free_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_u16.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i16.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i16.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i16.restype = ctypes.c_int16 +_UniffiLib.ffi_algokit_http_client_rust_future_free_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_i16.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u32.restype = ctypes.c_uint32 +_UniffiLib.ffi_algokit_http_client_rust_future_free_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_u32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i32.restype = ctypes.c_int32 +_UniffiLib.ffi_algokit_http_client_rust_future_free_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_i32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_u64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_u64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_u64.restype = ctypes.c_uint64 +_UniffiLib.ffi_algokit_http_client_rust_future_free_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_u64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_i64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_i64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_i64.restype = ctypes.c_int64 +_UniffiLib.ffi_algokit_http_client_rust_future_free_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_i64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_f32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_f32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_f32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_f32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_f32.restype = ctypes.c_float +_UniffiLib.ffi_algokit_http_client_rust_future_free_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_f32.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_f64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_f64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_f64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_f64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_f64.restype = ctypes.c_double +_UniffiLib.ffi_algokit_http_client_rust_future_free_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_f64.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_rust_buffer.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_rust_buffer.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_rust_buffer.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_rust_buffer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_http_client_rust_future_free_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_rust_buffer.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_poll_void.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_poll_void.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_cancel_void.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_complete_void.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_http_client_rust_future_complete_void.restype = None +_UniffiLib.ffi_algokit_http_client_rust_future_free_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_http_client_rust_future_free_void.restype = None +_UniffiLib.uniffi_algokit_http_client_fn_clone_httpclient.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_http_client_fn_clone_httpclient.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_http_client_fn_free_httpclient.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_http_client_fn_free_httpclient.restype = None +class _UniffiForeignFutureResultRustBuffer(ctypes.Structure): + _fields_ = [ + ("return_value", _UniffiRustBuffer), + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultRustBuffer, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64, +) +_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiVTableCallbackInterfaceAlgokitHttpClientHttpClient(ctypes.Structure): + _fields_ = [ + ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT), + ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT), + ("request", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT_METHOD0), + ] +_UniffiLib.uniffi_algokit_http_client_fn_init_callback_vtable_httpclient.argtypes = ( + ctypes.POINTER(_UniffiVTableCallbackInterfaceAlgokitHttpClientHttpClient), +) +_UniffiLib.uniffi_algokit_http_client_fn_init_callback_vtable_httpclient.restype = None +_UniffiLib.uniffi_algokit_http_client_fn_method_httpclient_request.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algokit_http_client_fn_method_httpclient_request.restype = ctypes.c_uint64 +_UniffiLib.ffi_algokit_http_client_uniffi_contract_version.argtypes = ( +) +_UniffiLib.ffi_algokit_http_client_uniffi_contract_version.restype = ctypes.c_uint32 +_UniffiLib.uniffi_algokit_http_client_checksum_method_httpclient_request.argtypes = ( +) +_UniffiLib.uniffi_algokit_http_client_checksum_method_httpclient_request.restype = ctypes.c_uint16 + +_uniffi_check_contract_api_version(_UniffiLib) +# _uniffi_check_api_checksums(_UniffiLib) + +# RustFuturePoll values +_UNIFFI_RUST_FUTURE_POLL_READY = 0 +_UNIFFI_RUST_FUTURE_POLL_WAKE = 1 + +# Stores futures for _uniffi_continuation_callback +_UniffiContinuationHandleMap = _UniffiHandleMap() + +_UNIFFI_GLOBAL_EVENT_LOOP = None + +""" +Set the event loop to use for async functions + +This is needed if some async functions run outside of the eventloop, for example: + - A non-eventloop thread is spawned, maybe from `EventLoop.run_in_executor` or maybe from the + Rust code spawning its own thread. + - The Rust code calls an async callback method from a sync callback function, using something + like `pollster` to block on the async call. + +In this case, we need an event loop to run the Python async function, but there's no eventloop set +for the thread. Use `uniffi_set_event_loop` to force an eventloop to be used in this case. +""" +def uniffi_set_event_loop(eventloop: asyncio.BaseEventLoop): + global _UNIFFI_GLOBAL_EVENT_LOOP + _UNIFFI_GLOBAL_EVENT_LOOP = eventloop + +def _uniffi_get_event_loop(): + if _UNIFFI_GLOBAL_EVENT_LOOP is not None: + return _UNIFFI_GLOBAL_EVENT_LOOP + else: + return asyncio.get_running_loop() + +# Continuation callback for async functions +# lift the return value or error and resolve the future, causing the async function to resume. +@_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK +def _uniffi_continuation_callback(future_ptr, poll_code): + (eventloop, future) = _UniffiContinuationHandleMap.remove(future_ptr) + eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code) + +def _uniffi_set_future_result(future, poll_code): + if not future.cancelled(): + future.set_result(poll_code) + +async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter): + try: + eventloop = _uniffi_get_event_loop() + + # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value + while True: + future = eventloop.create_future() + ffi_poll( + rust_future, + _uniffi_continuation_callback, + _UniffiContinuationHandleMap.insert((eventloop, future)), + ) + poll_code = await future + if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY: + break + + return lift_func( + _uniffi_rust_call_with_error(error_ffi_converter, ffi_complete, rust_future) + ) + finally: + ffi_free(rust_future) +def _uniffi_trait_interface_call_async(make_call, uniffi_out_dropped_callback, handle_success, handle_error): + async def make_call_and_call_callback(): + try: + handle_success(await make_call()) + except Exception as e: + print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + handle_error( + _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR, + _UniffiFfiConverterString.lower(repr(e)), + ) + eventloop = _uniffi_get_event_loop() + task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop) + handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task)) + uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback) + +def _uniffi_trait_interface_call_async_with_error(make_call, uniffi_out_dropped_callback, handle_success, handle_error, error_type, lower_error): + async def make_call_and_call_callback(): + try: + try: + handle_success(await make_call()) + except error_type as e: + handle_error( + _UniffiRustCallStatus.CALL_ERROR, + lower_error(e), + ) + except Exception as e: + print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + handle_error( + _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR, + _UniffiFfiConverterString.lower(repr(e)), + ) + eventloop = _uniffi_get_event_loop() + task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop) + handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task)) + uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback) + +_UNIFFI_FOREIGN_FUTURE_HANDLE_MAP = _UniffiHandleMap() + +@_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK +def _uniffi_future_dropped_callback(handle): + (eventloop, task) = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.remove(handle) + eventloop.call_soon(_uniffi_cancel_task, task) + +def _uniffi_cancel_task(task): + if not task.done(): + task.cancel() + +# Public interface members begin here. + + +class _UniffiFfiConverterBytes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative byte string length") + return buf.read(size) + + @staticmethod + def check_lower(value): + try: + memoryview(value) + except TypeError: + raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) + + @staticmethod + def write(value, buf): + buf.write_i32(len(value)) + buf.write(value) + +class _UniffiFfiConverterString: + @staticmethod + def check_lower(value): + if not isinstance(value, str): + raise TypeError("argument must be str, not {}".format(type(value).__name__)) + return value + + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative string length") + utf8_bytes = buf.read(size) + return utf8_bytes.decode("utf-8") + + @staticmethod + def write(value, buf): + utf8_bytes = value.encode("utf-8") + buf.write_i32(len(utf8_bytes)) + buf.write(utf8_bytes) + + @staticmethod + def lift(buf): + with buf.consume_with_stream() as stream: + return stream.read(stream.remaining()).decode("utf-8") + + @staticmethod + def lower(value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + builder.write(value.encode("utf-8")) + return builder.finalize() + +class _UniffiFfiConverterMapStringString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiFfiConverterString.check_lower(key) + _UniffiFfiConverterString.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiFfiConverterString.write(key, buf) + _UniffiFfiConverterString.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiFfiConverterString.read(buf) + val = _UniffiFfiConverterString.read(buf) + d[key] = val + return d + +@dataclass +class HttpResponse: + def __init__(self, *, body:bytes, headers:dict[str, str]): + self.body = body + self.headers = headers + + + + + def __str__(self): + return "HttpResponse(body={}, headers={})".format(self.body, self.headers) + def __eq__(self, other): + if self.body != other.body: + return False + if self.headers != other.headers: + return False + return True + +class _UniffiFfiConverterTypeHttpResponse(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return HttpResponse( + body=_UniffiFfiConverterBytes.read(buf), + headers=_UniffiFfiConverterMapStringString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.body) + _UniffiFfiConverterMapStringString.check_lower(value.headers) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.body, buf) + _UniffiFfiConverterMapStringString.write(value.headers, buf) + + + +# HttpError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class HttpError(Exception): + pass + +_UniffiTempHttpError = HttpError + +class HttpError: # type: ignore + + class RequestError(_UniffiTempHttpError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "HttpError.RequestError({})".format(str(self)) + _UniffiTempHttpError.RequestError = RequestError # type: ignore + +HttpError = _UniffiTempHttpError # type: ignore +del _UniffiTempHttpError + + +class _UniffiFfiConverterTypeHttpError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return HttpError.RequestError( + _UniffiFfiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, HttpError.RequestError): + _UniffiFfiConverterString.check_lower(value.message) + return + + @staticmethod + def write(value, buf): + if isinstance(value, HttpError.RequestError): + buf.write_i32(1) + _UniffiFfiConverterString.write(value.message, buf) + + + + + + +class HttpMethod(enum.Enum): + + GET = 0 + + POST = 1 + + PUT = 2 + + DELETE = 3 + + PATCH = 4 + + HEAD = 5 + + OPTIONS = 6 + + + +class _UniffiFfiConverterTypeHttpMethod(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return HttpMethod.GET + if variant == 2: + return HttpMethod.POST + if variant == 3: + return HttpMethod.PUT + if variant == 4: + return HttpMethod.DELETE + if variant == 5: + return HttpMethod.PATCH + if variant == 6: + return HttpMethod.HEAD + if variant == 7: + return HttpMethod.OPTIONS + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == HttpMethod.GET: + return + if value == HttpMethod.POST: + return + if value == HttpMethod.PUT: + return + if value == HttpMethod.DELETE: + return + if value == HttpMethod.PATCH: + return + if value == HttpMethod.HEAD: + return + if value == HttpMethod.OPTIONS: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == HttpMethod.GET: + buf.write_i32(1) + if value == HttpMethod.POST: + buf.write_i32(2) + if value == HttpMethod.PUT: + buf.write_i32(3) + if value == HttpMethod.DELETE: + buf.write_i32(4) + if value == HttpMethod.PATCH: + buf.write_i32(5) + if value == HttpMethod.HEAD: + buf.write_i32(6) + if value == HttpMethod.OPTIONS: + buf.write_i32(7) + + + +class _UniffiFfiConverterOptionalMapStringString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterMapStringString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterMapStringString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterMapStringString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + +class HttpClient(): + """ + This trait must be implemented by any HTTP client that is used by our Rust crates. + It is assumed the implementing type will provide the hostname, port, headers, etc. as needed for each request. + + By default, this trait requires the implementing type to be `Send + Sync`. +""" + + async def request(self, http_method: HttpMethod,path: str,query: typing.Optional[dict[str, str]],body: typing.Optional[bytes],headers: typing.Optional[dict[str, str]]) -> HttpResponse: + raise NotImplementedError + +class HttpClientImpl(HttpClient): + """ + This trait must be implemented by any HTTP client that is used by our Rust crates. + It is assumed the implementing type will provide the hostname, port, headers, etc. as needed for each request. + + By default, this trait requires the implementing type to be `Send + Sync`. +""" + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_http_client_fn_free_httpclient, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_http_client_fn_clone_httpclient, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + async def request(self, http_method: HttpMethod,path: str,query: typing.Optional[dict[str, str]],body: typing.Optional[bytes],headers: typing.Optional[dict[str, str]]) -> HttpResponse: + + _UniffiFfiConverterTypeHttpMethod.check_lower(http_method) + + _UniffiFfiConverterString.check_lower(path) + + _UniffiFfiConverterOptionalMapStringString.check_lower(query) + + _UniffiFfiConverterOptionalBytes.check_lower(body) + + _UniffiFfiConverterOptionalMapStringString.check_lower(headers) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeHttpMethod.lower(http_method), + _UniffiFfiConverterString.lower(path), + _UniffiFfiConverterOptionalMapStringString.lower(query), + _UniffiFfiConverterOptionalBytes.lower(body), + _UniffiFfiConverterOptionalMapStringString.lower(headers), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeHttpResponse.lift + _uniffi_error_converter = _UniffiFfiConverterTypeHttpError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_http_client_fn_method_httpclient_request(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_http_client_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_http_client_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_http_client_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + + + + +# Put all the bits inside a class to keep the top-level namespace clean +class _UniffiTraitImplHttpClientImpl: + # For each method, generate a callback function to pass to Rust + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT_METHOD0 + def request( + uniffi_handle, + http_method, + path, + query, + body, + headers, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeHttpClient._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeHttpMethod.lift(http_method), _UniffiFfiConverterString.lift(path), _UniffiFfiConverterOptionalMapStringString.lift(query), _UniffiFfiConverterOptionalBytes.lift(body), _UniffiFfiConverterOptionalMapStringString.lift(headers), ) + uniffi_method = uniffi_obj.request + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeHttpResponse.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + HttpError, + _UniffiFfiConverterTypeHttpError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT + def _uniffi_free(uniffi_handle): + _UniffiFfiConverterTypeHttpClient._handle_map.remove(uniffi_handle) + + @_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_HTTP_CLIENT_HTTP_CLIENT + def _uniffi_clone(uniffi_handle): + return _UniffiFfiConverterTypeHttpClient._handle_map.clone(uniffi_handle) + + # Generate the FFI VTable. This has a field for each callback interface method. + _uniffi_vtable = _UniffiVTableCallbackInterfaceAlgokitHttpClientHttpClient( + _uniffi_free, + _uniffi_clone, + request, + ) + # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever, + # or else bad things will happen when Rust tries to access it. + _UniffiLib.uniffi_algokit_http_client_fn_init_callback_vtable_httpclient(ctypes.byref(_uniffi_vtable)) + +class _UniffiFfiConverterTypeHttpClient: + _handle_map = _UniffiHandleMap() + + @staticmethod + def lift(value: int): + if (value & 1) == 0: + # Rust-generated handle, construct a new class that uses the handle to implement the + # interface + return HttpClientImpl._uniffi_make_instance(value) + else: + # Python-generated handle, get the object from the handle map + return _UniffiFfiConverterTypeHttpClient._handle_map.remove(value) + + @staticmethod + def check_lower(value: HttpClient): + if not isinstance(value, HttpClient): + raise TypeError("Expected HttpClient subclass, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: HttpClient): + if isinstance(value, HttpClientImpl): + # Rust-implementated object. Clone the handle and return it + return value._uniffi_clone_handle() + else: + # Python-implementated object, generate a new vtable handle and return that. + return _UniffiFfiConverterTypeHttpClient._handle_map.insert(value) + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: HttpClient, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + +class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u8" + VALUE_MIN = 0 + VALUE_MAX = 2**8 + + @staticmethod + def read(buf): + return buf.read_u8() + + @staticmethod + def write(value, buf): + buf.write_u8(value) + +__all__ = [ + "InternalError", + "HttpError", + "HttpMethod", + "HttpResponse", + "HttpClientImpl", + "HttpClient", +] \ No newline at end of file diff --git a/packages/python/algokit_utils/algokit_utils/algokit_transact_ffi.py b/packages/python/algokit_utils/algokit_utils/algokit_transact_ffi.py new file mode 100644 index 000000000..093a81313 --- /dev/null +++ b/packages/python/algokit_utils/algokit_utils/algokit_transact_ffi.py @@ -0,0 +1,4395 @@ +# This file was autogenerated by some hot garbage in the `uniffi` crate. +# Trust me, you don't want to mess with it! + +# Common helper code. +# +# Ideally this would live in a separate .py file where it can be unittested etc +# in isolation, and perhaps even published as a re-useable package. +# +# However, it's important that the details of how this helper code works (e.g. the +# way that different builtin types are passed across the FFI) exactly match what's +# expected by the rust code on the other side of the interface. In practice right +# now that means coming from the exact some version of `uniffi` that was used to +# compile the rust component. The easiest way to ensure this is to bundle the Python +# helpers directly inline like we're doing here. + +from __future__ import annotations +import os +import sys +import ctypes +from dataclasses import dataclass +import enum +import struct +import contextlib +import datetime +import threading +import itertools +import traceback +import typing +import platform + + +# Used for default argument values +_DEFAULT = object() # type: typing.Any + + +class _UniffiRustBuffer(ctypes.Structure): + _fields_ = [ + ("capacity", ctypes.c_uint64), + ("len", ctypes.c_uint64), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + @staticmethod + def default(): + return _UniffiRustBuffer(0, 0, None) + + @staticmethod + def alloc(size): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_alloc, size) + + @staticmethod + def reserve(rbuf, additional): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_reserve, rbuf, additional) + + def free(self): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_free, self) + + def __str__(self): + return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( + self.capacity, + self.len, + self.data[0:self.len] + ) + + @contextlib.contextmanager + def alloc_with_builder(*args): + """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. + + The allocated buffer will be automatically freed if an error occurs, ensuring that + we don't accidentally leak it. + """ + builder = _UniffiRustBufferBuilder() + try: + yield builder + except: + builder.discard() + raise + + @contextlib.contextmanager + def consume_with_stream(self): + """Context-manager to consume a buffer using a _UniffiRustBufferStream. + + The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't + leak it even if an error occurs. + """ + try: + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of consume_with_stream {s.remaining()}") + finally: + self.free() + + @contextlib.contextmanager + def read_with_stream(self): + """Context-manager to read a buffer using a _UniffiRustBufferStream. + + This is like consume_with_stream, but doesn't free the buffer afterwards. + It should only be used with borrowed `_UniffiRustBuffer` data. + """ + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of read_with_stream {s.remaining()}") + +class _UniffiForeignBytes(ctypes.Structure): + _fields_ = [ + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + def __str__(self): + return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) + + +class _UniffiRustBufferStream: + """ + Helper for structured reading of bytes from a _UniffiRustBuffer + """ + + def __init__(self, data, len): + self.data = data + self.len = len + self.offset = 0 + + @classmethod + def from_rust_buffer(cls, buf): + return cls(buf.data, buf.len) + + def remaining(self): + return self.len - self.offset + + def _unpack_from(self, size, format): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] + self.offset += size + return value + + def read(self, size): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + data = self.data[self.offset:self.offset+size] + self.offset += size + return data + + def read_i8(self): + return self._unpack_from(1, ">b") + + def read_u8(self): + return self._unpack_from(1, ">B") + + def read_i16(self): + return self._unpack_from(2, ">h") + + def read_u16(self): + return self._unpack_from(2, ">H") + + def read_i32(self): + return self._unpack_from(4, ">i") + + def read_u32(self): + return self._unpack_from(4, ">I") + + def read_i64(self): + return self._unpack_from(8, ">q") + + def read_u64(self): + return self._unpack_from(8, ">Q") + + def read_float(self): + v = self._unpack_from(4, ">f") + return v + + def read_double(self): + return self._unpack_from(8, ">d") + +class _UniffiRustBufferBuilder: + """ + Helper for structured writing of bytes into a _UniffiRustBuffer. + """ + + def __init__(self): + self.rbuf = _UniffiRustBuffer.alloc(16) + self.rbuf.len = 0 + + def finalize(self): + rbuf = self.rbuf + self.rbuf = None + return rbuf + + def discard(self): + if self.rbuf is not None: + rbuf = self.finalize() + rbuf.free() + + @contextlib.contextmanager + def _reserve(self, num_bytes): + if self.rbuf.len + num_bytes > self.rbuf.capacity: + self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) + yield None + self.rbuf.len += num_bytes + + def _pack_into(self, size, format, value): + with self._reserve(size): + # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. + for i, byte in enumerate(struct.pack(format, value)): + self.rbuf.data[self.rbuf.len + i] = byte + + def write(self, value): + with self._reserve(len(value)): + for i, byte in enumerate(value): + self.rbuf.data[self.rbuf.len + i] = byte + + def write_i8(self, v): + self._pack_into(1, ">b", v) + + def write_u8(self, v): + self._pack_into(1, ">B", v) + + def write_i16(self, v): + self._pack_into(2, ">h", v) + + def write_u16(self, v): + self._pack_into(2, ">H", v) + + def write_i32(self, v): + self._pack_into(4, ">i", v) + + def write_u32(self, v): + self._pack_into(4, ">I", v) + + def write_i64(self, v): + self._pack_into(8, ">q", v) + + def write_u64(self, v): + self._pack_into(8, ">Q", v) + + def write_float(self, v): + self._pack_into(4, ">f", v) + + def write_double(self, v): + self._pack_into(8, ">d", v) + + def write_c_size_t(self, v): + self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) +# A handful of classes and functions to support the generated data structures. +# This would be a good candidate for isolating in its own ffi-support lib. + +class InternalError(Exception): + pass + +class _UniffiRustCallStatus(ctypes.Structure): + """ + Error runtime. + """ + _fields_ = [ + ("code", ctypes.c_int8), + ("error_buf", _UniffiRustBuffer), + ] + + # These match the values from the uniffi::rustcalls module + CALL_SUCCESS = 0 + CALL_ERROR = 1 + CALL_UNEXPECTED_ERROR = 2 + + @staticmethod + def default(): + return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default()) + + def __str__(self): + if self.code == _UniffiRustCallStatus.CALL_SUCCESS: + return "_UniffiRustCallStatus(CALL_SUCCESS)" + elif self.code == _UniffiRustCallStatus.CALL_ERROR: + return "_UniffiRustCallStatus(CALL_ERROR)" + elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)" + else: + return "_UniffiRustCallStatus()" + +def _uniffi_rust_call(fn, *args): + # Call a rust function + return _uniffi_rust_call_with_error(None, fn, *args) + +def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args): + # Call a rust function and handle any errors + # + # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. + # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. + call_status = _UniffiRustCallStatus.default() + + args_with_error = args + (ctypes.byref(call_status),) + result = fn(*args_with_error) + _uniffi_check_call_status(error_ffi_converter, call_status) + return result + +def _uniffi_check_call_status(error_ffi_converter, call_status): + if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: + pass + elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: + if error_ffi_converter is None: + call_status.error_buf.free() + raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") + else: + raise error_ffi_converter.lift(call_status.error_buf) + elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer + # with the message. But if that code panics, then it just sends back + # an empty buffer. + if call_status.error_buf.len > 0: + msg = _UniffiFfiConverterString.lift(call_status.error_buf) + else: + msg = "Unknown rust panic" + raise InternalError(msg) + else: + raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( + call_status.code)) + +def _uniffi_trait_interface_call(call_status, make_call, write_return_value): + try: + return write_return_value(make_call()) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) + +def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error): + try: + try: + return write_return_value(make_call()) + except error_type as e: + call_status.code = _UniffiRustCallStatus.CALL_ERROR + call_status.error_buf = lower_error(e) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) +# Initial value and increment amount for handles. +# These ensure that Python-generated handles always have the lowest bit set +_UNIFFI_HANDLEMAP_INITIAL = 1 +_UNIFFI_HANDLEMAP_DELTA = 2 + +class _UniffiHandleMap: + """ + A map where inserting, getting and removing data is synchronized with a lock. + """ + + def __init__(self): + # type Handle = int + self._map = {} # type: Dict[Handle, Any] + self._lock = threading.Lock() + self._counter = _UNIFFI_HANDLEMAP_INITIAL + + def insert(self, obj): + with self._lock: + return self._insert(obj) + + """Low-level insert, this assumes `self._lock` is held.""" + def _insert(self, obj): + handle = self._counter + self._counter += _UNIFFI_HANDLEMAP_DELTA + self._map[handle] = obj + return handle + + def get(self, handle): + try: + with self._lock: + return self._map[handle] + except KeyError: + raise InternalError(f"_UniffiHandleMap.get: Invalid handle {handle}") + + def clone(self, handle): + try: + with self._lock: + obj = self._map[handle] + return self._insert(obj) + except KeyError: + raise InternalError(f"_UniffiHandleMap.clone: Invalid handle {handle}") + + def remove(self, handle): + try: + with self._lock: + return self._map.pop(handle) + except KeyError: + raise InternalError(f"_UniffiHandleMap.remove: Invalid handle: {handle}") + + def __len__(self): + return len(self._map) +# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. +class _UniffiConverterPrimitive: + @classmethod + def lift(cls, value): + return value + + @classmethod + def lower(cls, value): + return value + +class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__index__() + except Exception: + raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) + if not isinstance(value, int): + raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) + if not cls.VALUE_MIN <= value < cls.VALUE_MAX: + raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) + +class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__float__() + except Exception: + raise TypeError("must be real number, not {}".format(type(value).__name__)) + if not isinstance(value, float): + raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) + +# Helper class for wrapper types that will always go through a _UniffiRustBuffer. +# Classes should inherit from this and implement the `read` and `write` static methods. +class _UniffiConverterRustBuffer: + @classmethod + def lift(cls, rbuf): + with rbuf.consume_with_stream() as stream: + return cls.read(stream) + + @classmethod + def lower(cls, value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + cls.write(value, builder) + return builder.finalize() + +# Contains loading, initialization code, and the FFI Function declarations. +# Define some ctypes FFI types that we use in the library + +""" +Function pointer for a Rust task, which a callback function that takes a opaque pointer +""" +_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) + +def _uniffi_future_callback_t(return_type): + """ + Factory function to create callback function types for async functions + """ + return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus) + +def _uniffi_load_indirect(): + """ + This is how we find and load the dynamic library provided by the component. + For now we just look it up by name. + """ + if sys.platform == "darwin": + libname = "lib{}.dylib" + elif sys.platform.startswith("win"): + # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. + # We could use `os.add_dll_directory` to configure the search path, but + # it doesn't feel right to mess with application-wide settings. Let's + # assume that the `.dll` is next to the `.py` file and load by full path. + libname = os.path.join( + os.path.dirname(__file__), + "{}.dll", + ) + else: + # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos + libname = "lib{}.so" + + libname = libname.format("algokit_utils_ffi") + path = os.path.join(os.path.dirname(__file__), libname) + lib = ctypes.cdll.LoadLibrary(path) + return lib + +def _uniffi_check_contract_api_version(lib): + # Get the bindings contract version from our ComponentInterface + bindings_contract_version = 30 + # Get the scaffolding contract version by calling the into the dylib + scaffolding_contract_version = lib.ffi_algokit_transact_ffi_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version: + raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + +def _uniffi_check_api_checksums(lib): + if lib.uniffi_algokit_transact_ffi_checksum_func_address_from_multisig_signature() != 51026: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_address_from_public_key() != 10716: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_apply_multisig_subsignature() != 42634: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_assign_fee() != 35003: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_calculate_fee() != 7537: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_decode_signed_transaction() != 43569: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_decode_signed_transactions() != 62888: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_decode_transaction() != 56405: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_decode_transactions() != 26956: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_encode_signed_transaction() != 47064: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_encode_signed_transactions() != 1956: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_encode_transaction() != 11275: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_encode_transaction_raw() != 384: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_encode_transactions() != 59611: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_estimate_transaction_size() != 60858: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_get_algorand_constant() != 49400: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_get_encoded_transaction_type() != 42551: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_get_transaction_id() != 10957: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_get_transaction_id_raw() != 48975: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_group_transactions() != 18193: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_merge_multisignatures() != 58688: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_new_multisig_signature() != 29314: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_participants_from_multisig_signature() != 25095: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_transact_ffi_checksum_func_public_key_from_address() != 58152: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +# A ctypes library to expose the extern-C FFI definitions. +# This is an implementation detail which will be called internally by the public API. + +_UniffiLib = _uniffi_load_indirect() +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_alloc.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_alloc.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_from_bytes.argtypes = ( + _UniffiForeignBytes, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_from_bytes.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_free.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_free.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_reserve.argtypes = ( + _UniffiRustBuffer, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rustbuffer_reserve.restype = _UniffiRustBuffer +_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8, +) +_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure): + _fields_ = [ + ("handle", ctypes.c_uint64), + ("free", _UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK), + ] +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u8.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u8.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u8.restype = ctypes.c_uint8 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u8.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i8.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i8.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i8.restype = ctypes.c_int8 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i8.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u16.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u16.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u16.restype = ctypes.c_uint16 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u16.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i16.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i16.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i16.restype = ctypes.c_int16 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i16.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u32.restype = ctypes.c_uint32 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i32.restype = ctypes.c_int32 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_u64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_u64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_u64.restype = ctypes.c_uint64 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_u64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_i64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_i64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_i64.restype = ctypes.c_int64 +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_i64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_f32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_f32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_f32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_f32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_f32.restype = ctypes.c_float +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_f32.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_f64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_f64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_f64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_f64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_f64.restype = ctypes.c_double +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_f64.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_rust_buffer.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_rust_buffer.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_rust_buffer.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_rust_buffer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_rust_buffer.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_void.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_poll_void.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_cancel_void.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_void.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_complete_void.restype = None +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_transact_ffi_rust_future_free_void.restype = None +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_address_from_multisig_signature.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_address_from_multisig_signature.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_address_from_public_key.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_address_from_public_key.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_apply_multisig_subsignature.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_apply_multisig_subsignature.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_assign_fee.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_assign_fee.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_calculate_fee.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_calculate_fee.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_signed_transaction.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_signed_transaction.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_signed_transactions.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_signed_transactions.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_transaction.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_transaction.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_transactions.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_transactions.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_signed_transaction.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_signed_transaction.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_signed_transactions.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_signed_transactions.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transaction.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transaction.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transaction_raw.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transaction_raw.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transactions.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transactions.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_estimate_transaction_size.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_estimate_transaction_size.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_algorand_constant.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_algorand_constant.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_encoded_transaction_type.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_encoded_transaction_type.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_transaction_id.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_transaction_id.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_transaction_id_raw.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_transaction_id_raw.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_group_transactions.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_group_transactions.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_merge_multisignatures.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_merge_multisignatures.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_new_multisig_signature.argtypes = ( + ctypes.c_uint8, + ctypes.c_uint8, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_new_multisig_signature.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_participants_from_multisig_signature.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_participants_from_multisig_signature.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_public_key_from_address.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_transact_ffi_fn_func_public_key_from_address.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_transact_ffi_uniffi_contract_version.argtypes = ( +) +_UniffiLib.ffi_algokit_transact_ffi_uniffi_contract_version.restype = ctypes.c_uint32 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_address_from_multisig_signature.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_address_from_multisig_signature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_address_from_public_key.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_address_from_public_key.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_apply_multisig_subsignature.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_apply_multisig_subsignature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_assign_fee.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_assign_fee.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_calculate_fee.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_calculate_fee.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_signed_transactions.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_signed_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_transaction.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_transactions.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_decode_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_signed_transactions.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_signed_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_transaction.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_transaction_raw.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_transaction_raw.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_transactions.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_encode_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_estimate_transaction_size.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_estimate_transaction_size.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_algorand_constant.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_algorand_constant.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_encoded_transaction_type.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_encoded_transaction_type.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_transaction_id.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_transaction_id.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_transaction_id_raw.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_get_transaction_id_raw.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_group_transactions.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_group_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_merge_multisignatures.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_merge_multisignatures.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_new_multisig_signature.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_new_multisig_signature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_participants_from_multisig_signature.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_participants_from_multisig_signature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_public_key_from_address.argtypes = ( +) +_UniffiLib.uniffi_algokit_transact_ffi_checksum_func_public_key_from_address.restype = ctypes.c_uint16 + +_uniffi_check_contract_api_version(_UniffiLib) +# _uniffi_check_api_checksums(_UniffiLib) + + + +# Public interface members begin here. + + +class _UniffiFfiConverterUInt64(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u64" + VALUE_MIN = 0 + VALUE_MAX = 2**64 + + @staticmethod + def read(buf): + return buf.read_u64() + + @staticmethod + def write(value, buf): + buf.write_u64(value) + + + + + + +class OnApplicationComplete(enum.Enum): + """ + On-completion actions for app transactions. + + These values define what additional actions occur with the transaction. +""" + + NO_OP = 0 + """ + NoOp indicates that an app transaction will simply call its + approval program without any additional action. +""" + + OPT_IN = 1 + """ + OptIn indicates that an app transaction will allocate some + local state for the app in the sender's account. +""" + + CLOSE_OUT = 2 + """ + CloseOut indicates that an app transaction will deallocate + some local state for the app from the user's account. +""" + + CLEAR_STATE = 3 + """ + ClearState is similar to CloseOut, but may never fail. This + allows users to reclaim their minimum balance from an app + they no longer wish to opt in to. +""" + + UPDATE_APPLICATION = 4 + """ + UpdateApplication indicates that an app transaction will + update the approval program and clear state program for the app. +""" + + DELETE_APPLICATION = 5 + """ + DeleteApplication indicates that an app transaction will + delete the app parameters for the app from the creator's + balance record. +""" + + + +class _UniffiFfiConverterTypeOnApplicationComplete(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return OnApplicationComplete.NO_OP + if variant == 2: + return OnApplicationComplete.OPT_IN + if variant == 3: + return OnApplicationComplete.CLOSE_OUT + if variant == 4: + return OnApplicationComplete.CLEAR_STATE + if variant == 5: + return OnApplicationComplete.UPDATE_APPLICATION + if variant == 6: + return OnApplicationComplete.DELETE_APPLICATION + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == OnApplicationComplete.NO_OP: + return + if value == OnApplicationComplete.OPT_IN: + return + if value == OnApplicationComplete.CLOSE_OUT: + return + if value == OnApplicationComplete.CLEAR_STATE: + return + if value == OnApplicationComplete.UPDATE_APPLICATION: + return + if value == OnApplicationComplete.DELETE_APPLICATION: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == OnApplicationComplete.NO_OP: + buf.write_i32(1) + if value == OnApplicationComplete.OPT_IN: + buf.write_i32(2) + if value == OnApplicationComplete.CLOSE_OUT: + buf.write_i32(3) + if value == OnApplicationComplete.CLEAR_STATE: + buf.write_i32(4) + if value == OnApplicationComplete.UPDATE_APPLICATION: + buf.write_i32(5) + if value == OnApplicationComplete.DELETE_APPLICATION: + buf.write_i32(6) + + + +class _UniffiFfiConverterBytes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative byte string length") + return buf.read(size) + + @staticmethod + def check_lower(value): + try: + memoryview(value) + except TypeError: + raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) + + @staticmethod + def write(value, buf): + buf.write_i32(len(value)) + buf.write(value) + +class _UniffiFfiConverterOptionalBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterUInt32(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u32" + VALUE_MIN = 0 + VALUE_MAX = 2**32 + + @staticmethod + def read(buf): + return buf.read_u32() + + @staticmethod + def write(value, buf): + buf.write_u32(value) + +@dataclass +class StateSchema: + """ + Schema for app state storage. + + Defines the maximum number of values that may be stored in app + key/value storage for both global and local state. +""" + def __init__(self, *, num_uints:int, num_byte_slices:int): + self.num_uints = num_uints + self.num_byte_slices = num_byte_slices + + + + + def __str__(self): + return "StateSchema(num_uints={}, num_byte_slices={})".format(self.num_uints, self.num_byte_slices) + def __eq__(self, other): + if self.num_uints != other.num_uints: + return False + if self.num_byte_slices != other.num_byte_slices: + return False + return True + +class _UniffiFfiConverterTypeStateSchema(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StateSchema( + num_uints=_UniffiFfiConverterUInt32.read(buf), + num_byte_slices=_UniffiFfiConverterUInt32.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt32.check_lower(value.num_uints) + _UniffiFfiConverterUInt32.check_lower(value.num_byte_slices) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt32.write(value.num_uints, buf) + _UniffiFfiConverterUInt32.write(value.num_byte_slices, buf) + +class _UniffiFfiConverterOptionalTypeStateSchema(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeStateSchema.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeStateSchema.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeStateSchema.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalUInt32(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterUInt32.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterUInt32.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterUInt32.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterBytes.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterBytes.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterBytes.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterString: + @staticmethod + def check_lower(value): + if not isinstance(value, str): + raise TypeError("argument must be str, not {}".format(type(value).__name__)) + return value + + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative string length") + utf8_bytes = buf.read(size) + return utf8_bytes.decode("utf-8") + + @staticmethod + def write(value, buf): + utf8_bytes = value.encode("utf-8") + buf.write_i32(len(utf8_bytes)) + buf.write(utf8_bytes) + + @staticmethod + def lift(buf): + with buf.consume_with_stream() as stream: + return stream.read(stream.remaining()).decode("utf-8") + + @staticmethod + def lower(value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + builder.write(value.encode("utf-8")) + return builder.finalize() + +class _UniffiFfiConverterSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterString.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterString.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterString.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterUInt64.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterUInt64.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterUInt64.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class BoxReference: + """ + Box reference for app call transactions. + + References a specific box that should be made available for the runtime + of the program. +""" + def __init__(self, *, app_id:int, name:bytes): + self.app_id = app_id + self.name = name + + + + + def __str__(self): + return "BoxReference(app_id={}, name={})".format(self.app_id, self.name) + def __eq__(self, other): + if self.app_id != other.app_id: + return False + if self.name != other.name: + return False + return True + +class _UniffiFfiConverterTypeBoxReference(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BoxReference( + app_id=_UniffiFfiConverterUInt64.read(buf), + name=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterBytes.check_lower(value.name) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterBytes.write(value.name, buf) + +class _UniffiFfiConverterSequenceTypeBoxReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeBoxReference.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeBoxReference.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeBoxReference.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeBoxReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeBoxReference.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeBoxReference.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeBoxReference.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AppCallTransactionFields: + """ + Represents an app call transaction that interacts with Algorand Smart Contracts. + + App call transactions are used to create, update, delete, opt-in to, + close out of, or clear state from Algorand applications (smart contracts). +""" + def __init__(self, *, app_id:int, on_complete:OnApplicationComplete, approval_program:typing.Optional[bytes] = _DEFAULT, clear_state_program:typing.Optional[bytes] = _DEFAULT, global_state_schema:typing.Optional[StateSchema] = _DEFAULT, local_state_schema:typing.Optional[StateSchema] = _DEFAULT, extra_program_pages:typing.Optional[int] = _DEFAULT, args:typing.Optional[typing.List[bytes]] = _DEFAULT, account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[BoxReference]] = _DEFAULT): + self.app_id = app_id + self.on_complete = on_complete + if approval_program is _DEFAULT: + self.approval_program = None + else: + self.approval_program = approval_program + if clear_state_program is _DEFAULT: + self.clear_state_program = None + else: + self.clear_state_program = clear_state_program + if global_state_schema is _DEFAULT: + self.global_state_schema = None + else: + self.global_state_schema = global_state_schema + if local_state_schema is _DEFAULT: + self.local_state_schema = None + else: + self.local_state_schema = local_state_schema + if extra_program_pages is _DEFAULT: + self.extra_program_pages = None + else: + self.extra_program_pages = extra_program_pages + if args is _DEFAULT: + self.args = None + else: + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppCallTransactionFields(app_id={}, on_complete={}, approval_program={}, clear_state_program={}, global_state_schema={}, local_state_schema={}, extra_program_pages={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.app_id, self.on_complete, self.approval_program, self.clear_state_program, self.global_state_schema, self.local_state_schema, self.extra_program_pages, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.app_id != other.app_id: + return False + if self.on_complete != other.on_complete: + return False + if self.approval_program != other.approval_program: + return False + if self.clear_state_program != other.clear_state_program: + return False + if self.global_state_schema != other.global_state_schema: + return False + if self.local_state_schema != other.local_state_schema: + return False + if self.extra_program_pages != other.extra_program_pages: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppCallTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppCallTransactionFields( + app_id=_UniffiFfiConverterUInt64.read(buf), + on_complete=_UniffiFfiConverterTypeOnApplicationComplete.read(buf), + approval_program=_UniffiFfiConverterOptionalBytes.read(buf), + clear_state_program=_UniffiFfiConverterOptionalBytes.read(buf), + global_state_schema=_UniffiFfiConverterOptionalTypeStateSchema.read(buf), + local_state_schema=_UniffiFfiConverterOptionalTypeStateSchema.read(buf), + extra_program_pages=_UniffiFfiConverterOptionalUInt32.read(buf), + args=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterTypeOnApplicationComplete.check_lower(value.on_complete) + _UniffiFfiConverterOptionalBytes.check_lower(value.approval_program) + _UniffiFfiConverterOptionalBytes.check_lower(value.clear_state_program) + _UniffiFfiConverterOptionalTypeStateSchema.check_lower(value.global_state_schema) + _UniffiFfiConverterOptionalTypeStateSchema.check_lower(value.local_state_schema) + _UniffiFfiConverterOptionalUInt32.check_lower(value.extra_program_pages) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterTypeOnApplicationComplete.write(value.on_complete, buf) + _UniffiFfiConverterOptionalBytes.write(value.approval_program, buf) + _UniffiFfiConverterOptionalBytes.write(value.clear_state_program, buf) + _UniffiFfiConverterOptionalTypeStateSchema.write(value.global_state_schema, buf) + _UniffiFfiConverterOptionalTypeStateSchema.write(value.local_state_schema, buf) + _UniffiFfiConverterOptionalUInt32.write(value.extra_program_pages, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +class _UniffiFfiConverterOptionalUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterBoolean: + @classmethod + def check_lower(cls, value): + return not not value + + @classmethod + def lower(cls, value): + return 1 if value else 0 + + @staticmethod + def lift(value): + return value != 0 + + @classmethod + def read(cls, buf): + return cls.lift(buf.read_u8()) + + @classmethod + def write(cls, value, buf): + buf.write_u8(value) + +class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBoolean.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBoolean.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBoolean.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AssetConfigTransactionFields: + """ + Parameters to define an asset config transaction. + + For asset creation, the asset ID field must be 0. + For asset reconfiguration, the asset ID field must be set. Only fields manager, reserve, freeze, and clawback can be set. + For asset destroy, the asset ID field must be set, all other fields must not be set. + + **Note:** The manager, reserve, freeze, and clawback addresses + are immutably empty if they are not set. If manager is not set then + all fields are immutable from that point forward. +""" + def __init__(self, *, asset_id:int, total:typing.Optional[int] = _DEFAULT, decimals:typing.Optional[int] = _DEFAULT, default_frozen:typing.Optional[bool] = _DEFAULT, asset_name:typing.Optional[str] = _DEFAULT, unit_name:typing.Optional[str] = _DEFAULT, url:typing.Optional[str] = _DEFAULT, metadata_hash:typing.Optional[bytes] = _DEFAULT, manager:typing.Optional[str] = _DEFAULT, reserve:typing.Optional[str] = _DEFAULT, freeze:typing.Optional[str] = _DEFAULT, clawback:typing.Optional[str] = _DEFAULT): + self.asset_id = asset_id + if total is _DEFAULT: + self.total = None + else: + self.total = total + if decimals is _DEFAULT: + self.decimals = None + else: + self.decimals = decimals + if default_frozen is _DEFAULT: + self.default_frozen = None + else: + self.default_frozen = default_frozen + if asset_name is _DEFAULT: + self.asset_name = None + else: + self.asset_name = asset_name + if unit_name is _DEFAULT: + self.unit_name = None + else: + self.unit_name = unit_name + if url is _DEFAULT: + self.url = None + else: + self.url = url + if metadata_hash is _DEFAULT: + self.metadata_hash = None + else: + self.metadata_hash = metadata_hash + if manager is _DEFAULT: + self.manager = None + else: + self.manager = manager + if reserve is _DEFAULT: + self.reserve = None + else: + self.reserve = reserve + if freeze is _DEFAULT: + self.freeze = None + else: + self.freeze = freeze + if clawback is _DEFAULT: + self.clawback = None + else: + self.clawback = clawback + + + + + def __str__(self): + return "AssetConfigTransactionFields(asset_id={}, total={}, decimals={}, default_frozen={}, asset_name={}, unit_name={}, url={}, metadata_hash={}, manager={}, reserve={}, freeze={}, clawback={})".format(self.asset_id, self.total, self.decimals, self.default_frozen, self.asset_name, self.unit_name, self.url, self.metadata_hash, self.manager, self.reserve, self.freeze, self.clawback) + def __eq__(self, other): + if self.asset_id != other.asset_id: + return False + if self.total != other.total: + return False + if self.decimals != other.decimals: + return False + if self.default_frozen != other.default_frozen: + return False + if self.asset_name != other.asset_name: + return False + if self.unit_name != other.unit_name: + return False + if self.url != other.url: + return False + if self.metadata_hash != other.metadata_hash: + return False + if self.manager != other.manager: + return False + if self.reserve != other.reserve: + return False + if self.freeze != other.freeze: + return False + if self.clawback != other.clawback: + return False + return True + +class _UniffiFfiConverterTypeAssetConfigTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetConfigTransactionFields( + asset_id=_UniffiFfiConverterUInt64.read(buf), + total=_UniffiFfiConverterOptionalUInt64.read(buf), + decimals=_UniffiFfiConverterOptionalUInt32.read(buf), + default_frozen=_UniffiFfiConverterOptionalBoolean.read(buf), + asset_name=_UniffiFfiConverterOptionalString.read(buf), + unit_name=_UniffiFfiConverterOptionalString.read(buf), + url=_UniffiFfiConverterOptionalString.read(buf), + metadata_hash=_UniffiFfiConverterOptionalBytes.read(buf), + manager=_UniffiFfiConverterOptionalString.read(buf), + reserve=_UniffiFfiConverterOptionalString.read(buf), + freeze=_UniffiFfiConverterOptionalString.read(buf), + clawback=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterOptionalUInt64.check_lower(value.total) + _UniffiFfiConverterOptionalUInt32.check_lower(value.decimals) + _UniffiFfiConverterOptionalBoolean.check_lower(value.default_frozen) + _UniffiFfiConverterOptionalString.check_lower(value.asset_name) + _UniffiFfiConverterOptionalString.check_lower(value.unit_name) + _UniffiFfiConverterOptionalString.check_lower(value.url) + _UniffiFfiConverterOptionalBytes.check_lower(value.metadata_hash) + _UniffiFfiConverterOptionalString.check_lower(value.manager) + _UniffiFfiConverterOptionalString.check_lower(value.reserve) + _UniffiFfiConverterOptionalString.check_lower(value.freeze) + _UniffiFfiConverterOptionalString.check_lower(value.clawback) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterOptionalUInt64.write(value.total, buf) + _UniffiFfiConverterOptionalUInt32.write(value.decimals, buf) + _UniffiFfiConverterOptionalBoolean.write(value.default_frozen, buf) + _UniffiFfiConverterOptionalString.write(value.asset_name, buf) + _UniffiFfiConverterOptionalString.write(value.unit_name, buf) + _UniffiFfiConverterOptionalString.write(value.url, buf) + _UniffiFfiConverterOptionalBytes.write(value.metadata_hash, buf) + _UniffiFfiConverterOptionalString.write(value.manager, buf) + _UniffiFfiConverterOptionalString.write(value.reserve, buf) + _UniffiFfiConverterOptionalString.write(value.freeze, buf) + _UniffiFfiConverterOptionalString.write(value.clawback, buf) + +@dataclass +class AssetFreezeTransactionFields: + """ + Represents an asset freeze transaction that freezes or unfreezes asset holdings. + + Asset freeze transactions are used by the asset freeze account to control + whether a specific account can transfer a particular asset. +""" + def __init__(self, *, asset_id:int, freeze_target:str, frozen:bool): + self.asset_id = asset_id + self.freeze_target = freeze_target + self.frozen = frozen + + + + + def __str__(self): + return "AssetFreezeTransactionFields(asset_id={}, freeze_target={}, frozen={})".format(self.asset_id, self.freeze_target, self.frozen) + def __eq__(self, other): + if self.asset_id != other.asset_id: + return False + if self.freeze_target != other.freeze_target: + return False + if self.frozen != other.frozen: + return False + return True + +class _UniffiFfiConverterTypeAssetFreezeTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetFreezeTransactionFields( + asset_id=_UniffiFfiConverterUInt64.read(buf), + freeze_target=_UniffiFfiConverterString.read(buf), + frozen=_UniffiFfiConverterBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterString.check_lower(value.freeze_target) + _UniffiFfiConverterBoolean.check_lower(value.frozen) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterString.write(value.freeze_target, buf) + _UniffiFfiConverterBoolean.write(value.frozen, buf) + +@dataclass +class AssetTransferTransactionFields: + def __init__(self, *, asset_id:int, amount:int, receiver:str, asset_sender:typing.Optional[str] = _DEFAULT, close_remainder_to:typing.Optional[str] = _DEFAULT): + self.asset_id = asset_id + self.amount = amount + self.receiver = receiver + if asset_sender is _DEFAULT: + self.asset_sender = None + else: + self.asset_sender = asset_sender + if close_remainder_to is _DEFAULT: + self.close_remainder_to = None + else: + self.close_remainder_to = close_remainder_to + + + + + def __str__(self): + return "AssetTransferTransactionFields(asset_id={}, amount={}, receiver={}, asset_sender={}, close_remainder_to={})".format(self.asset_id, self.amount, self.receiver, self.asset_sender, self.close_remainder_to) + def __eq__(self, other): + if self.asset_id != other.asset_id: + return False + if self.amount != other.amount: + return False + if self.receiver != other.receiver: + return False + if self.asset_sender != other.asset_sender: + return False + if self.close_remainder_to != other.close_remainder_to: + return False + return True + +class _UniffiFfiConverterTypeAssetTransferTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetTransferTransactionFields( + asset_id=_UniffiFfiConverterUInt64.read(buf), + amount=_UniffiFfiConverterUInt64.read(buf), + receiver=_UniffiFfiConverterString.read(buf), + asset_sender=_UniffiFfiConverterOptionalString.read(buf), + close_remainder_to=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterUInt64.check_lower(value.amount) + _UniffiFfiConverterString.check_lower(value.receiver) + _UniffiFfiConverterOptionalString.check_lower(value.asset_sender) + _UniffiFfiConverterOptionalString.check_lower(value.close_remainder_to) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterUInt64.write(value.amount, buf) + _UniffiFfiConverterString.write(value.receiver, buf) + _UniffiFfiConverterOptionalString.write(value.asset_sender, buf) + _UniffiFfiConverterOptionalString.write(value.close_remainder_to, buf) + +@dataclass +class HashFactory: + def __init__(self, *, hash_type:int): + self.hash_type = hash_type + + + + + def __str__(self): + return "HashFactory(hash_type={})".format(self.hash_type) + def __eq__(self, other): + if self.hash_type != other.hash_type: + return False + return True + +class _UniffiFfiConverterTypeHashFactory(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return HashFactory( + hash_type=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.hash_type) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.hash_type, buf) + +@dataclass +class MerkleArrayProof: + def __init__(self, *, path:typing.List[bytes], hash_factory:HashFactory, tree_depth:int): + self.path = path + self.hash_factory = hash_factory + self.tree_depth = tree_depth + + + + + def __str__(self): + return "MerkleArrayProof(path={}, hash_factory={}, tree_depth={})".format(self.path, self.hash_factory, self.tree_depth) + def __eq__(self, other): + if self.path != other.path: + return False + if self.hash_factory != other.hash_factory: + return False + if self.tree_depth != other.tree_depth: + return False + return True + +class _UniffiFfiConverterTypeMerkleArrayProof(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MerkleArrayProof( + path=_UniffiFfiConverterSequenceBytes.read(buf), + hash_factory=_UniffiFfiConverterTypeHashFactory.read(buf), + tree_depth=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterSequenceBytes.check_lower(value.path) + _UniffiFfiConverterTypeHashFactory.check_lower(value.hash_factory) + _UniffiFfiConverterUInt64.check_lower(value.tree_depth) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterSequenceBytes.write(value.path, buf) + _UniffiFfiConverterTypeHashFactory.write(value.hash_factory, buf) + _UniffiFfiConverterUInt64.write(value.tree_depth, buf) + +@dataclass +class FalconVerifier: + def __init__(self, *, public_key:bytes): + self.public_key = public_key + + + + + def __str__(self): + return "FalconVerifier(public_key={})".format(self.public_key) + def __eq__(self, other): + if self.public_key != other.public_key: + return False + return True + +class _UniffiFfiConverterTypeFalconVerifier(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return FalconVerifier( + public_key=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.public_key) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.public_key, buf) + +@dataclass +class FalconSignatureStruct: + """ + Represents a signature in the merkle signature scheme using falcon signatures + as an underlying crypto scheme. It consists of an ephemeral public key, a signature, a merkle + verification path and an index. The merkle signature considered valid only if the Signature is + verified under the ephemeral public key and the Merkle verification path verifies that the + ephemeral public key is located at the given index of the tree (for the root given in the + long-term public key). More details can be found on Algorand's spec +""" + def __init__(self, *, signature:bytes, vector_commitment_index:int, proof:MerkleArrayProof, verifying_key:FalconVerifier): + self.signature = signature + self.vector_commitment_index = vector_commitment_index + self.proof = proof + self.verifying_key = verifying_key + + + + + def __str__(self): + return "FalconSignatureStruct(signature={}, vector_commitment_index={}, proof={}, verifying_key={})".format(self.signature, self.vector_commitment_index, self.proof, self.verifying_key) + def __eq__(self, other): + if self.signature != other.signature: + return False + if self.vector_commitment_index != other.vector_commitment_index: + return False + if self.proof != other.proof: + return False + if self.verifying_key != other.verifying_key: + return False + return True + +class _UniffiFfiConverterTypeFalconSignatureStruct(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return FalconSignatureStruct( + signature=_UniffiFfiConverterBytes.read(buf), + vector_commitment_index=_UniffiFfiConverterUInt64.read(buf), + proof=_UniffiFfiConverterTypeMerkleArrayProof.read(buf), + verifying_key=_UniffiFfiConverterTypeFalconVerifier.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.signature) + _UniffiFfiConverterUInt64.check_lower(value.vector_commitment_index) + _UniffiFfiConverterTypeMerkleArrayProof.check_lower(value.proof) + _UniffiFfiConverterTypeFalconVerifier.check_lower(value.verifying_key) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.signature, buf) + _UniffiFfiConverterUInt64.write(value.vector_commitment_index, buf) + _UniffiFfiConverterTypeMerkleArrayProof.write(value.proof, buf) + _UniffiFfiConverterTypeFalconVerifier.write(value.verifying_key, buf) + +@dataclass +class FeeParams: + def __init__(self, *, fee_per_byte:int, min_fee:int, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT): + self.fee_per_byte = fee_per_byte + self.min_fee = min_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + + + + + def __str__(self): + return "FeeParams(fee_per_byte={}, min_fee={}, extra_fee={}, max_fee={})".format(self.fee_per_byte, self.min_fee, self.extra_fee, self.max_fee) + def __eq__(self, other): + if self.fee_per_byte != other.fee_per_byte: + return False + if self.min_fee != other.min_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + return True + +class _UniffiFfiConverterTypeFeeParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return FeeParams( + fee_per_byte=_UniffiFfiConverterUInt64.read(buf), + min_fee=_UniffiFfiConverterUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.fee_per_byte) + _UniffiFfiConverterUInt64.check_lower(value.min_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.fee_per_byte, buf) + _UniffiFfiConverterUInt64.write(value.min_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + +@dataclass +class HeartbeatProof: + """ + Parameters for a heartbeat transaction proof. +""" + def __init__(self, *, sig:bytes, pk:bytes, pk2:bytes, pk1_sig:bytes, pk2_sig:bytes): + self.sig = sig + self.pk = pk + self.pk2 = pk2 + self.pk1_sig = pk1_sig + self.pk2_sig = pk2_sig + + + + + def __str__(self): + return "HeartbeatProof(sig={}, pk={}, pk2={}, pk1_sig={}, pk2_sig={})".format(self.sig, self.pk, self.pk2, self.pk1_sig, self.pk2_sig) + def __eq__(self, other): + if self.sig != other.sig: + return False + if self.pk != other.pk: + return False + if self.pk2 != other.pk2: + return False + if self.pk1_sig != other.pk1_sig: + return False + if self.pk2_sig != other.pk2_sig: + return False + return True + +class _UniffiFfiConverterTypeHeartbeatProof(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return HeartbeatProof( + sig=_UniffiFfiConverterBytes.read(buf), + pk=_UniffiFfiConverterBytes.read(buf), + pk2=_UniffiFfiConverterBytes.read(buf), + pk1_sig=_UniffiFfiConverterBytes.read(buf), + pk2_sig=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.sig) + _UniffiFfiConverterBytes.check_lower(value.pk) + _UniffiFfiConverterBytes.check_lower(value.pk2) + _UniffiFfiConverterBytes.check_lower(value.pk1_sig) + _UniffiFfiConverterBytes.check_lower(value.pk2_sig) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.sig, buf) + _UniffiFfiConverterBytes.write(value.pk, buf) + _UniffiFfiConverterBytes.write(value.pk2, buf) + _UniffiFfiConverterBytes.write(value.pk1_sig, buf) + _UniffiFfiConverterBytes.write(value.pk2_sig, buf) + +@dataclass +class HeartbeatTransactionFields: + """ + Parameters to define a heartbeat transaction. + + Used to maintain participation in Algorand consensus. +""" + def __init__(self, *, address:str, proof:HeartbeatProof, seed:bytes, vote_id:bytes, key_dilution:int): + self.address = address + self.proof = proof + self.seed = seed + self.vote_id = vote_id + self.key_dilution = key_dilution + + + + + def __str__(self): + return "HeartbeatTransactionFields(address={}, proof={}, seed={}, vote_id={}, key_dilution={})".format(self.address, self.proof, self.seed, self.vote_id, self.key_dilution) + def __eq__(self, other): + if self.address != other.address: + return False + if self.proof != other.proof: + return False + if self.seed != other.seed: + return False + if self.vote_id != other.vote_id: + return False + if self.key_dilution != other.key_dilution: + return False + return True + +class _UniffiFfiConverterTypeHeartbeatTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return HeartbeatTransactionFields( + address=_UniffiFfiConverterString.read(buf), + proof=_UniffiFfiConverterTypeHeartbeatProof.read(buf), + seed=_UniffiFfiConverterBytes.read(buf), + vote_id=_UniffiFfiConverterBytes.read(buf), + key_dilution=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterTypeHeartbeatProof.check_lower(value.proof) + _UniffiFfiConverterBytes.check_lower(value.seed) + _UniffiFfiConverterBytes.check_lower(value.vote_id) + _UniffiFfiConverterUInt64.check_lower(value.key_dilution) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterTypeHeartbeatProof.write(value.proof, buf) + _UniffiFfiConverterBytes.write(value.seed, buf) + _UniffiFfiConverterBytes.write(value.vote_id, buf) + _UniffiFfiConverterUInt64.write(value.key_dilution, buf) + +@dataclass +class KeyPairAccount: + def __init__(self, *, pub_key:bytes): + self.pub_key = pub_key + + + + + def __str__(self): + return "KeyPairAccount(pub_key={})".format(self.pub_key) + def __eq__(self, other): + if self.pub_key != other.pub_key: + return False + return True + +class _UniffiFfiConverterTypeKeyPairAccount(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return KeyPairAccount( + pub_key=_UniffiFfiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.pub_key) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.pub_key, buf) + +@dataclass +class KeyRegistrationTransactionFields: + def __init__(self, *, vote_key:typing.Optional[bytes] = _DEFAULT, selection_key:typing.Optional[bytes] = _DEFAULT, state_proof_key:typing.Optional[bytes] = _DEFAULT, vote_first:typing.Optional[int] = _DEFAULT, vote_last:typing.Optional[int] = _DEFAULT, vote_key_dilution:typing.Optional[int] = _DEFAULT, non_participation:typing.Optional[bool] = _DEFAULT): + if vote_key is _DEFAULT: + self.vote_key = None + else: + self.vote_key = vote_key + if selection_key is _DEFAULT: + self.selection_key = None + else: + self.selection_key = selection_key + if state_proof_key is _DEFAULT: + self.state_proof_key = None + else: + self.state_proof_key = state_proof_key + if vote_first is _DEFAULT: + self.vote_first = None + else: + self.vote_first = vote_first + if vote_last is _DEFAULT: + self.vote_last = None + else: + self.vote_last = vote_last + if vote_key_dilution is _DEFAULT: + self.vote_key_dilution = None + else: + self.vote_key_dilution = vote_key_dilution + if non_participation is _DEFAULT: + self.non_participation = None + else: + self.non_participation = non_participation + + + + + def __str__(self): + return "KeyRegistrationTransactionFields(vote_key={}, selection_key={}, state_proof_key={}, vote_first={}, vote_last={}, vote_key_dilution={}, non_participation={})".format(self.vote_key, self.selection_key, self.state_proof_key, self.vote_first, self.vote_last, self.vote_key_dilution, self.non_participation) + def __eq__(self, other): + if self.vote_key != other.vote_key: + return False + if self.selection_key != other.selection_key: + return False + if self.state_proof_key != other.state_proof_key: + return False + if self.vote_first != other.vote_first: + return False + if self.vote_last != other.vote_last: + return False + if self.vote_key_dilution != other.vote_key_dilution: + return False + if self.non_participation != other.non_participation: + return False + return True + +class _UniffiFfiConverterTypeKeyRegistrationTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return KeyRegistrationTransactionFields( + vote_key=_UniffiFfiConverterOptionalBytes.read(buf), + selection_key=_UniffiFfiConverterOptionalBytes.read(buf), + state_proof_key=_UniffiFfiConverterOptionalBytes.read(buf), + vote_first=_UniffiFfiConverterOptionalUInt64.read(buf), + vote_last=_UniffiFfiConverterOptionalUInt64.read(buf), + vote_key_dilution=_UniffiFfiConverterOptionalUInt64.read(buf), + non_participation=_UniffiFfiConverterOptionalBoolean.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalBytes.check_lower(value.vote_key) + _UniffiFfiConverterOptionalBytes.check_lower(value.selection_key) + _UniffiFfiConverterOptionalBytes.check_lower(value.state_proof_key) + _UniffiFfiConverterOptionalUInt64.check_lower(value.vote_first) + _UniffiFfiConverterOptionalUInt64.check_lower(value.vote_last) + _UniffiFfiConverterOptionalUInt64.check_lower(value.vote_key_dilution) + _UniffiFfiConverterOptionalBoolean.check_lower(value.non_participation) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalBytes.write(value.vote_key, buf) + _UniffiFfiConverterOptionalBytes.write(value.selection_key, buf) + _UniffiFfiConverterOptionalBytes.write(value.state_proof_key, buf) + _UniffiFfiConverterOptionalUInt64.write(value.vote_first, buf) + _UniffiFfiConverterOptionalUInt64.write(value.vote_last, buf) + _UniffiFfiConverterOptionalUInt64.write(value.vote_key_dilution, buf) + _UniffiFfiConverterOptionalBoolean.write(value.non_participation, buf) + +@dataclass +class MerkleSignatureVerifier: + def __init__(self, *, commitment:bytes, key_lifetime:int): + self.commitment = commitment + self.key_lifetime = key_lifetime + + + + + def __str__(self): + return "MerkleSignatureVerifier(commitment={}, key_lifetime={})".format(self.commitment, self.key_lifetime) + def __eq__(self, other): + if self.commitment != other.commitment: + return False + if self.key_lifetime != other.key_lifetime: + return False + return True + +class _UniffiFfiConverterTypeMerkleSignatureVerifier(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MerkleSignatureVerifier( + commitment=_UniffiFfiConverterBytes.read(buf), + key_lifetime=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.commitment) + _UniffiFfiConverterUInt64.check_lower(value.key_lifetime) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.commitment, buf) + _UniffiFfiConverterUInt64.write(value.key_lifetime, buf) + +class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u8" + VALUE_MIN = 0 + VALUE_MAX = 2**8 + + @staticmethod + def read(buf): + return buf.read_u8() + + @staticmethod + def write(value, buf): + buf.write_u8(value) + +@dataclass +class MultisigSubsignature: + """ + Representation of a single subsignature in a multisignature transaction. + + Each subsignature contains the participant's address and an optional signature. +""" + def __init__(self, *, address:str, signature:typing.Optional[bytes] = _DEFAULT): + self.address = address + if signature is _DEFAULT: + self.signature = None + else: + self.signature = signature + + + + + def __str__(self): + return "MultisigSubsignature(address={}, signature={})".format(self.address, self.signature) + def __eq__(self, other): + if self.address != other.address: + return False + if self.signature != other.signature: + return False + return True + +class _UniffiFfiConverterTypeMultisigSubsignature(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MultisigSubsignature( + address=_UniffiFfiConverterString.read(buf), + signature=_UniffiFfiConverterOptionalBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterOptionalBytes.check_lower(value.signature) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterOptionalBytes.write(value.signature, buf) + +class _UniffiFfiConverterSequenceTypeMultisigSubsignature(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeMultisigSubsignature.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeMultisigSubsignature.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeMultisigSubsignature.read(buf) for i in range(count) + ] + +@dataclass +class MultisigSignature: + """ + Representation of an Algorand multisignature signature. +""" + def __init__(self, *, version:int, threshold:int, subsignatures:typing.List[MultisigSubsignature]): + self.version = version + self.threshold = threshold + self.subsignatures = subsignatures + + + + + def __str__(self): + return "MultisigSignature(version={}, threshold={}, subsignatures={})".format(self.version, self.threshold, self.subsignatures) + def __eq__(self, other): + if self.version != other.version: + return False + if self.threshold != other.threshold: + return False + if self.subsignatures != other.subsignatures: + return False + return True + +class _UniffiFfiConverterTypeMultisigSignature(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MultisigSignature( + version=_UniffiFfiConverterUInt8.read(buf), + threshold=_UniffiFfiConverterUInt8.read(buf), + subsignatures=_UniffiFfiConverterSequenceTypeMultisigSubsignature.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt8.check_lower(value.version) + _UniffiFfiConverterUInt8.check_lower(value.threshold) + _UniffiFfiConverterSequenceTypeMultisigSubsignature.check_lower(value.subsignatures) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt8.write(value.version, buf) + _UniffiFfiConverterUInt8.write(value.threshold, buf) + _UniffiFfiConverterSequenceTypeMultisigSubsignature.write(value.subsignatures, buf) + +@dataclass +class Participant: + """ + A Participant corresponds to an account whose AccountData.Status is Online, and for which the + expected sigRound satisfies AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid. + + In the Algorand ledger, it is possible for multiple accounts to have the same PK. Thus, the PK is + not necessarily unique among Participants. However, each account will produce a unique Participant + struct, to avoid potential DoS attacks where one account claims to have the same VoteID PK as + another account. +""" + def __init__(self, *, verifier:MerkleSignatureVerifier, weight:int): + self.verifier = verifier + self.weight = weight + + + + + def __str__(self): + return "Participant(verifier={}, weight={})".format(self.verifier, self.weight) + def __eq__(self, other): + if self.verifier != other.verifier: + return False + if self.weight != other.weight: + return False + return True + +class _UniffiFfiConverterTypeParticipant(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Participant( + verifier=_UniffiFfiConverterTypeMerkleSignatureVerifier.read(buf), + weight=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeMerkleSignatureVerifier.check_lower(value.verifier) + _UniffiFfiConverterUInt64.check_lower(value.weight) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeMerkleSignatureVerifier.write(value.verifier, buf) + _UniffiFfiConverterUInt64.write(value.weight, buf) + +@dataclass +class PaymentTransactionFields: + def __init__(self, *, receiver:str, amount:int, close_remainder_to:typing.Optional[str] = _DEFAULT): + self.receiver = receiver + self.amount = amount + if close_remainder_to is _DEFAULT: + self.close_remainder_to = None + else: + self.close_remainder_to = close_remainder_to + + + + + def __str__(self): + return "PaymentTransactionFields(receiver={}, amount={}, close_remainder_to={})".format(self.receiver, self.amount, self.close_remainder_to) + def __eq__(self, other): + if self.receiver != other.receiver: + return False + if self.amount != other.amount: + return False + if self.close_remainder_to != other.close_remainder_to: + return False + return True + +class _UniffiFfiConverterTypePaymentTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return PaymentTransactionFields( + receiver=_UniffiFfiConverterString.read(buf), + amount=_UniffiFfiConverterUInt64.read(buf), + close_remainder_to=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.receiver) + _UniffiFfiConverterUInt64.check_lower(value.amount) + _UniffiFfiConverterOptionalString.check_lower(value.close_remainder_to) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.receiver, buf) + _UniffiFfiConverterUInt64.write(value.amount, buf) + _UniffiFfiConverterOptionalString.write(value.close_remainder_to, buf) + +@dataclass +class SigslotCommit: + def __init__(self, *, sig:FalconSignatureStruct, lower_sig_weight:int): + self.sig = sig + self.lower_sig_weight = lower_sig_weight + + + + + def __str__(self): + return "SigslotCommit(sig={}, lower_sig_weight={})".format(self.sig, self.lower_sig_weight) + def __eq__(self, other): + if self.sig != other.sig: + return False + if self.lower_sig_weight != other.lower_sig_weight: + return False + return True + +class _UniffiFfiConverterTypeSigslotCommit(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SigslotCommit( + sig=_UniffiFfiConverterTypeFalconSignatureStruct.read(buf), + lower_sig_weight=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeFalconSignatureStruct.check_lower(value.sig) + _UniffiFfiConverterUInt64.check_lower(value.lower_sig_weight) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeFalconSignatureStruct.write(value.sig, buf) + _UniffiFfiConverterUInt64.write(value.lower_sig_weight, buf) + +@dataclass +class Reveal: + """ + A single array position revealed as part of a state proof. It reveals an element of the + signature array and the corresponding element of the participants array. +""" + def __init__(self, *, position:int, sigslot:SigslotCommit, participant:Participant): + self.position = position + self.sigslot = sigslot + self.participant = participant + + + + + def __str__(self): + return "Reveal(position={}, sigslot={}, participant={})".format(self.position, self.sigslot, self.participant) + def __eq__(self, other): + if self.position != other.position: + return False + if self.sigslot != other.sigslot: + return False + if self.participant != other.participant: + return False + return True + +class _UniffiFfiConverterTypeReveal(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Reveal( + position=_UniffiFfiConverterUInt64.read(buf), + sigslot=_UniffiFfiConverterTypeSigslotCommit.read(buf), + participant=_UniffiFfiConverterTypeParticipant.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.position) + _UniffiFfiConverterTypeSigslotCommit.check_lower(value.sigslot) + _UniffiFfiConverterTypeParticipant.check_lower(value.participant) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.position, buf) + _UniffiFfiConverterTypeSigslotCommit.write(value.sigslot, buf) + _UniffiFfiConverterTypeParticipant.write(value.participant, buf) + + + + + + +class TransactionType(enum.Enum): + + PAYMENT = 0 + + ASSET_TRANSFER = 1 + + ASSET_FREEZE = 2 + + ASSET_CONFIG = 3 + + KEY_REGISTRATION = 4 + + APP_CALL = 5 + + HEARTBEAT = 6 + + STATE_PROOF = 7 + + + +class _UniffiFfiConverterTypeTransactionType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TransactionType.PAYMENT + if variant == 2: + return TransactionType.ASSET_TRANSFER + if variant == 3: + return TransactionType.ASSET_FREEZE + if variant == 4: + return TransactionType.ASSET_CONFIG + if variant == 5: + return TransactionType.KEY_REGISTRATION + if variant == 6: + return TransactionType.APP_CALL + if variant == 7: + return TransactionType.HEARTBEAT + if variant == 8: + return TransactionType.STATE_PROOF + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == TransactionType.PAYMENT: + return + if value == TransactionType.ASSET_TRANSFER: + return + if value == TransactionType.ASSET_FREEZE: + return + if value == TransactionType.ASSET_CONFIG: + return + if value == TransactionType.KEY_REGISTRATION: + return + if value == TransactionType.APP_CALL: + return + if value == TransactionType.HEARTBEAT: + return + if value == TransactionType.STATE_PROOF: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == TransactionType.PAYMENT: + buf.write_i32(1) + if value == TransactionType.ASSET_TRANSFER: + buf.write_i32(2) + if value == TransactionType.ASSET_FREEZE: + buf.write_i32(3) + if value == TransactionType.ASSET_CONFIG: + buf.write_i32(4) + if value == TransactionType.KEY_REGISTRATION: + buf.write_i32(5) + if value == TransactionType.APP_CALL: + buf.write_i32(6) + if value == TransactionType.HEARTBEAT: + buf.write_i32(7) + if value == TransactionType.STATE_PROOF: + buf.write_i32(8) + + + +class _UniffiFfiConverterOptionalTypePaymentTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypePaymentTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypePaymentTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypePaymentTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeAssetTransferTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAssetTransferTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAssetTransferTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAssetTransferTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeAssetConfigTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAssetConfigTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAssetConfigTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAssetConfigTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeAppCallTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAppCallTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAppCallTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAppCallTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeKeyRegistrationTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeKeyRegistrationTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeKeyRegistrationTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeKeyRegistrationTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeAssetFreezeTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeAssetFreezeTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeAssetFreezeTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeAssetFreezeTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeHeartbeatTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeHeartbeatTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeHeartbeatTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeHeartbeatTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceTypeReveal(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeReveal.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeReveal.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeReveal.read(buf) for i in range(count) + ] + +@dataclass +class StateProof: + def __init__(self, *, sig_commit:bytes, signed_weight:int, sig_proofs:MerkleArrayProof, part_proofs:MerkleArrayProof, merkle_signature_salt_version:int, reveals:typing.List[Reveal], positions_to_reveal:typing.List[int]): + self.sig_commit = sig_commit + self.signed_weight = signed_weight + self.sig_proofs = sig_proofs + self.part_proofs = part_proofs + self.merkle_signature_salt_version = merkle_signature_salt_version + self.reveals = reveals + self.positions_to_reveal = positions_to_reveal + + + + + def __str__(self): + return "StateProof(sig_commit={}, signed_weight={}, sig_proofs={}, part_proofs={}, merkle_signature_salt_version={}, reveals={}, positions_to_reveal={})".format(self.sig_commit, self.signed_weight, self.sig_proofs, self.part_proofs, self.merkle_signature_salt_version, self.reveals, self.positions_to_reveal) + def __eq__(self, other): + if self.sig_commit != other.sig_commit: + return False + if self.signed_weight != other.signed_weight: + return False + if self.sig_proofs != other.sig_proofs: + return False + if self.part_proofs != other.part_proofs: + return False + if self.merkle_signature_salt_version != other.merkle_signature_salt_version: + return False + if self.reveals != other.reveals: + return False + if self.positions_to_reveal != other.positions_to_reveal: + return False + return True + +class _UniffiFfiConverterTypeStateProof(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StateProof( + sig_commit=_UniffiFfiConverterBytes.read(buf), + signed_weight=_UniffiFfiConverterUInt64.read(buf), + sig_proofs=_UniffiFfiConverterTypeMerkleArrayProof.read(buf), + part_proofs=_UniffiFfiConverterTypeMerkleArrayProof.read(buf), + merkle_signature_salt_version=_UniffiFfiConverterUInt64.read(buf), + reveals=_UniffiFfiConverterSequenceTypeReveal.read(buf), + positions_to_reveal=_UniffiFfiConverterSequenceUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.sig_commit) + _UniffiFfiConverterUInt64.check_lower(value.signed_weight) + _UniffiFfiConverterTypeMerkleArrayProof.check_lower(value.sig_proofs) + _UniffiFfiConverterTypeMerkleArrayProof.check_lower(value.part_proofs) + _UniffiFfiConverterUInt64.check_lower(value.merkle_signature_salt_version) + _UniffiFfiConverterSequenceTypeReveal.check_lower(value.reveals) + _UniffiFfiConverterSequenceUInt64.check_lower(value.positions_to_reveal) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.sig_commit, buf) + _UniffiFfiConverterUInt64.write(value.signed_weight, buf) + _UniffiFfiConverterTypeMerkleArrayProof.write(value.sig_proofs, buf) + _UniffiFfiConverterTypeMerkleArrayProof.write(value.part_proofs, buf) + _UniffiFfiConverterUInt64.write(value.merkle_signature_salt_version, buf) + _UniffiFfiConverterSequenceTypeReveal.write(value.reveals, buf) + _UniffiFfiConverterSequenceUInt64.write(value.positions_to_reveal, buf) + +class _UniffiFfiConverterOptionalTypeStateProof(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeStateProof.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeStateProof.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeStateProof.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class StateProofMessage: + def __init__(self, *, block_headers_commitment:bytes, voters_commitment:bytes, ln_proven_weight:int, first_attested_round:int, last_attested_round:int): + self.block_headers_commitment = block_headers_commitment + self.voters_commitment = voters_commitment + self.ln_proven_weight = ln_proven_weight + self.first_attested_round = first_attested_round + self.last_attested_round = last_attested_round + + + + + def __str__(self): + return "StateProofMessage(block_headers_commitment={}, voters_commitment={}, ln_proven_weight={}, first_attested_round={}, last_attested_round={})".format(self.block_headers_commitment, self.voters_commitment, self.ln_proven_weight, self.first_attested_round, self.last_attested_round) + def __eq__(self, other): + if self.block_headers_commitment != other.block_headers_commitment: + return False + if self.voters_commitment != other.voters_commitment: + return False + if self.ln_proven_weight != other.ln_proven_weight: + return False + if self.first_attested_round != other.first_attested_round: + return False + if self.last_attested_round != other.last_attested_round: + return False + return True + +class _UniffiFfiConverterTypeStateProofMessage(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StateProofMessage( + block_headers_commitment=_UniffiFfiConverterBytes.read(buf), + voters_commitment=_UniffiFfiConverterBytes.read(buf), + ln_proven_weight=_UniffiFfiConverterUInt64.read(buf), + first_attested_round=_UniffiFfiConverterUInt64.read(buf), + last_attested_round=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterBytes.check_lower(value.block_headers_commitment) + _UniffiFfiConverterBytes.check_lower(value.voters_commitment) + _UniffiFfiConverterUInt64.check_lower(value.ln_proven_weight) + _UniffiFfiConverterUInt64.check_lower(value.first_attested_round) + _UniffiFfiConverterUInt64.check_lower(value.last_attested_round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterBytes.write(value.block_headers_commitment, buf) + _UniffiFfiConverterBytes.write(value.voters_commitment, buf) + _UniffiFfiConverterUInt64.write(value.ln_proven_weight, buf) + _UniffiFfiConverterUInt64.write(value.first_attested_round, buf) + _UniffiFfiConverterUInt64.write(value.last_attested_round, buf) + +class _UniffiFfiConverterOptionalTypeStateProofMessage(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeStateProofMessage.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeStateProofMessage.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeStateProofMessage.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class StateProofTransactionFields: + def __init__(self, *, state_proof_type:typing.Optional[int] = _DEFAULT, state_proof:typing.Optional[StateProof] = _DEFAULT, message:typing.Optional[StateProofMessage] = _DEFAULT): + if state_proof_type is _DEFAULT: + self.state_proof_type = None + else: + self.state_proof_type = state_proof_type + if state_proof is _DEFAULT: + self.state_proof = None + else: + self.state_proof = state_proof + if message is _DEFAULT: + self.message = None + else: + self.message = message + + + + + def __str__(self): + return "StateProofTransactionFields(state_proof_type={}, state_proof={}, message={})".format(self.state_proof_type, self.state_proof, self.message) + def __eq__(self, other): + if self.state_proof_type != other.state_proof_type: + return False + if self.state_proof != other.state_proof: + return False + if self.message != other.message: + return False + return True + +class _UniffiFfiConverterTypeStateProofTransactionFields(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return StateProofTransactionFields( + state_proof_type=_UniffiFfiConverterOptionalUInt64.read(buf), + state_proof=_UniffiFfiConverterOptionalTypeStateProof.read(buf), + message=_UniffiFfiConverterOptionalTypeStateProofMessage.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalUInt64.check_lower(value.state_proof_type) + _UniffiFfiConverterOptionalTypeStateProof.check_lower(value.state_proof) + _UniffiFfiConverterOptionalTypeStateProofMessage.check_lower(value.message) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalUInt64.write(value.state_proof_type, buf) + _UniffiFfiConverterOptionalTypeStateProof.write(value.state_proof, buf) + _UniffiFfiConverterOptionalTypeStateProofMessage.write(value.message, buf) + +class _UniffiFfiConverterOptionalTypeStateProofTransactionFields(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeStateProofTransactionFields.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeStateProofTransactionFields.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeStateProofTransactionFields.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class Transaction: + def __init__(self, *, transaction_type:TransactionType, sender:str, fee:typing.Optional[int] = _DEFAULT, first_valid:int, last_valid:int, genesis_hash:typing.Optional[bytes], genesis_id:typing.Optional[str], note:typing.Optional[bytes] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, group:typing.Optional[bytes] = _DEFAULT, payment:typing.Optional[PaymentTransactionFields] = _DEFAULT, asset_transfer:typing.Optional[AssetTransferTransactionFields] = _DEFAULT, asset_config:typing.Optional[AssetConfigTransactionFields] = _DEFAULT, app_call:typing.Optional[AppCallTransactionFields] = _DEFAULT, key_registration:typing.Optional[KeyRegistrationTransactionFields] = _DEFAULT, asset_freeze:typing.Optional[AssetFreezeTransactionFields] = _DEFAULT, heartbeat:typing.Optional[HeartbeatTransactionFields] = _DEFAULT, state_proof:typing.Optional[StateProofTransactionFields] = _DEFAULT): + self.transaction_type = transaction_type + self.sender = sender + if fee is _DEFAULT: + self.fee = None + else: + self.fee = fee + self.first_valid = first_valid + self.last_valid = last_valid + self.genesis_hash = genesis_hash + self.genesis_id = genesis_id + if note is _DEFAULT: + self.note = None + else: + self.note = note + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if group is _DEFAULT: + self.group = None + else: + self.group = group + if payment is _DEFAULT: + self.payment = None + else: + self.payment = payment + if asset_transfer is _DEFAULT: + self.asset_transfer = None + else: + self.asset_transfer = asset_transfer + if asset_config is _DEFAULT: + self.asset_config = None + else: + self.asset_config = asset_config + if app_call is _DEFAULT: + self.app_call = None + else: + self.app_call = app_call + if key_registration is _DEFAULT: + self.key_registration = None + else: + self.key_registration = key_registration + if asset_freeze is _DEFAULT: + self.asset_freeze = None + else: + self.asset_freeze = asset_freeze + if heartbeat is _DEFAULT: + self.heartbeat = None + else: + self.heartbeat = heartbeat + if state_proof is _DEFAULT: + self.state_proof = None + else: + self.state_proof = state_proof + + + + + def __str__(self): + return "Transaction(transaction_type={}, sender={}, fee={}, first_valid={}, last_valid={}, genesis_hash={}, genesis_id={}, note={}, rekey_to={}, lease={}, group={}, payment={}, asset_transfer={}, asset_config={}, app_call={}, key_registration={}, asset_freeze={}, heartbeat={}, state_proof={})".format(self.transaction_type, self.sender, self.fee, self.first_valid, self.last_valid, self.genesis_hash, self.genesis_id, self.note, self.rekey_to, self.lease, self.group, self.payment, self.asset_transfer, self.asset_config, self.app_call, self.key_registration, self.asset_freeze, self.heartbeat, self.state_proof) + def __eq__(self, other): + if self.transaction_type != other.transaction_type: + return False + if self.sender != other.sender: + return False + if self.fee != other.fee: + return False + if self.first_valid != other.first_valid: + return False + if self.last_valid != other.last_valid: + return False + if self.genesis_hash != other.genesis_hash: + return False + if self.genesis_id != other.genesis_id: + return False + if self.note != other.note: + return False + if self.rekey_to != other.rekey_to: + return False + if self.lease != other.lease: + return False + if self.group != other.group: + return False + if self.payment != other.payment: + return False + if self.asset_transfer != other.asset_transfer: + return False + if self.asset_config != other.asset_config: + return False + if self.app_call != other.app_call: + return False + if self.key_registration != other.key_registration: + return False + if self.asset_freeze != other.asset_freeze: + return False + if self.heartbeat != other.heartbeat: + return False + if self.state_proof != other.state_proof: + return False + return True + +class _UniffiFfiConverterTypeTransaction(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Transaction( + transaction_type=_UniffiFfiConverterTypeTransactionType.read(buf), + sender=_UniffiFfiConverterString.read(buf), + fee=_UniffiFfiConverterOptionalUInt64.read(buf), + first_valid=_UniffiFfiConverterUInt64.read(buf), + last_valid=_UniffiFfiConverterUInt64.read(buf), + genesis_hash=_UniffiFfiConverterOptionalBytes.read(buf), + genesis_id=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + group=_UniffiFfiConverterOptionalBytes.read(buf), + payment=_UniffiFfiConverterOptionalTypePaymentTransactionFields.read(buf), + asset_transfer=_UniffiFfiConverterOptionalTypeAssetTransferTransactionFields.read(buf), + asset_config=_UniffiFfiConverterOptionalTypeAssetConfigTransactionFields.read(buf), + app_call=_UniffiFfiConverterOptionalTypeAppCallTransactionFields.read(buf), + key_registration=_UniffiFfiConverterOptionalTypeKeyRegistrationTransactionFields.read(buf), + asset_freeze=_UniffiFfiConverterOptionalTypeAssetFreezeTransactionFields.read(buf), + heartbeat=_UniffiFfiConverterOptionalTypeHeartbeatTransactionFields.read(buf), + state_proof=_UniffiFfiConverterOptionalTypeStateProofTransactionFields.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeTransactionType.check_lower(value.transaction_type) + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalUInt64.check_lower(value.fee) + _UniffiFfiConverterUInt64.check_lower(value.first_valid) + _UniffiFfiConverterUInt64.check_lower(value.last_valid) + _UniffiFfiConverterOptionalBytes.check_lower(value.genesis_hash) + _UniffiFfiConverterOptionalString.check_lower(value.genesis_id) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalBytes.check_lower(value.group) + _UniffiFfiConverterOptionalTypePaymentTransactionFields.check_lower(value.payment) + _UniffiFfiConverterOptionalTypeAssetTransferTransactionFields.check_lower(value.asset_transfer) + _UniffiFfiConverterOptionalTypeAssetConfigTransactionFields.check_lower(value.asset_config) + _UniffiFfiConverterOptionalTypeAppCallTransactionFields.check_lower(value.app_call) + _UniffiFfiConverterOptionalTypeKeyRegistrationTransactionFields.check_lower(value.key_registration) + _UniffiFfiConverterOptionalTypeAssetFreezeTransactionFields.check_lower(value.asset_freeze) + _UniffiFfiConverterOptionalTypeHeartbeatTransactionFields.check_lower(value.heartbeat) + _UniffiFfiConverterOptionalTypeStateProofTransactionFields.check_lower(value.state_proof) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeTransactionType.write(value.transaction_type, buf) + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalUInt64.write(value.fee, buf) + _UniffiFfiConverterUInt64.write(value.first_valid, buf) + _UniffiFfiConverterUInt64.write(value.last_valid, buf) + _UniffiFfiConverterOptionalBytes.write(value.genesis_hash, buf) + _UniffiFfiConverterOptionalString.write(value.genesis_id, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalBytes.write(value.group, buf) + _UniffiFfiConverterOptionalTypePaymentTransactionFields.write(value.payment, buf) + _UniffiFfiConverterOptionalTypeAssetTransferTransactionFields.write(value.asset_transfer, buf) + _UniffiFfiConverterOptionalTypeAssetConfigTransactionFields.write(value.asset_config, buf) + _UniffiFfiConverterOptionalTypeAppCallTransactionFields.write(value.app_call, buf) + _UniffiFfiConverterOptionalTypeKeyRegistrationTransactionFields.write(value.key_registration, buf) + _UniffiFfiConverterOptionalTypeAssetFreezeTransactionFields.write(value.asset_freeze, buf) + _UniffiFfiConverterOptionalTypeHeartbeatTransactionFields.write(value.heartbeat, buf) + _UniffiFfiConverterOptionalTypeStateProofTransactionFields.write(value.state_proof, buf) + +class _UniffiFfiConverterOptionalTypeMultisigSignature(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeMultisigSignature.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeMultisigSignature.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeMultisigSignature.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class SignedTransaction: + def __init__(self, *, transaction:Transaction, signature:typing.Optional[bytes] = _DEFAULT, auth_address:typing.Optional[str] = _DEFAULT, multisignature:typing.Optional[MultisigSignature] = _DEFAULT): + self.transaction = transaction + if signature is _DEFAULT: + self.signature = None + else: + self.signature = signature + if auth_address is _DEFAULT: + self.auth_address = None + else: + self.auth_address = auth_address + if multisignature is _DEFAULT: + self.multisignature = None + else: + self.multisignature = multisignature + + + + + def __str__(self): + return "SignedTransaction(transaction={}, signature={}, auth_address={}, multisignature={})".format(self.transaction, self.signature, self.auth_address, self.multisignature) + def __eq__(self, other): + if self.transaction != other.transaction: + return False + if self.signature != other.signature: + return False + if self.auth_address != other.auth_address: + return False + if self.multisignature != other.multisignature: + return False + return True + +class _UniffiFfiConverterTypeSignedTransaction(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SignedTransaction( + transaction=_UniffiFfiConverterTypeTransaction.read(buf), + signature=_UniffiFfiConverterOptionalBytes.read(buf), + auth_address=_UniffiFfiConverterOptionalString.read(buf), + multisignature=_UniffiFfiConverterOptionalTypeMultisigSignature.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeTransaction.check_lower(value.transaction) + _UniffiFfiConverterOptionalBytes.check_lower(value.signature) + _UniffiFfiConverterOptionalString.check_lower(value.auth_address) + _UniffiFfiConverterOptionalTypeMultisigSignature.check_lower(value.multisignature) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeTransaction.write(value.transaction, buf) + _UniffiFfiConverterOptionalBytes.write(value.signature, buf) + _UniffiFfiConverterOptionalString.write(value.auth_address, buf) + _UniffiFfiConverterOptionalTypeMultisigSignature.write(value.multisignature, buf) + + + +# AlgoKitTransactError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class AlgoKitTransactError(Exception): + pass + +_UniffiTempAlgoKitTransactError = AlgoKitTransactError + +class AlgoKitTransactError: # type: ignore + + class EncodingError(_UniffiTempAlgoKitTransactError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "AlgoKitTransactError.EncodingError({})".format(str(self)) + _UniffiTempAlgoKitTransactError.EncodingError = EncodingError # type: ignore + class DecodingError(_UniffiTempAlgoKitTransactError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "AlgoKitTransactError.DecodingError({})".format(str(self)) + _UniffiTempAlgoKitTransactError.DecodingError = DecodingError # type: ignore + class InputError(_UniffiTempAlgoKitTransactError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "AlgoKitTransactError.InputError({})".format(str(self)) + _UniffiTempAlgoKitTransactError.InputError = InputError # type: ignore + class MsgPackError(_UniffiTempAlgoKitTransactError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "AlgoKitTransactError.MsgPackError({})".format(str(self)) + _UniffiTempAlgoKitTransactError.MsgPackError = MsgPackError # type: ignore + +AlgoKitTransactError = _UniffiTempAlgoKitTransactError # type: ignore +del _UniffiTempAlgoKitTransactError + + +class _UniffiFfiConverterTypeAlgoKitTransactError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AlgoKitTransactError.EncodingError( + _UniffiFfiConverterString.read(buf), + ) + if variant == 2: + return AlgoKitTransactError.DecodingError( + _UniffiFfiConverterString.read(buf), + ) + if variant == 3: + return AlgoKitTransactError.InputError( + _UniffiFfiConverterString.read(buf), + ) + if variant == 4: + return AlgoKitTransactError.MsgPackError( + _UniffiFfiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, AlgoKitTransactError.EncodingError): + _UniffiFfiConverterString.check_lower(value.message) + return + if isinstance(value, AlgoKitTransactError.DecodingError): + _UniffiFfiConverterString.check_lower(value.message) + return + if isinstance(value, AlgoKitTransactError.InputError): + _UniffiFfiConverterString.check_lower(value.message) + return + if isinstance(value, AlgoKitTransactError.MsgPackError): + _UniffiFfiConverterString.check_lower(value.message) + return + + @staticmethod + def write(value, buf): + if isinstance(value, AlgoKitTransactError.EncodingError): + buf.write_i32(1) + _UniffiFfiConverterString.write(value.message, buf) + if isinstance(value, AlgoKitTransactError.DecodingError): + buf.write_i32(2) + _UniffiFfiConverterString.write(value.message, buf) + if isinstance(value, AlgoKitTransactError.InputError): + buf.write_i32(3) + _UniffiFfiConverterString.write(value.message, buf) + if isinstance(value, AlgoKitTransactError.MsgPackError): + buf.write_i32(4) + _UniffiFfiConverterString.write(value.message, buf) + + + + + + +class AlgorandConstant(enum.Enum): + """ + Enum containing all constants used in this crate. +""" + + HASH_LENGTH = 0 + """ + Length of hash digests (32) +""" + + CHECKSUM_LENGTH = 1 + """ + Length of the checksum used in Algorand addresses (4) +""" + + ADDRESS_LENGTH = 2 + """ + Length of a base32-encoded Algorand address (58) +""" + + PUBLIC_KEY_LENGTH = 3 + """ + Length of an Algorand public key in bytes (32) +""" + + SECRET_KEY_LENGTH = 4 + """ + Length of an Algorand secret key in bytes (32) +""" + + SIGNATURE_LENGTH = 5 + """ + Length of an Algorand signature in bytes (64) +""" + + SIGNATURE_ENCODING_INCR_LENGTH = 6 + """ + Increment in the encoded byte size when a signature is attached to a transaction (75) +""" + + MAX_TX_GROUP_SIZE = 7 + """ + The maximum number of transactions in a group (16) +""" + + + +class _UniffiFfiConverterTypeAlgorandConstant(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AlgorandConstant.HASH_LENGTH + if variant == 2: + return AlgorandConstant.CHECKSUM_LENGTH + if variant == 3: + return AlgorandConstant.ADDRESS_LENGTH + if variant == 4: + return AlgorandConstant.PUBLIC_KEY_LENGTH + if variant == 5: + return AlgorandConstant.SECRET_KEY_LENGTH + if variant == 6: + return AlgorandConstant.SIGNATURE_LENGTH + if variant == 7: + return AlgorandConstant.SIGNATURE_ENCODING_INCR_LENGTH + if variant == 8: + return AlgorandConstant.MAX_TX_GROUP_SIZE + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == AlgorandConstant.HASH_LENGTH: + return + if value == AlgorandConstant.CHECKSUM_LENGTH: + return + if value == AlgorandConstant.ADDRESS_LENGTH: + return + if value == AlgorandConstant.PUBLIC_KEY_LENGTH: + return + if value == AlgorandConstant.SECRET_KEY_LENGTH: + return + if value == AlgorandConstant.SIGNATURE_LENGTH: + return + if value == AlgorandConstant.SIGNATURE_ENCODING_INCR_LENGTH: + return + if value == AlgorandConstant.MAX_TX_GROUP_SIZE: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == AlgorandConstant.HASH_LENGTH: + buf.write_i32(1) + if value == AlgorandConstant.CHECKSUM_LENGTH: + buf.write_i32(2) + if value == AlgorandConstant.ADDRESS_LENGTH: + buf.write_i32(3) + if value == AlgorandConstant.PUBLIC_KEY_LENGTH: + buf.write_i32(4) + if value == AlgorandConstant.SECRET_KEY_LENGTH: + buf.write_i32(5) + if value == AlgorandConstant.SIGNATURE_LENGTH: + buf.write_i32(6) + if value == AlgorandConstant.SIGNATURE_ENCODING_INCR_LENGTH: + buf.write_i32(7) + if value == AlgorandConstant.MAX_TX_GROUP_SIZE: + buf.write_i32(8) + + + +class _UniffiFfiConverterSequenceTypeSignedTransaction(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeSignedTransaction.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeSignedTransaction.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeSignedTransaction.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterSequenceTypeTransaction(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeTransaction.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeTransaction.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeTransaction.read(buf) for i in range(count) + ] +def address_from_multisig_signature(multisig_signature: MultisigSignature) -> str: + """ + Returns the address of the multisignature account. + + # Errors + /// Returns [`AlgoKitTransactError`] if the multisignature signature is invalid or the address cannot be derived. +""" + + _UniffiFfiConverterTypeMultisigSignature.check_lower(multisig_signature) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeMultisigSignature.lower(multisig_signature), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_address_from_multisig_signature, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def address_from_public_key(public_key: bytes) -> str: + + _UniffiFfiConverterBytes.check_lower(public_key) + _uniffi_lowered_args = ( + _UniffiFfiConverterBytes.lower(public_key), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_address_from_public_key, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def apply_multisig_subsignature(multisig_signature: MultisigSignature,participant: str,subsignature: bytes) -> MultisigSignature: + """ + Applies a subsignature for a participant to a multisignature signature, replacing any existing signature. + + # Errors + + Returns [`AlgoKitTransactError`] if the participant address is invalid or not found, or if the signature bytes are invalid. +""" + + _UniffiFfiConverterTypeMultisigSignature.check_lower(multisig_signature) + + _UniffiFfiConverterString.check_lower(participant) + + _UniffiFfiConverterBytes.check_lower(subsignature) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeMultisigSignature.lower(multisig_signature), + _UniffiFfiConverterString.lower(participant), + _UniffiFfiConverterBytes.lower(subsignature), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeMultisigSignature.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_apply_multisig_subsignature, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def assign_fee(transaction: Transaction,fee_params: FeeParams) -> Transaction: + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + + _UniffiFfiConverterTypeFeeParams.check_lower(fee_params) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + _UniffiFfiConverterTypeFeeParams.lower(fee_params), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_assign_fee, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def calculate_fee(transaction: Transaction,fee_params: FeeParams) -> int: + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + + _UniffiFfiConverterTypeFeeParams.check_lower(fee_params) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + _UniffiFfiConverterTypeFeeParams.lower(fee_params), + ) + _uniffi_lift_return = _UniffiFfiConverterUInt64.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_calculate_fee, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def decode_signed_transaction(encoded_signed_transaction: bytes) -> SignedTransaction: + """ + Decodes a signed transaction. + + # Parameters + * `encoded_signed_transaction` - The MsgPack encoded signed transaction bytes + + # Returns + The decoded SignedTransaction or an error if decoding fails. +""" + + _UniffiFfiConverterBytes.check_lower(encoded_signed_transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterBytes.lower(encoded_signed_transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeSignedTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_signed_transaction, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def decode_signed_transactions(encoded_signed_transactions: typing.List[bytes]) -> typing.List[SignedTransaction]: + """ + Decodes a collection of MsgPack bytes into a signed transaction collection. + + # Parameters + * `encoded_signed_transactions` - A collection of MsgPack encoded bytes, each representing a signed transaction. + + # Returns + A collection of decoded signed transactions or an error if decoding fails. +""" + + _UniffiFfiConverterSequenceBytes.check_lower(encoded_signed_transactions) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceBytes.lower(encoded_signed_transactions), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeSignedTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_signed_transactions, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def decode_transaction(encoded_tx: bytes) -> Transaction: + """ + Decodes MsgPack bytes into a transaction. + + # Parameters + * `encoded_tx` - MsgPack encoded bytes representing a transaction. + + # Returns + A decoded transaction or an error if decoding fails. +""" + + _UniffiFfiConverterBytes.check_lower(encoded_tx) + _uniffi_lowered_args = ( + _UniffiFfiConverterBytes.lower(encoded_tx), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_transaction, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def decode_transactions(encoded_txs: typing.List[bytes]) -> typing.List[Transaction]: + """ + Decodes a collection of MsgPack bytes into a transaction collection. + + # Parameters + * `encoded_txs` - A collection of MsgPack encoded bytes, each representing a transaction. + + # Returns + A collection of decoded transactions or an error if decoding fails. +""" + + _UniffiFfiConverterSequenceBytes.check_lower(encoded_txs) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceBytes.lower(encoded_txs), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_decode_transactions, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def encode_signed_transaction(signed_transaction: SignedTransaction) -> bytes: + """ + Encode a signed transaction to MsgPack for sending on the network. + + This method performs canonical encoding. No domain separation prefix is applicable. + + # Parameters + * `signed_transaction` - The signed transaction to encode + + # Returns + The MsgPack encoded bytes or an error if encoding fails. +""" + + _UniffiFfiConverterTypeSignedTransaction.check_lower(signed_transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeSignedTransaction.lower(signed_transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_signed_transaction, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def encode_signed_transactions(signed_transactions: typing.List[SignedTransaction]) -> typing.List[bytes]: + """ + Encode signed transactions to MsgPack for sending on the network. + + This method performs canonical encoding. No domain separation prefix is applicable. + + # Parameters + * `signed_transactions` - A collection of signed transactions to encode + + # Returns + A collection of MsgPack encoded bytes or an error if encoding fails. +""" + + _UniffiFfiConverterSequenceTypeSignedTransaction.check_lower(signed_transactions) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceTypeSignedTransaction.lower(signed_transactions), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_signed_transactions, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def encode_transaction(transaction: Transaction) -> bytes: + """ + Encode the transaction with the domain separation (e.g. "TX") prefix +""" + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transaction, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def encode_transaction_raw(transaction: Transaction) -> bytes: + """ + Encode the transaction without the domain separation (e.g. "TX") prefix + This is useful for encoding the transaction for signing with tools that automatically add "TX" prefix to the transaction bytes. +""" + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transaction_raw, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def encode_transactions(transactions: typing.List[Transaction]) -> typing.List[bytes]: + """ + Encode transactions to MsgPack with the domain separation (e.g. "TX") prefix. + + # Parameters + * `transactions` - A collection of transactions to encode + + # Returns + A collection of MsgPack encoded bytes or an error if encoding fails. +""" + + _UniffiFfiConverterSequenceTypeTransaction.check_lower(transactions) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceTypeTransaction.lower(transactions), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_encode_transactions, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def estimate_transaction_size(transaction: Transaction) -> int: + """ + Return the size of the transaction in bytes as if it was already signed and encoded. + This is useful for estimating the fee for the transaction. +""" + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterUInt64.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_estimate_transaction_size, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def get_algorand_constant(constant: AlgorandConstant) -> int: + + _UniffiFfiConverterTypeAlgorandConstant.check_lower(constant) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeAlgorandConstant.lower(constant), + ) + _uniffi_lift_return = _UniffiFfiConverterUInt64.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_algorand_constant, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def get_encoded_transaction_type(encoded_transaction: bytes) -> TransactionType: + """ + Get the transaction type from the encoded transaction. + This is particularly useful when decoding a transaction that has an unknown type +""" + + _UniffiFfiConverterBytes.check_lower(encoded_transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterBytes.lower(encoded_transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionType.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_encoded_transaction_type, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def get_transaction_id(transaction: Transaction) -> str: + """ + Get the base32 transaction ID string for a transaction. +""" + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_transaction_id, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def get_transaction_id_raw(transaction: Transaction) -> bytes: + """ + Get the raw 32-byte transaction ID for a transaction. +""" + + _UniffiFfiConverterTypeTransaction.check_lower(transaction) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeTransaction.lower(transaction), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_get_transaction_id_raw, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def group_transactions(transactions: typing.List[Transaction]) -> typing.List[Transaction]: + """ + Groups a collection of transactions by calculating and assigning the group to each transaction. +""" + + _UniffiFfiConverterSequenceTypeTransaction.check_lower(transactions) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceTypeTransaction.lower(transactions), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_group_transactions, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def merge_multisignatures(multisig_signature_a: MultisigSignature,multisig_signature_b: MultisigSignature) -> MultisigSignature: + """ + Merges two multisignature signatures, replacing signatures in the first with those from the second where present. + + # Errors + + Returns [`AlgoKitTransactError`] if the multisignature parameters or participants do not match. +""" + + _UniffiFfiConverterTypeMultisigSignature.check_lower(multisig_signature_a) + + _UniffiFfiConverterTypeMultisigSignature.check_lower(multisig_signature_b) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeMultisigSignature.lower(multisig_signature_a), + _UniffiFfiConverterTypeMultisigSignature.lower(multisig_signature_b), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeMultisigSignature.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_merge_multisignatures, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def new_multisig_signature(version: int,threshold: int,participants: typing.List[str]) -> MultisigSignature: + """ + Creates an empty multisignature signature from a list of participant addresses. + + # Errors + + Returns [`AlgoKitTransactError`] if any address is invalid or the multisignature parameters are invalid. +""" + + _UniffiFfiConverterUInt8.check_lower(version) + + _UniffiFfiConverterUInt8.check_lower(threshold) + + _UniffiFfiConverterSequenceString.check_lower(participants) + _uniffi_lowered_args = ( + _UniffiFfiConverterUInt8.lower(version), + _UniffiFfiConverterUInt8.lower(threshold), + _UniffiFfiConverterSequenceString.lower(participants), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeMultisigSignature.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_new_multisig_signature, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def participants_from_multisig_signature(multisig_signature: MultisigSignature) -> typing.List[str]: + """ + Returns the list of participant addresses from a multisignature signature. + + # Errors + Returns [`AlgoKitTransactError`] if the multisignature is invalid. +""" + + _UniffiFfiConverterTypeMultisigSignature.check_lower(multisig_signature) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeMultisigSignature.lower(multisig_signature), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_participants_from_multisig_signature, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) +def public_key_from_address(address: str) -> bytes: + + _UniffiFfiConverterString.check_lower(address) + _uniffi_lowered_args = ( + _UniffiFfiConverterString.lower(address), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeAlgoKitTransactError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_transact_ffi_fn_func_public_key_from_address, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + +__all__ = [ + "InternalError", + "OnApplicationComplete", + "TransactionType", + "AlgoKitTransactError", + "AlgorandConstant", + "StateSchema", + "BoxReference", + "AppCallTransactionFields", + "AssetConfigTransactionFields", + "AssetFreezeTransactionFields", + "AssetTransferTransactionFields", + "HashFactory", + "MerkleArrayProof", + "FalconVerifier", + "FalconSignatureStruct", + "FeeParams", + "HeartbeatProof", + "HeartbeatTransactionFields", + "KeyPairAccount", + "KeyRegistrationTransactionFields", + "MerkleSignatureVerifier", + "MultisigSubsignature", + "MultisigSignature", + "Participant", + "PaymentTransactionFields", + "SigslotCommit", + "Reveal", + "StateProof", + "StateProofMessage", + "StateProofTransactionFields", + "Transaction", + "SignedTransaction", + "address_from_multisig_signature", + "address_from_public_key", + "apply_multisig_subsignature", + "assign_fee", + "calculate_fee", + "decode_signed_transaction", + "decode_signed_transactions", + "decode_transaction", + "decode_transactions", + "encode_signed_transaction", + "encode_signed_transactions", + "encode_transaction", + "encode_transaction_raw", + "encode_transactions", + "estimate_transaction_size", + "get_algorand_constant", + "get_encoded_transaction_type", + "get_transaction_id", + "get_transaction_id_raw", + "group_transactions", + "merge_multisignatures", + "new_multisig_signature", + "participants_from_multisig_signature", + "public_key_from_address", +] \ No newline at end of file diff --git a/packages/python/algokit_utils/algokit_utils/algokit_utils_ffi.py b/packages/python/algokit_utils/algokit_utils/algokit_utils_ffi.py new file mode 100644 index 000000000..8b293f854 --- /dev/null +++ b/packages/python/algokit_utils/algokit_utils/algokit_utils_ffi.py @@ -0,0 +1,11927 @@ +# This file was autogenerated by some hot garbage in the `uniffi` crate. +# Trust me, you don't want to mess with it! + +# Common helper code. +# +# Ideally this would live in a separate .py file where it can be unittested etc +# in isolation, and perhaps even published as a re-useable package. +# +# However, it's important that the details of how this helper code works (e.g. the +# way that different builtin types are passed across the FFI) exactly match what's +# expected by the rust code on the other side of the interface. In practice right +# now that means coming from the exact some version of `uniffi` that was used to +# compile the rust component. The easiest way to ensure this is to bundle the Python +# helpers directly inline like we're doing here. + +from __future__ import annotations +import os +import sys +import ctypes +from dataclasses import dataclass +import enum +import struct +import contextlib +import datetime +import threading +import itertools +import traceback +import typing +import asyncio +import platform +from . import algod_client_ffi +import algokit_transact + + +# Used for default argument values +_DEFAULT = object() # type: typing.Any + + +class _UniffiRustBuffer(ctypes.Structure): + _fields_ = [ + ("capacity", ctypes.c_uint64), + ("len", ctypes.c_uint64), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + @staticmethod + def default(): + return _UniffiRustBuffer(0, 0, None) + + @staticmethod + def alloc(size): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_alloc, size) + + @staticmethod + def reserve(rbuf, additional): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_reserve, rbuf, additional) + + def free(self): + return _uniffi_rust_call(_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_free, self) + + def __str__(self): + return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( + self.capacity, + self.len, + self.data[0:self.len] + ) + + @contextlib.contextmanager + def alloc_with_builder(*args): + """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. + + The allocated buffer will be automatically freed if an error occurs, ensuring that + we don't accidentally leak it. + """ + builder = _UniffiRustBufferBuilder() + try: + yield builder + except: + builder.discard() + raise + + @contextlib.contextmanager + def consume_with_stream(self): + """Context-manager to consume a buffer using a _UniffiRustBufferStream. + + The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't + leak it even if an error occurs. + """ + try: + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of consume_with_stream {s.remaining()}") + finally: + self.free() + + @contextlib.contextmanager + def read_with_stream(self): + """Context-manager to read a buffer using a _UniffiRustBufferStream. + + This is like consume_with_stream, but doesn't free the buffer afterwards. + It should only be used with borrowed `_UniffiRustBuffer` data. + """ + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError(f"junk data left in buffer at end of read_with_stream {s.remaining()}") + +class _UniffiForeignBytes(ctypes.Structure): + _fields_ = [ + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + def __str__(self): + return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) + + +class _UniffiRustBufferStream: + """ + Helper for structured reading of bytes from a _UniffiRustBuffer + """ + + def __init__(self, data, len): + self.data = data + self.len = len + self.offset = 0 + + @classmethod + def from_rust_buffer(cls, buf): + return cls(buf.data, buf.len) + + def remaining(self): + return self.len - self.offset + + def _unpack_from(self, size, format): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] + self.offset += size + return value + + def read(self, size): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + data = self.data[self.offset:self.offset+size] + self.offset += size + return data + + def read_i8(self): + return self._unpack_from(1, ">b") + + def read_u8(self): + return self._unpack_from(1, ">B") + + def read_i16(self): + return self._unpack_from(2, ">h") + + def read_u16(self): + return self._unpack_from(2, ">H") + + def read_i32(self): + return self._unpack_from(4, ">i") + + def read_u32(self): + return self._unpack_from(4, ">I") + + def read_i64(self): + return self._unpack_from(8, ">q") + + def read_u64(self): + return self._unpack_from(8, ">Q") + + def read_float(self): + v = self._unpack_from(4, ">f") + return v + + def read_double(self): + return self._unpack_from(8, ">d") + +class _UniffiRustBufferBuilder: + """ + Helper for structured writing of bytes into a _UniffiRustBuffer. + """ + + def __init__(self): + self.rbuf = _UniffiRustBuffer.alloc(16) + self.rbuf.len = 0 + + def finalize(self): + rbuf = self.rbuf + self.rbuf = None + return rbuf + + def discard(self): + if self.rbuf is not None: + rbuf = self.finalize() + rbuf.free() + + @contextlib.contextmanager + def _reserve(self, num_bytes): + if self.rbuf.len + num_bytes > self.rbuf.capacity: + self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) + yield None + self.rbuf.len += num_bytes + + def _pack_into(self, size, format, value): + with self._reserve(size): + # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. + for i, byte in enumerate(struct.pack(format, value)): + self.rbuf.data[self.rbuf.len + i] = byte + + def write(self, value): + with self._reserve(len(value)): + for i, byte in enumerate(value): + self.rbuf.data[self.rbuf.len + i] = byte + + def write_i8(self, v): + self._pack_into(1, ">b", v) + + def write_u8(self, v): + self._pack_into(1, ">B", v) + + def write_i16(self, v): + self._pack_into(2, ">h", v) + + def write_u16(self, v): + self._pack_into(2, ">H", v) + + def write_i32(self, v): + self._pack_into(4, ">i", v) + + def write_u32(self, v): + self._pack_into(4, ">I", v) + + def write_i64(self, v): + self._pack_into(8, ">q", v) + + def write_u64(self, v): + self._pack_into(8, ">Q", v) + + def write_float(self, v): + self._pack_into(4, ">f", v) + + def write_double(self, v): + self._pack_into(8, ">d", v) + + def write_c_size_t(self, v): + self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) +# A handful of classes and functions to support the generated data structures. +# This would be a good candidate for isolating in its own ffi-support lib. + +class InternalError(Exception): + pass + +class _UniffiRustCallStatus(ctypes.Structure): + """ + Error runtime. + """ + _fields_ = [ + ("code", ctypes.c_int8), + ("error_buf", _UniffiRustBuffer), + ] + + # These match the values from the uniffi::rustcalls module + CALL_SUCCESS = 0 + CALL_ERROR = 1 + CALL_UNEXPECTED_ERROR = 2 + + @staticmethod + def default(): + return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default()) + + def __str__(self): + if self.code == _UniffiRustCallStatus.CALL_SUCCESS: + return "_UniffiRustCallStatus(CALL_SUCCESS)" + elif self.code == _UniffiRustCallStatus.CALL_ERROR: + return "_UniffiRustCallStatus(CALL_ERROR)" + elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)" + else: + return "_UniffiRustCallStatus()" + +def _uniffi_rust_call(fn, *args): + # Call a rust function + return _uniffi_rust_call_with_error(None, fn, *args) + +def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args): + # Call a rust function and handle any errors + # + # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. + # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. + call_status = _UniffiRustCallStatus.default() + + args_with_error = args + (ctypes.byref(call_status),) + result = fn(*args_with_error) + _uniffi_check_call_status(error_ffi_converter, call_status) + return result + +def _uniffi_check_call_status(error_ffi_converter, call_status): + if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: + pass + elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: + if error_ffi_converter is None: + call_status.error_buf.free() + raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") + else: + raise error_ffi_converter.lift(call_status.error_buf) + elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer + # with the message. But if that code panics, then it just sends back + # an empty buffer. + if call_status.error_buf.len > 0: + msg = _UniffiFfiConverterString.lift(call_status.error_buf) + else: + msg = "Unknown rust panic" + raise InternalError(msg) + else: + raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( + call_status.code)) + +def _uniffi_trait_interface_call(call_status, make_call, write_return_value): + try: + return write_return_value(make_call()) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) + +def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error): + try: + try: + return write_return_value(make_call()) + except error_type as e: + call_status.code = _UniffiRustCallStatus.CALL_ERROR + call_status.error_buf = lower_error(e) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiFfiConverterString.lower(repr(e)) +# Initial value and increment amount for handles. +# These ensure that Python-generated handles always have the lowest bit set +_UNIFFI_HANDLEMAP_INITIAL = 1 +_UNIFFI_HANDLEMAP_DELTA = 2 + +class _UniffiHandleMap: + """ + A map where inserting, getting and removing data is synchronized with a lock. + """ + + def __init__(self): + # type Handle = int + self._map = {} # type: Dict[Handle, Any] + self._lock = threading.Lock() + self._counter = _UNIFFI_HANDLEMAP_INITIAL + + def insert(self, obj): + with self._lock: + return self._insert(obj) + + """Low-level insert, this assumes `self._lock` is held.""" + def _insert(self, obj): + handle = self._counter + self._counter += _UNIFFI_HANDLEMAP_DELTA + self._map[handle] = obj + return handle + + def get(self, handle): + try: + with self._lock: + return self._map[handle] + except KeyError: + raise InternalError(f"_UniffiHandleMap.get: Invalid handle {handle}") + + def clone(self, handle): + try: + with self._lock: + obj = self._map[handle] + return self._insert(obj) + except KeyError: + raise InternalError(f"_UniffiHandleMap.clone: Invalid handle {handle}") + + def remove(self, handle): + try: + with self._lock: + return self._map.pop(handle) + except KeyError: + raise InternalError(f"_UniffiHandleMap.remove: Invalid handle: {handle}") + + def __len__(self): + return len(self._map) +# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. +class _UniffiConverterPrimitive: + @classmethod + def lift(cls, value): + return value + + @classmethod + def lower(cls, value): + return value + +class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__index__() + except Exception: + raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) + if not isinstance(value, int): + raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) + if not cls.VALUE_MIN <= value < cls.VALUE_MAX: + raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) + +class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__float__() + except Exception: + raise TypeError("must be real number, not {}".format(type(value).__name__)) + if not isinstance(value, float): + raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) + +# Helper class for wrapper types that will always go through a _UniffiRustBuffer. +# Classes should inherit from this and implement the `read` and `write` static methods. +class _UniffiConverterRustBuffer: + @classmethod + def lift(cls, rbuf): + with rbuf.consume_with_stream() as stream: + return cls.read(stream) + + @classmethod + def lower(cls, value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + cls.write(value, builder) + return builder.finalize() + +# Contains loading, initialization code, and the FFI Function declarations. +# Define some ctypes FFI types that we use in the library + +""" +Function pointer for a Rust task, which a callback function that takes a opaque pointer +""" +_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) + +def _uniffi_future_callback_t(return_type): + """ + Factory function to create callback function types for async functions + """ + return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus) + +def _uniffi_load_indirect(): + """ + This is how we find and load the dynamic library provided by the component. + For now we just look it up by name. + """ + if sys.platform == "darwin": + libname = "lib{}.dylib" + elif sys.platform.startswith("win"): + # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. + # We could use `os.add_dll_directory` to configure the search path, but + # it doesn't feel right to mess with application-wide settings. Let's + # assume that the `.dll` is next to the `.py` file and load by full path. + libname = os.path.join( + os.path.dirname(__file__), + "{}.dll", + ) + else: + # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos + libname = "lib{}.so" + + libname = libname.format("algokit_utils_ffi") + path = os.path.join(os.path.dirname(__file__), libname) + lib = ctypes.cdll.LoadLibrary(path) + return lib + +def _uniffi_check_contract_api_version(lib): + # Get the bindings contract version from our ComponentInterface + bindings_contract_version = 30 + # Get the scaffolding contract version by calling the into the dylib + scaffolding_contract_version = lib.ffi_algokit_utils_ffi_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version: + raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + +def _uniffi_check_api_checksums(lib): + if lib.uniffi_algokit_utils_ffi_checksum_func_run_asset_freeze_test_suite() != 27927: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_address() != 44199: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_bytes() != 1923: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_string() != 18520: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_uint64() != 50769: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_bool() != 39758: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_byte() != 733: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_dynamic_array() != 19770: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_from_string() != 23247: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_static_array() != 25281: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_string() != 37013: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_struct_fields() != 18128: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_tuple() != 31991: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_ufixed() != 24385: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_uint() != 8781: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abitype_decode() != 43112: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abitype_encode() != 29884: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abitype_to_string() != 26503: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_address() != 33806: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_array() != 46650: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_biguint() != 27203: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_bool() != 48288: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_byte() != 47270: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_bytes() != 39637: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_string() != 16860: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_struct_fields() != 65262: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_uint() != 11616: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_address() != 53833: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_array() != 62046: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_big_uint() != 28498: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_bool() != 17399: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_byte() != 8517: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_bytes() != 15468: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_string() != 50389: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_struct_fields() != 24818: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_uint() != 7369: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_composer_new() != 54325: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_call() != 51911: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_call_method_call() != 36668: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_create() != 56716: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_create_method_call() != 50609: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_delete() != 23969: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_delete_method_call() != 27392: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_update() != 38920: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_update_method_call() != 19710: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_clawback() != 59332: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_config() != 31176: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_create() != 42067: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_destroy() != 61779: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_freeze() != 44087: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_opt_in() != 47319: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_opt_out() != 20451: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_transfer() != 45589: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_unfreeze() != 12930: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_add_payment() != 9188: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_build() != 13184: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_send() != 53274: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composer_wait_for_confirmation() != 62038: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composerfactory_create_composer() != 54297: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_build() != 44731: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_send() != 14646: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_wait_for_confirmation() != 13649: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_payment() != 63083: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_create() != 34726: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_config() != 56942: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_destroy() != 20885: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_freeze() != 60546: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_unfreeze() != 4994: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_transfer() != 18002: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_opt_in() != 3051: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_opt_out() != 53004: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_clawback() != 15669: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_create() != 10217: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_call() != 57607: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_update() != 20663: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_delete() != 9888: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_call_method_call() != 5630: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_create_method_call() != 34001: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_update_method_call() != 55622: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_delete_method_call() != 55089: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_defaultcomposerfactory_new() != 5145: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_structfield_new() != 45077: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_constructor_testfixture_new() != 65070: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_testfixture_create_test_asset() != 14898: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_testfixture_dispenser_account() != 40996: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_testfixture_fund_account() != 22253: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_testfixture_generate_account() != 52762: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_transactionsigner_sign_transactions() != 55831: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_transactionsigner_sign_transaction() != 13641: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_transactionsignergetter_get_signer() != 32889: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_algokit_utils_ffi_checksum_method_transactionsignergetter_register_account() != 12126: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +# A ctypes library to expose the extern-C FFI definitions. +# This is an implementation detail which will be called internally by the public API. + +_UniffiLib = _uniffi_load_indirect() +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_alloc.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_alloc.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_from_bytes.argtypes = ( + _UniffiForeignBytes, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_from_bytes.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_free.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_free.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_reserve.argtypes = ( + _UniffiRustBuffer, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rustbuffer_reserve.restype = _UniffiRustBuffer +_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8, +) +_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure): + _fields_ = [ + ("handle", ctypes.c_uint64), + ("free", _UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK), + ] +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u8.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u8.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u8.restype = ctypes.c_uint8 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u8.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i8.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i8.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i8.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i8.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i8.restype = ctypes.c_int8 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i8.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i8.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u16.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u16.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u16.restype = ctypes.c_uint16 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u16.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i16.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i16.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i16.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i16.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i16.restype = ctypes.c_int16 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i16.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i16.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u32.restype = ctypes.c_uint32 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i32.restype = ctypes.c_int32 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_u64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u64.restype = ctypes.c_uint64 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_i64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_i64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_i64.restype = ctypes.c_int64 +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_i64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_f32.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_f32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_f32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_f32.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_f32.restype = ctypes.c_float +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_f32.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_f32.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_f64.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_f64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_f64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_f64.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_f64.restype = ctypes.c_double +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_f64.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_f64.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_rust_buffer.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_void.argtypes = ( + ctypes.c_uint64, + _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_void.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_cancel_void.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_void.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_void.restype = None +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_void.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.ffi_algokit_utils_ffi_rust_future_free_void.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abistruct.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abistruct.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abistruct.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abistruct.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abitype.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abitype.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abitype.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abitype.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abivalue.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abivalue.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abivalue.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abivalue.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composer.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composer.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composerfactory.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composerfactory.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composerfactory.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composerfactory.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composertrait.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composertrait.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composertrait.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composertrait.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_defaultcomposerfactory.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_defaultcomposerfactory.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_defaultcomposerfactory.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_defaultcomposerfactory.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_structfield.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_structfield.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_structfield.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_structfield.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_testfixture.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_testfixture.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_testfixture.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_testfixture.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_transactionsigner.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_transactionsigner.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_transactionsigner.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_transactionsigner.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_transactionsignergetter.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_transactionsignergetter.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_transactionsignergetter.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_free_transactionsignergetter.restype = None +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.POINTER(ctypes.c_uint64), + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64, +) +_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiVTableCallbackInterfaceAlgokitUtilsFfiComposerFactory(ctypes.Structure): + _fields_ = [ + ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY), + ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY), + ("create_composer", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY_METHOD0), + ] +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_composerfactory.argtypes = ( + ctypes.POINTER(_UniffiVTableCallbackInterfaceAlgokitUtilsFfiComposerFactory), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_composerfactory.restype = None +class _UniffiForeignFutureResultVoid(ctypes.Structure): + _fields_ = [ + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultVoid, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +class _UniffiForeignFutureResultRustBuffer(ctypes.Structure): + _fields_ = [ + ("return_value", _UniffiRustBuffer), + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultRustBuffer, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +class _UniffiForeignFutureResultalgodClientFfiRustBuffer(ctypes.Structure): + _fields_ = [ + ("return_value", algod_client_ffi._UniffiRustBuffer), + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETEALGOD_CLIENT_FFIRUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultalgodClientFfiRustBuffer, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_uint32,_UNIFFI_FOREIGN_FUTURE_COMPLETEALGOD_CLIENT_FFIRUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD4 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD5 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD6 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD7 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD8 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD9 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD10 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD11 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD12 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD13 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD14 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD15 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD16 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD17 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD18 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD19 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD20 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64, +) +_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiVTableCallbackInterfaceAlgokitUtilsFfiComposerTrait(ctypes.Structure): + _fields_ = [ + ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT), + ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT), + ("build", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD0), + ("send", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD1), + ("wait_for_confirmation", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD2), + ("add_payment", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD3), + ("add_asset_create", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD4), + ("add_asset_config", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD5), + ("add_asset_destroy", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD6), + ("add_asset_freeze", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD7), + ("add_asset_unfreeze", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD8), + ("add_asset_transfer", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD9), + ("add_asset_opt_in", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD10), + ("add_asset_opt_out", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD11), + ("add_asset_clawback", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD12), + ("add_app_create", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD13), + ("add_app_call", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD14), + ("add_app_update", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD15), + ("add_app_delete", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD16), + ("add_app_call_method_call", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD17), + ("add_app_create_method_call", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD18), + ("add_app_update_method_call", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD19), + ("add_app_delete_method_call", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD20), + ] +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_composertrait.argtypes = ( + ctypes.POINTER(_UniffiVTableCallbackInterfaceAlgokitUtilsFfiComposerTrait), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_composertrait.restype = None +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +class _UniffiForeignFutureResultalgokitTransactFfiRustBuffer(ctypes.Structure): + _fields_ = [ + ("return_value", algokit_transact._UniffiRustBuffer), + ("call_status", _UniffiRustCallStatus), + ] +_UNIFFI_FOREIGN_FUTURE_COMPLETEALGOKIT_TRANSACT_FFIRUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultalgokitTransactFfiRustBuffer, +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,algokit_transact._UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETEALGOKIT_TRANSACT_FFIRUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct), +) +_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64, +) +_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiVTableCallbackInterfaceAlgokitUtilsFfiTransactionSigner(ctypes.Structure): + _fields_ = [ + ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER), + ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER), + ("sign_transactions", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_METHOD0), + ("sign_transaction", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_METHOD1), + ] +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_transactionsigner.argtypes = ( + ctypes.POINTER(_UniffiVTableCallbackInterfaceAlgokitUtilsFfiTransactionSigner), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_transactionsigner.restype = None +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.POINTER(ctypes.c_uint64), + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64, +) +_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) +class _UniffiVTableCallbackInterfaceAlgokitUtilsFfiTransactionSignerGetter(ctypes.Structure): + _fields_ = [ + ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER), + ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER), + ("get_signer", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER_METHOD0), + ("register_account", _UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER_METHOD1), + ] +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_transactionsignergetter.argtypes = ( + ctypes.POINTER(_UniffiVTableCallbackInterfaceAlgokitUtilsFfiTransactionSignerGetter), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_transactionsignergetter.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_func_run_asset_freeze_test_suite.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_func_run_asset_freeze_test_suite.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_address.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_address.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_bytes.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_bytes.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_string.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_string.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_uint64.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_uint64.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_bool.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_bool.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_byte.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_byte.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_dynamic_array.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_dynamic_array.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_from_string.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_from_string.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_static_array.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_static_array.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_string.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_string.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_struct_fields.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_struct_fields.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_tuple.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_tuple.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_ufixed.argtypes = ( + ctypes.c_uint16, + ctypes.c_uint8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_ufixed.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_uint.argtypes = ( + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_uint.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_decode.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_decode.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_encode.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_encode.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_to_string.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_to_string.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_address.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_address.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_array.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_array.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_biguint.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_biguint.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_bool.argtypes = ( + ctypes.c_int8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_bool.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_byte.argtypes = ( + ctypes.c_uint8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_byte.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_bytes.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_bytes.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_string.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_string.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_struct_fields.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_struct_fields.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_uint.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_uint.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_address.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_address.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_array.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_array.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_big_uint.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_big_uint.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_bool.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_bool.restype = ctypes.c_int8 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_byte.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_byte.restype = ctypes.c_uint8 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_bytes.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_string.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_string.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_struct_fields.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_struct_fields.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_uint.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_uint.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_uniffi_trait_eq_eq.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_uniffi_trait_eq_eq.restype = ctypes.c_int8 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_uniffi_trait_eq_ne.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_uniffi_trait_eq_ne.restype = ctypes.c_int8 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_composer_new.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_composer_new.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_call_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_call_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_create.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_create.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_create_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_create_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_delete.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_delete.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_delete_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_delete_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_update.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_update.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_update_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_update_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_clawback.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_clawback.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_config.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_config.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_create.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_create.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_destroy.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_destroy.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_freeze.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_freeze.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_opt_in.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_opt_in.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_opt_out.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_opt_out.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_transfer.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_transfer.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_unfreeze.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_unfreeze.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_payment.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_payment.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_build.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_build.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_send.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_send.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_wait_for_confirmation.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint32, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_wait_for_confirmation.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composerfactory_create_composer.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composerfactory_create_composer.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_build.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_build.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_send.argtypes = ( + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_send.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_wait_for_confirmation.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint32, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_wait_for_confirmation.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_payment.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_payment.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_create.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_create.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_config.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_config.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_destroy.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_destroy.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_freeze.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_freeze.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_unfreeze.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_unfreeze.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_transfer.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_transfer.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_opt_in.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_opt_in.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_opt_out.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_opt_out.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_clawback.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_clawback.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_create.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_create.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_update.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_update.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_delete.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_delete.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_call_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_call_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_create_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_create_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_update_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_update_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_delete_method_call.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_delete_method_call.restype = None +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_defaultcomposerfactory_new.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_defaultcomposerfactory_new.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_structfield_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_structfield_new.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_testfixture_new.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_testfixture_new.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_create_test_asset.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_create_test_asset.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_dispenser_account.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_dispenser_account.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_fund_account.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_fund_account.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_generate_account.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_generate_account.restype = _UniffiRustBuffer +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsigner_sign_transactions.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsigner_sign_transactions.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsigner_sign_transaction.argtypes = ( + ctypes.c_uint64, + algokit_transact._UniffiRustBuffer, +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsigner_sign_transaction.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsignergetter_get_signer.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsignergetter_get_signer.restype = ctypes.c_uint64 +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsignergetter_register_account.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsignergetter_register_account.restype = None +_UniffiLib.ffi_algokit_utils_ffi_uniffi_contract_version.argtypes = ( +) +_UniffiLib.ffi_algokit_utils_ffi_uniffi_contract_version.restype = ctypes.c_uint32 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_func_run_asset_freeze_test_suite.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_func_run_asset_freeze_test_suite.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_address.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_bytes.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_string.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_string.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_uint64.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_avm_uint64.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_bool.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_bool.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_byte.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_byte.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_dynamic_array.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_dynamic_array.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_from_string.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_from_string.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_static_array.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_static_array.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_string.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_string.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_struct_fields.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_struct_fields.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_tuple.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_tuple.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_ufixed.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_ufixed.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_uint.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abitype_uint.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abitype_decode.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abitype_decode.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abitype_encode.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abitype_encode.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abitype_to_string.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abitype_to_string.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_address.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_array.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_array.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_biguint.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_biguint.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_bool.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_bool.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_byte.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_byte.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_bytes.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_string.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_string.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_struct_fields.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_struct_fields.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_uint.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_abivalue_uint.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_address.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_array.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_array.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_big_uint.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_big_uint.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_bool.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_bool.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_byte.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_byte.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_bytes.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_string.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_string.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_struct_fields.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_struct_fields.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_uint.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_abivalue_get_uint.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_composer_new.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_composer_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_call_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_call_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_create.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_create.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_create_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_create_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_delete.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_delete.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_delete_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_delete_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_update.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_update.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_update_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_app_update_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_clawback.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_clawback.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_config.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_config.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_create.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_create.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_destroy.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_destroy.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_freeze.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_freeze.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_opt_in.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_opt_in.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_opt_out.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_opt_out.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_transfer.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_transfer.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_unfreeze.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_asset_unfreeze.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_payment.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_add_payment.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_build.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_build.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_send.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_send.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_wait_for_confirmation.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composer_wait_for_confirmation.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composerfactory_create_composer.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composerfactory_create_composer.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_build.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_build.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_send.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_send.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_wait_for_confirmation.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_wait_for_confirmation.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_payment.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_payment.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_create.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_create.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_config.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_config.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_destroy.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_destroy.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_freeze.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_freeze.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_unfreeze.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_unfreeze.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_transfer.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_transfer.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_opt_in.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_opt_in.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_opt_out.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_opt_out.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_clawback.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_asset_clawback.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_create.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_create.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_update.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_update.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_delete.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_delete.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_call_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_call_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_create_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_create_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_update_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_update_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_delete_method_call.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_composertrait_add_app_delete_method_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_defaultcomposerfactory_new.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_defaultcomposerfactory_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_structfield_new.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_structfield_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_testfixture_new.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_constructor_testfixture_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_create_test_asset.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_create_test_asset.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_dispenser_account.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_dispenser_account.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_fund_account.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_fund_account.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_generate_account.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_testfixture_generate_account.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsigner_sign_transactions.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsigner_sign_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsigner_sign_transaction.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsigner_sign_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsignergetter_get_signer.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsignergetter_get_signer.restype = ctypes.c_uint16 +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsignergetter_register_account.argtypes = ( +) +_UniffiLib.uniffi_algokit_utils_ffi_checksum_method_transactionsignergetter_register_account.restype = ctypes.c_uint16 + +_uniffi_check_contract_api_version(_UniffiLib) +# _uniffi_check_api_checksums(_UniffiLib) + +# RustFuturePoll values +_UNIFFI_RUST_FUTURE_POLL_READY = 0 +_UNIFFI_RUST_FUTURE_POLL_WAKE = 1 + +# Stores futures for _uniffi_continuation_callback +_UniffiContinuationHandleMap = _UniffiHandleMap() + +_UNIFFI_GLOBAL_EVENT_LOOP = None + +""" +Set the event loop to use for async functions + +This is needed if some async functions run outside of the eventloop, for example: + - A non-eventloop thread is spawned, maybe from `EventLoop.run_in_executor` or maybe from the + Rust code spawning its own thread. + - The Rust code calls an async callback method from a sync callback function, using something + like `pollster` to block on the async call. + +In this case, we need an event loop to run the Python async function, but there's no eventloop set +for the thread. Use `uniffi_set_event_loop` to force an eventloop to be used in this case. +""" +def uniffi_set_event_loop(eventloop: asyncio.BaseEventLoop): + global _UNIFFI_GLOBAL_EVENT_LOOP + _UNIFFI_GLOBAL_EVENT_LOOP = eventloop + +def _uniffi_get_event_loop(): + if _UNIFFI_GLOBAL_EVENT_LOOP is not None: + return _UNIFFI_GLOBAL_EVENT_LOOP + else: + return asyncio.get_running_loop() + +# Continuation callback for async functions +# lift the return value or error and resolve the future, causing the async function to resume. +@_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK +def _uniffi_continuation_callback(future_ptr, poll_code): + (eventloop, future) = _UniffiContinuationHandleMap.remove(future_ptr) + eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code) + +def _uniffi_set_future_result(future, poll_code): + if not future.cancelled(): + future.set_result(poll_code) + +async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter): + try: + eventloop = _uniffi_get_event_loop() + + # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value + while True: + future = eventloop.create_future() + ffi_poll( + rust_future, + _uniffi_continuation_callback, + _UniffiContinuationHandleMap.insert((eventloop, future)), + ) + poll_code = await future + if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY: + break + + return lift_func( + _uniffi_rust_call_with_error(error_ffi_converter, ffi_complete, rust_future) + ) + finally: + ffi_free(rust_future) +def _uniffi_trait_interface_call_async(make_call, uniffi_out_dropped_callback, handle_success, handle_error): + async def make_call_and_call_callback(): + try: + handle_success(await make_call()) + except Exception as e: + print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + handle_error( + _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR, + _UniffiFfiConverterString.lower(repr(e)), + ) + eventloop = _uniffi_get_event_loop() + task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop) + handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task)) + uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback) + +def _uniffi_trait_interface_call_async_with_error(make_call, uniffi_out_dropped_callback, handle_success, handle_error, error_type, lower_error): + async def make_call_and_call_callback(): + try: + try: + handle_success(await make_call()) + except error_type as e: + handle_error( + _UniffiRustCallStatus.CALL_ERROR, + lower_error(e), + ) + except Exception as e: + print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + handle_error( + _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR, + _UniffiFfiConverterString.lower(repr(e)), + ) + eventloop = _uniffi_get_event_loop() + task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop) + handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task)) + uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback) + +_UNIFFI_FOREIGN_FUTURE_HANDLE_MAP = _UniffiHandleMap() + +@_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK +def _uniffi_future_dropped_callback(handle): + (eventloop, task) = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.remove(handle) + eventloop.call_soon(_uniffi_cancel_task, task) + +def _uniffi_cancel_task(task): + if not task.done(): + task.cancel() + +# Public interface members begin here. + + +class _UniffiFfiConverterString: + @staticmethod + def check_lower(value): + if not isinstance(value, str): + raise TypeError("argument must be str, not {}".format(type(value).__name__)) + return value + + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative string length") + utf8_bytes = buf.read(size) + return utf8_bytes.decode("utf-8") + + @staticmethod + def write(value, buf): + utf8_bytes = value.encode("utf-8") + buf.write_i32(len(utf8_bytes)) + buf.write(utf8_bytes) + + @staticmethod + def lift(buf): + with buf.consume_with_stream() as stream: + return stream.read(stream.remaining()).decode("utf-8") + + @staticmethod + def lower(value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + builder.write(value.encode("utf-8")) + return builder.finalize() + +class _UniffiFfiConverterBytes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative byte string length") + return buf.read(size) + + @staticmethod + def check_lower(value): + try: + memoryview(value) + except TypeError: + raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) + + @staticmethod + def write(value, buf): + buf.write_i32(len(value)) + buf.write(value) + + + +# UtilsError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class UtilsError(Exception): + pass + +_UniffiTempUtilsError = UtilsError + +class UtilsError: # type: ignore + + class UtilsError(_UniffiTempUtilsError): + + def __init__(self, message): + super().__init__(", ".join([ + "message={!r}".format(message), + ])) + self.message = message + + def __repr__(self): + return "UtilsError.UtilsError({})".format(str(self)) + _UniffiTempUtilsError.UtilsError = UtilsError # type: ignore + +UtilsError = _UniffiTempUtilsError # type: ignore +del _UniffiTempUtilsError + + +class _UniffiFfiConverterTypeUtilsError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return UtilsError.UtilsError( + _UniffiFfiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, UtilsError.UtilsError): + _UniffiFfiConverterString.check_lower(value.message) + return + + @staticmethod + def write(value, buf): + if isinstance(value, UtilsError.UtilsError): + buf.write_i32(1) + _UniffiFfiConverterString.write(value.message, buf) + +class _UniffiFfiConverterSequenceTypeABIValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeABIValue.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeABIValue.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeABIValue.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterBoolean: + @classmethod + def check_lower(cls, value): + return not not value + + @classmethod + def lower(cls, value): + return 1 if value else 0 + + @staticmethod + def lift(value): + return value != 0 + + @classmethod + def read(cls, buf): + return cls.lift(buf.read_u8()) + + @classmethod + def write(cls, value, buf): + buf.write_u8(value) + +class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u8" + VALUE_MIN = 0 + VALUE_MAX = 2**8 + + @staticmethod + def read(buf): + return buf.read_u8() + + @staticmethod + def write(value, buf): + buf.write_u8(value) + +class _UniffiFfiConverterMapStringTypeABIValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiFfiConverterString.check_lower(key) + _UniffiFfiConverterTypeABIValue.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiFfiConverterString.write(key, buf) + _UniffiFfiConverterTypeABIValue.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiFfiConverterString.read(buf) + val = _UniffiFfiConverterTypeABIValue.read(buf) + d[key] = val + return d + +class _UniffiFfiConverterUInt64(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u64" + VALUE_MIN = 0 + VALUE_MAX = 2**64 + + @staticmethod + def read(buf): + return buf.read_u64() + + @staticmethod + def write(value, buf): + buf.write_u64(value) + + +class AbiValueProtocol(typing.Protocol): + + def get_address(self, ) -> str: + raise NotImplementedError + def get_array(self, ) -> typing.List[AbiValue]: + raise NotImplementedError + def get_big_uint(self, ) -> bytes: + raise NotImplementedError + def get_bool(self, ) -> bool: + raise NotImplementedError + def get_byte(self, ) -> int: + raise NotImplementedError + def get_bytes(self, ) -> bytes: + raise NotImplementedError + def get_string(self, ) -> str: + raise NotImplementedError + def get_struct_fields(self, ) -> dict[str, AbiValue]: + raise NotImplementedError + def get_uint(self, ) -> int: + raise NotImplementedError + +class AbiValue(AbiValueProtocol): + + _handle: ctypes.c_uint64 + @classmethod + def address(cls, value: str) -> AbiValue: + + _UniffiFfiConverterString.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterString.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_address, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def array(cls, values: typing.List[AbiValue]) -> AbiValue: + + _UniffiFfiConverterSequenceTypeABIValue.check_lower(values) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceTypeABIValue.lower(values), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_array, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def biguint(cls, value: bytes) -> AbiValue: + + _UniffiFfiConverterBytes.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterBytes.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_biguint, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def bool(cls, value: bool) -> AbiValue: + + _UniffiFfiConverterBoolean.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterBoolean.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_bool, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def byte(cls, value: int) -> AbiValue: + + _UniffiFfiConverterUInt8.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterUInt8.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_byte, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def bytes(cls, value: bytes) -> AbiValue: + + _UniffiFfiConverterBytes.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterBytes.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_bytes, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def string(cls, value: str) -> AbiValue: + + _UniffiFfiConverterString.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterString.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_string, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def struct_fields(cls, fields: dict[str, AbiValue]) -> AbiValue: + + _UniffiFfiConverterMapStringTypeABIValue.check_lower(fields) + _uniffi_lowered_args = ( + _UniffiFfiConverterMapStringTypeABIValue.lower(fields), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_struct_fields, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def uint(cls, value: int) -> AbiValue: + + _UniffiFfiConverterUInt64.check_lower(value) + _uniffi_lowered_args = ( + _UniffiFfiConverterUInt64.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abivalue_uint, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abivalue, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abivalue, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + def get_address(self, ) -> str: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_address, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_array(self, ) -> typing.List[AbiValue]: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeABIValue.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_array, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_big_uint(self, ) -> bytes: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_big_uint, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_bool(self, ) -> bool: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterBoolean.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_bool, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_byte(self, ) -> int: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterUInt8.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_byte, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_bytes(self, ) -> bytes: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_bytes, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_string(self, ) -> str: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_string, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_struct_fields(self, ) -> dict[str, AbiValue]: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterMapStringTypeABIValue.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_struct_fields, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def get_uint(self, ) -> int: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterUInt64.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_get_uint, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + # The Rust `Eq::eq` implementation. + def __eq__(self, other: object) -> bool: + if not isinstance(other, AbiValue): + return NotImplemented + + + _UniffiFfiConverterTypeABIValue.check_lower(other) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeABIValue.lower(other), + ) + _uniffi_lift_return = _UniffiFfiConverterBoolean.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_uniffi_trait_eq_eq, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + # The Rust `Eq::ne` implementation. + def __ne__(self, other: object) -> bool: + if not isinstance(other, AbiValue): + return NotImplemented + + _UniffiFfiConverterTypeABIValue.check_lower(other) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeABIValue.lower(other), + ) + _uniffi_lift_return = _UniffiFfiConverterBoolean.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abivalue_uniffi_trait_eq_ne, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + +class _UniffiFfiConverterTypeABIValue: + @staticmethod + def lift(value: int) -> AbiValue: + return AbiValue._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: AbiValue): + if not isinstance(value, AbiValue): + raise TypeError("Expected AbiValue instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: AbiValue) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> AbiValue: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: AbiValue, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class AbiTypeProtocol(typing.Protocol): + + def decode(self, data: bytes) -> AbiValue: + raise NotImplementedError + def encode(self, value: AbiValue) -> bytes: + raise NotImplementedError + def to_string(self, ) -> str: + raise NotImplementedError + +class AbiType(AbiTypeProtocol): + + _handle: ctypes.c_uint64 + @classmethod + def address(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_address, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def avm_bytes(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_bytes, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def avm_string(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_string, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def avm_uint64(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_avm_uint64, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def bool(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_bool, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def byte(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_byte, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def dynamic_array(cls, element_type: AbiType) -> AbiType: + + _UniffiFfiConverterTypeABIType.check_lower(element_type) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeABIType.lower(element_type), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_dynamic_array, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def from_string(cls, type_str: str) -> AbiType: + + _UniffiFfiConverterString.check_lower(type_str) + _uniffi_lowered_args = ( + _UniffiFfiConverterString.lower(type_str), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_from_string, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def static_array(cls, element_type: AbiType,length: int) -> AbiType: + + _UniffiFfiConverterTypeABIType.check_lower(element_type) + + _UniffiFfiConverterUInt16.check_lower(length) + _uniffi_lowered_args = ( + _UniffiFfiConverterTypeABIType.lower(element_type), + _UniffiFfiConverterUInt16.lower(length), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_static_array, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def string(cls, ) -> AbiType: + _uniffi_lowered_args = ( + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_string, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def struct_fields(cls, name: str,fields: typing.List[StructField]) -> AbiType: + + _UniffiFfiConverterString.check_lower(name) + + _UniffiFfiConverterSequenceTypeStructField.check_lower(fields) + _uniffi_lowered_args = ( + _UniffiFfiConverterString.lower(name), + _UniffiFfiConverterSequenceTypeStructField.lower(fields), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_struct_fields, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def tuple(cls, elements: typing.List[AbiType]) -> AbiType: + + _UniffiFfiConverterSequenceTypeABIType.check_lower(elements) + _uniffi_lowered_args = ( + _UniffiFfiConverterSequenceTypeABIType.lower(elements), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_tuple, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def ufixed(cls, bit_size: int,precision: int) -> AbiType: + + _UniffiFfiConverterUInt16.check_lower(bit_size) + + _UniffiFfiConverterUInt8.check_lower(precision) + _uniffi_lowered_args = ( + _UniffiFfiConverterUInt16.lower(bit_size), + _UniffiFfiConverterUInt8.lower(precision), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_ufixed, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + @classmethod + def uint(cls, bit_size: int) -> AbiType: + + _UniffiFfiConverterUInt16.check_lower(bit_size) + _uniffi_lowered_args = ( + _UniffiFfiConverterUInt16.lower(bit_size), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIType.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_abitype_uint, + *_uniffi_lowered_args, + ) + return cls._uniffi_make_instance(_uniffi_ffi_result) + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abitype, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abitype, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + def decode(self, data: bytes) -> AbiValue: + + _UniffiFfiConverterBytes.check_lower(data) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterBytes.lower(data), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeABIValue.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_decode, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def encode(self, value: AbiValue) -> bytes: + + _UniffiFfiConverterTypeABIValue.check_lower(value) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeABIValue.lower(value), + ) + _uniffi_lift_return = _UniffiFfiConverterBytes.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_encode, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def to_string(self, ) -> str: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_abitype_to_string, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + + + +class _UniffiFfiConverterTypeABIType: + @staticmethod + def lift(value: int) -> AbiType: + return AbiType._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: AbiType): + if not isinstance(value, AbiType): + raise TypeError("Expected AbiType instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: AbiType) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> AbiType: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: AbiType, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + + + + +class AbiTransactionType(enum.Enum): + + TXN = 0 + """ + Any transaction type +""" + + PAYMENT = 1 + """ + Payment (algo transfer) +""" + + KEY_REGISTRATION = 2 + """ + Key registration (configure consensus participation) +""" + + ASSET_CONFIG = 3 + """ + Asset configuration (create, configure, or destroy ASAs) +""" + + ASSET_TRANSFER = 4 + """ + Asset transfer (ASA transfer) +""" + + ASSET_FREEZE = 5 + """ + Asset freeze (freeze or unfreeze ASAs) +""" + + APP_CALL = 6 + """ + App call (create, update, delete and call an app) +""" + + + +class _UniffiFfiConverterTypeABITransactionType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AbiTransactionType.TXN + if variant == 2: + return AbiTransactionType.PAYMENT + if variant == 3: + return AbiTransactionType.KEY_REGISTRATION + if variant == 4: + return AbiTransactionType.ASSET_CONFIG + if variant == 5: + return AbiTransactionType.ASSET_TRANSFER + if variant == 6: + return AbiTransactionType.ASSET_FREEZE + if variant == 7: + return AbiTransactionType.APP_CALL + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == AbiTransactionType.TXN: + return + if value == AbiTransactionType.PAYMENT: + return + if value == AbiTransactionType.KEY_REGISTRATION: + return + if value == AbiTransactionType.ASSET_CONFIG: + return + if value == AbiTransactionType.ASSET_TRANSFER: + return + if value == AbiTransactionType.ASSET_FREEZE: + return + if value == AbiTransactionType.APP_CALL: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == AbiTransactionType.TXN: + buf.write_i32(1) + if value == AbiTransactionType.PAYMENT: + buf.write_i32(2) + if value == AbiTransactionType.KEY_REGISTRATION: + buf.write_i32(3) + if value == AbiTransactionType.ASSET_CONFIG: + buf.write_i32(4) + if value == AbiTransactionType.ASSET_TRANSFER: + buf.write_i32(5) + if value == AbiTransactionType.ASSET_FREEZE: + buf.write_i32(6) + if value == AbiTransactionType.APP_CALL: + buf.write_i32(7) + + + + + + + + +class AbiReferenceType(enum.Enum): + + ACCOUNT = 0 + """ + Reference to an account in the Accounts reference array +""" + + APPLICATION = 1 + """ + Reference to an application in the Applications reference array +""" + + ASSET = 2 + """ + Reference to an asset in the Assets reference array +""" + + + +class _UniffiFfiConverterTypeABIReferenceType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AbiReferenceType.ACCOUNT + if variant == 2: + return AbiReferenceType.APPLICATION + if variant == 3: + return AbiReferenceType.ASSET + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == AbiReferenceType.ACCOUNT: + return + if value == AbiReferenceType.APPLICATION: + return + if value == AbiReferenceType.ASSET: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == AbiReferenceType.ACCOUNT: + buf.write_i32(1) + if value == AbiReferenceType.APPLICATION: + buf.write_i32(2) + if value == AbiReferenceType.ASSET: + buf.write_i32(3) + + + + + + + + +class AbiMethodArgType: + def __init__(self): + raise RuntimeError("AbiMethodArgType cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + @dataclass + class VALUE: + """ + A value that is directly encoded in the app arguments. +""" + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AbiMethodArgType.VALUE{self._values!r}" + def __eq__(self, other): + if not other.is_VALUE(): + return False + return self._values == other._values + + @dataclass + class TRANSACTION: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AbiMethodArgType.TRANSACTION{self._values!r}" + def __eq__(self, other): + if not other.is_TRANSACTION(): + return False + return self._values == other._values + + @dataclass + class REFERENCE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AbiMethodArgType.REFERENCE{self._values!r}" + def __eq__(self, other): + if not other.is_REFERENCE(): + return False + return self._values == other._values + + + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking + # whether an instance is that variant. + def is_VALUE(self) -> bool: + return isinstance(self, AbiMethodArgType.VALUE) + def is_value(self) -> bool: + return isinstance(self, AbiMethodArgType.VALUE) + def is_TRANSACTION(self) -> bool: + return isinstance(self, AbiMethodArgType.TRANSACTION) + def is_transaction(self) -> bool: + return isinstance(self, AbiMethodArgType.TRANSACTION) + def is_REFERENCE(self) -> bool: + return isinstance(self, AbiMethodArgType.REFERENCE) + def is_reference(self) -> bool: + return isinstance(self, AbiMethodArgType.REFERENCE) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +AbiMethodArgType.VALUE = type("AbiMethodArgType.VALUE", (AbiMethodArgType.VALUE, AbiMethodArgType,), {}) # type: ignore +AbiMethodArgType.TRANSACTION = type("AbiMethodArgType.TRANSACTION", (AbiMethodArgType.TRANSACTION, AbiMethodArgType,), {}) # type: ignore +AbiMethodArgType.REFERENCE = type("AbiMethodArgType.REFERENCE", (AbiMethodArgType.REFERENCE, AbiMethodArgType,), {}) # type: ignore + + + + +class _UniffiFfiConverterTypeABIMethodArgType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AbiMethodArgType.VALUE( + _UniffiFfiConverterTypeABIType.read(buf), + ) + if variant == 2: + return AbiMethodArgType.TRANSACTION( + _UniffiFfiConverterTypeABITransactionType.read(buf), + ) + if variant == 3: + return AbiMethodArgType.REFERENCE( + _UniffiFfiConverterTypeABIReferenceType.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_VALUE(): + _UniffiFfiConverterTypeABIType.check_lower(value._values[0]) + return + if value.is_TRANSACTION(): + _UniffiFfiConverterTypeABITransactionType.check_lower(value._values[0]) + return + if value.is_REFERENCE(): + _UniffiFfiConverterTypeABIReferenceType.check_lower(value._values[0]) + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value.is_VALUE(): + buf.write_i32(1) + _UniffiFfiConverterTypeABIType.write(value._values[0], buf) + if value.is_TRANSACTION(): + buf.write_i32(2) + _UniffiFfiConverterTypeABITransactionType.write(value._values[0], buf) + if value.is_REFERENCE(): + buf.write_i32(3) + _UniffiFfiConverterTypeABIReferenceType.write(value._values[0], buf) + + + +class _UniffiFfiConverterOptionalString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AbiMethodArg: + def __init__(self, *, arg_type:AbiMethodArgType, name:typing.Optional[str], description:typing.Optional[str]): + self.arg_type = arg_type + self.name = name + self.description = description + + + + + def __str__(self): + return "AbiMethodArg(arg_type={}, name={}, description={})".format(self.arg_type, self.name, self.description) + def __eq__(self, other): + if self.arg_type != other.arg_type: + return False + if self.name != other.name: + return False + if self.description != other.description: + return False + return True + +class _UniffiFfiConverterTypeABIMethodArg(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AbiMethodArg( + arg_type=_UniffiFfiConverterTypeABIMethodArgType.read(buf), + name=_UniffiFfiConverterOptionalString.read(buf), + description=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeABIMethodArgType.check_lower(value.arg_type) + _UniffiFfiConverterOptionalString.check_lower(value.name) + _UniffiFfiConverterOptionalString.check_lower(value.description) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeABIMethodArgType.write(value.arg_type, buf) + _UniffiFfiConverterOptionalString.write(value.name, buf) + _UniffiFfiConverterOptionalString.write(value.description, buf) + +class _UniffiFfiConverterSequenceTypeABIMethodArg(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeABIMethodArg.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeABIMethodArg.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeABIMethodArg.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalTypeABIType(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeABIType.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeABIType.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeABIType.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AbiMethod: + def __init__(self, *, name:str, args:typing.List[AbiMethodArg], returns:typing.Optional[AbiType], description:typing.Optional[str]): + self.name = name + self.args = args + self.returns = returns + self.description = description + + + + + def __str__(self): + return "AbiMethod(name={}, args={}, returns={}, description={})".format(self.name, self.args, self.returns, self.description) + def __eq__(self, other): + if self.name != other.name: + return False + if self.args != other.args: + return False + if self.returns != other.returns: + return False + if self.description != other.description: + return False + return True + +class _UniffiFfiConverterTypeABIMethod(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AbiMethod( + name=_UniffiFfiConverterString.read(buf), + args=_UniffiFfiConverterSequenceTypeABIMethodArg.read(buf), + returns=_UniffiFfiConverterOptionalTypeABIType.read(buf), + description=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.name) + _UniffiFfiConverterSequenceTypeABIMethodArg.check_lower(value.args) + _UniffiFfiConverterOptionalTypeABIType.check_lower(value.returns) + _UniffiFfiConverterOptionalString.check_lower(value.description) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.name, buf) + _UniffiFfiConverterSequenceTypeABIMethodArg.write(value.args, buf) + _UniffiFfiConverterOptionalTypeABIType.write(value.returns, buf) + _UniffiFfiConverterOptionalString.write(value.description, buf) + +class _UniffiFfiConverterOptionalTypeABIValue(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeABIValue.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeABIValue.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeABIValue.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalTypeUtilsError(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeUtilsError.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeUtilsError.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeUtilsError.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AbiReturn: + def __init__(self, *, method:AbiMethod, raw_return_value:bytes, return_value:typing.Optional[AbiValue], decode_error:typing.Optional[UtilsError]): + self.method = method + self.raw_return_value = raw_return_value + self.return_value = return_value + self.decode_error = decode_error + + + + + def __str__(self): + return "AbiReturn(method={}, raw_return_value={}, return_value={}, decode_error={})".format(self.method, self.raw_return_value, self.return_value, self.decode_error) + def __eq__(self, other): + if self.method != other.method: + return False + if self.raw_return_value != other.raw_return_value: + return False + if self.return_value != other.return_value: + return False + if self.decode_error != other.decode_error: + return False + return True + +class _UniffiFfiConverterTypeABIReturn(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AbiReturn( + method=_UniffiFfiConverterTypeABIMethod.read(buf), + raw_return_value=_UniffiFfiConverterBytes.read(buf), + return_value=_UniffiFfiConverterOptionalTypeABIValue.read(buf), + decode_error=_UniffiFfiConverterOptionalTypeUtilsError.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterTypeABIMethod.check_lower(value.method) + _UniffiFfiConverterBytes.check_lower(value.raw_return_value) + _UniffiFfiConverterOptionalTypeABIValue.check_lower(value.return_value) + _UniffiFfiConverterOptionalTypeUtilsError.check_lower(value.decode_error) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterTypeABIMethod.write(value.method, buf) + _UniffiFfiConverterBytes.write(value.raw_return_value, buf) + _UniffiFfiConverterOptionalTypeABIValue.write(value.return_value, buf) + _UniffiFfiConverterOptionalTypeUtilsError.write(value.decode_error, buf) + + + +class _UniffiFfiConverterSequenceTypeTransaction(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + algokit_transact._UniffiFfiConverterTypeTransaction.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + algokit_transact._UniffiFfiConverterTypeTransaction.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + algokit_transact._UniffiFfiConverterTypeTransaction.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterUInt32(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u32" + VALUE_MIN = 0 + VALUE_MAX = 2**32 + + @staticmethod + def read(buf): + return buf.read_u32() + + @staticmethod + def write(value, buf): + buf.write_u32(value) + +class _UniffiFfiConverterSequenceUInt32(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterUInt32.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterUInt32.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterUInt32.read(buf) for i in range(count) + ] + + + +class _UniffiFfiConverterSequenceTypeSignedTransaction(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + algokit_transact._UniffiFfiConverterTypeSignedTransaction.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + algokit_transact._UniffiFfiConverterTypeSignedTransaction.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + algokit_transact._UniffiFfiConverterTypeSignedTransaction.read(buf) for i in range(count) + ] + + +class TransactionSigner(): + + async def sign_transactions(self, transactions: typing.List[algokit_transact.Transaction],indices: typing.List[int]) -> typing.List[algokit_transact.SignedTransaction]: + raise NotImplementedError + async def sign_transaction(self, transaction: algokit_transact.Transaction) -> algokit_transact.SignedTransaction: + raise NotImplementedError + +class TransactionSignerImpl(TransactionSigner): + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_transactionsigner, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_transactionsigner, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + async def sign_transactions(self, transactions: typing.List[algokit_transact.Transaction],indices: typing.List[int]) -> typing.List[algokit_transact.SignedTransaction]: + + _UniffiFfiConverterSequenceTypeTransaction.check_lower(transactions) + + _UniffiFfiConverterSequenceUInt32.check_lower(indices) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterSequenceTypeTransaction.lower(transactions), + _UniffiFfiConverterSequenceUInt32.lower(indices), + ) + _uniffi_lift_return = _UniffiFfiConverterSequenceTypeSignedTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsigner_sign_transactions(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def sign_transaction(self, transaction: algokit_transact.Transaction) -> algokit_transact.SignedTransaction: + + algokit_transact._UniffiFfiConverterTypeTransaction.check_lower(transaction) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + algokit_transact._UniffiFfiConverterTypeTransaction.lower(transaction), + ) + _uniffi_lift_return = algokit_transact._UniffiFfiConverterTypeSignedTransaction.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsigner_sign_transaction(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + + + + +# Put all the bits inside a class to keep the top-level namespace clean +class _UniffiTraitImplTransactionSignerImpl: + # For each method, generate a callback function to pass to Rust + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_METHOD0 + def sign_transactions( + uniffi_handle, + transactions, + indices, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeTransactionSigner._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterSequenceTypeTransaction.lift(transactions), _UniffiFfiConverterSequenceUInt32.lift(indices), ) + uniffi_method = uniffi_obj.sign_transactions + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterSequenceTypeSignedTransaction.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_METHOD1 + def sign_transaction( + uniffi_handle, + transaction, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeTransactionSigner._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (algokit_transact._UniffiFfiConverterTypeTransaction.lift(transaction), ) + uniffi_method = uniffi_obj.sign_transaction + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultalgokitTransactFfiRustBuffer( + algokit_transact._UniffiFfiConverterTypeSignedTransaction.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultalgokitTransactFfiRustBuffer( + algokit_transact._UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER + def _uniffi_free(uniffi_handle): + _UniffiFfiConverterTypeTransactionSigner._handle_map.remove(uniffi_handle) + + @_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER + def _uniffi_clone(uniffi_handle): + return _UniffiFfiConverterTypeTransactionSigner._handle_map.clone(uniffi_handle) + + # Generate the FFI VTable. This has a field for each callback interface method. + _uniffi_vtable = _UniffiVTableCallbackInterfaceAlgokitUtilsFfiTransactionSigner( + _uniffi_free, + _uniffi_clone, + sign_transactions, + sign_transaction, + ) + # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever, + # or else bad things will happen when Rust tries to access it. + _UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_transactionsigner(ctypes.byref(_uniffi_vtable)) + +class _UniffiFfiConverterTypeTransactionSigner: + _handle_map = _UniffiHandleMap() + + @staticmethod + def lift(value: int): + if (value & 1) == 0: + # Rust-generated handle, construct a new class that uses the handle to implement the + # interface + return TransactionSignerImpl._uniffi_make_instance(value) + else: + # Python-generated handle, get the object from the handle map + return _UniffiFfiConverterTypeTransactionSigner._handle_map.remove(value) + + @staticmethod + def check_lower(value: TransactionSigner): + if not isinstance(value, TransactionSigner): + raise TypeError("Expected TransactionSigner subclass, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionSigner): + if isinstance(value, TransactionSignerImpl): + # Rust-implementated object. Clone the handle and return it + return value._uniffi_clone_handle() + else: + # Python-implementated object, generate a new vtable handle and return that. + return _UniffiFfiConverterTypeTransactionSigner._handle_map.insert(value) + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TransactionSigner, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + +class _UniffiFfiConverterOptionalTypeTransactionSigner(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeTransactionSigner.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeTransactionSigner.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeTransactionSigner.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalUInt32(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterUInt32.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterUInt32.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterUInt32.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AccountCloseParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, close_remainder_to:str): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.close_remainder_to = close_remainder_to + + + + + def __str__(self): + return "AccountCloseParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, close_remainder_to={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.close_remainder_to) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.close_remainder_to != other.close_remainder_to: + return False + return True + +class _UniffiFfiConverterTypeAccountCloseParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountCloseParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + close_remainder_to=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterString.check_lower(value.close_remainder_to) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterString.write(value.close_remainder_to, buf) + +class _UniffiFfiConverterSequenceUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterUInt64.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterUInt64.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterUInt64.read(buf) for i in range(count) + ] + +@dataclass +class AccountInfo: + def __init__(self, *, balance:int, min_balance:int, created_apps:typing.List[int], created_assets:typing.List[int]): + self.balance = balance + self.min_balance = min_balance + self.created_apps = created_apps + self.created_assets = created_assets + + + + + def __str__(self): + return "AccountInfo(balance={}, min_balance={}, created_apps={}, created_assets={})".format(self.balance, self.min_balance, self.created_apps, self.created_assets) + def __eq__(self, other): + if self.balance != other.balance: + return False + if self.min_balance != other.min_balance: + return False + if self.created_apps != other.created_apps: + return False + if self.created_assets != other.created_assets: + return False + return True + +class _UniffiFfiConverterTypeAccountInfo(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AccountInfo( + balance=_UniffiFfiConverterUInt64.read(buf), + min_balance=_UniffiFfiConverterUInt64.read(buf), + created_apps=_UniffiFfiConverterSequenceUInt64.read(buf), + created_assets=_UniffiFfiConverterSequenceUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.balance) + _UniffiFfiConverterUInt64.check_lower(value.min_balance) + _UniffiFfiConverterSequenceUInt64.check_lower(value.created_apps) + _UniffiFfiConverterSequenceUInt64.check_lower(value.created_assets) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.balance, buf) + _UniffiFfiConverterUInt64.write(value.min_balance, buf) + _UniffiFfiConverterSequenceUInt64.write(value.created_apps, buf) + _UniffiFfiConverterSequenceUInt64.write(value.created_assets, buf) + + + + + + +class AbiReferenceValue: + def __init__(self): + raise RuntimeError("AbiReferenceValue cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + @dataclass + class ACCOUNT: + """ + The address to an Algorand account. +""" + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AbiReferenceValue.ACCOUNT{self._values!r}" + def __eq__(self, other): + if not other.is_ACCOUNT(): + return False + return self._values == other._values + + @dataclass + class ASSET: + """ + An Algorand asset ID. +""" + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AbiReferenceValue.ASSET{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET(): + return False + return self._values == other._values + + @dataclass + class APPLICATION: + """ + An Algorand app ID. +""" + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AbiReferenceValue.APPLICATION{self._values!r}" + def __eq__(self, other): + if not other.is_APPLICATION(): + return False + return self._values == other._values + + + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking + # whether an instance is that variant. + def is_ACCOUNT(self) -> bool: + return isinstance(self, AbiReferenceValue.ACCOUNT) + def is_account(self) -> bool: + return isinstance(self, AbiReferenceValue.ACCOUNT) + def is_ASSET(self) -> bool: + return isinstance(self, AbiReferenceValue.ASSET) + def is_asset(self) -> bool: + return isinstance(self, AbiReferenceValue.ASSET) + def is_APPLICATION(self) -> bool: + return isinstance(self, AbiReferenceValue.APPLICATION) + def is_application(self) -> bool: + return isinstance(self, AbiReferenceValue.APPLICATION) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +AbiReferenceValue.ACCOUNT = type("AbiReferenceValue.ACCOUNT", (AbiReferenceValue.ACCOUNT, AbiReferenceValue,), {}) # type: ignore +AbiReferenceValue.ASSET = type("AbiReferenceValue.ASSET", (AbiReferenceValue.ASSET, AbiReferenceValue,), {}) # type: ignore +AbiReferenceValue.APPLICATION = type("AbiReferenceValue.APPLICATION", (AbiReferenceValue.APPLICATION, AbiReferenceValue,), {}) # type: ignore + + + + +class _UniffiFfiConverterTypeABIReferenceValue(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AbiReferenceValue.ACCOUNT( + _UniffiFfiConverterString.read(buf), + ) + if variant == 2: + return AbiReferenceValue.ASSET( + _UniffiFfiConverterUInt64.read(buf), + ) + if variant == 3: + return AbiReferenceValue.APPLICATION( + _UniffiFfiConverterUInt64.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_ACCOUNT(): + _UniffiFfiConverterString.check_lower(value._values[0]) + return + if value.is_ASSET(): + _UniffiFfiConverterUInt64.check_lower(value._values[0]) + return + if value.is_APPLICATION(): + _UniffiFfiConverterUInt64.check_lower(value._values[0]) + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value.is_ACCOUNT(): + buf.write_i32(1) + _UniffiFfiConverterString.write(value._values[0], buf) + if value.is_ASSET(): + buf.write_i32(2) + _UniffiFfiConverterUInt64.write(value._values[0], buf) + if value.is_APPLICATION(): + buf.write_i32(3) + _UniffiFfiConverterUInt64.write(value._values[0], buf) + + + + + + + +class _UniffiFfiConverterOptionalTypeStateSchema(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + algokit_transact._UniffiFfiConverterTypeStateSchema.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + algokit_transact._UniffiFfiConverterTypeStateSchema.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return algokit_transact._UniffiFfiConverterTypeStateSchema.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterBytes.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterBytes.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterBytes.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceBytes.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceBytes.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceBytes.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterString.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterString.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterString.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +class _UniffiFfiConverterOptionalSequenceUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiFfiConverterSequenceTypeBoxReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + algokit_transact._UniffiFfiConverterTypeBoxReference.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + algokit_transact._UniffiFfiConverterTypeBoxReference.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + algokit_transact._UniffiFfiConverterTypeBoxReference.read(buf) for i in range(count) + ] + +class _UniffiFfiConverterOptionalSequenceTypeBoxReference(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterSequenceTypeBoxReference.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterSequenceTypeBoxReference.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterSequenceTypeBoxReference.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AppCreateParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, on_complete:algokit_transact.OnApplicationComplete, approval_program:bytes, clear_state_program:bytes, global_state_schema:typing.Optional[algokit_transact.StateSchema] = _DEFAULT, local_state_schema:typing.Optional[algokit_transact.StateSchema] = _DEFAULT, extra_program_pages:typing.Optional[int] = _DEFAULT, args:typing.Optional[typing.List[bytes]] = _DEFAULT, account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.on_complete = on_complete + self.approval_program = approval_program + self.clear_state_program = clear_state_program + if global_state_schema is _DEFAULT: + self.global_state_schema = None + else: + self.global_state_schema = global_state_schema + if local_state_schema is _DEFAULT: + self.local_state_schema = None + else: + self.local_state_schema = local_state_schema + if extra_program_pages is _DEFAULT: + self.extra_program_pages = None + else: + self.extra_program_pages = extra_program_pages + if args is _DEFAULT: + self.args = None + else: + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppCreateParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, on_complete={}, approval_program={}, clear_state_program={}, global_state_schema={}, local_state_schema={}, extra_program_pages={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.on_complete, self.approval_program, self.clear_state_program, self.global_state_schema, self.local_state_schema, self.extra_program_pages, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.on_complete != other.on_complete: + return False + if self.approval_program != other.approval_program: + return False + if self.clear_state_program != other.clear_state_program: + return False + if self.global_state_schema != other.global_state_schema: + return False + if self.local_state_schema != other.local_state_schema: + return False + if self.extra_program_pages != other.extra_program_pages: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppCreateParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppCreateParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + on_complete=algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.read(buf), + approval_program=_UniffiFfiConverterBytes.read(buf), + clear_state_program=_UniffiFfiConverterBytes.read(buf), + global_state_schema=_UniffiFfiConverterOptionalTypeStateSchema.read(buf), + local_state_schema=_UniffiFfiConverterOptionalTypeStateSchema.read(buf), + extra_program_pages=_UniffiFfiConverterOptionalUInt64.read(buf), + args=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.check_lower(value.on_complete) + _UniffiFfiConverterBytes.check_lower(value.approval_program) + _UniffiFfiConverterBytes.check_lower(value.clear_state_program) + _UniffiFfiConverterOptionalTypeStateSchema.check_lower(value.global_state_schema) + _UniffiFfiConverterOptionalTypeStateSchema.check_lower(value.local_state_schema) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_program_pages) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.write(value.on_complete, buf) + _UniffiFfiConverterBytes.write(value.approval_program, buf) + _UniffiFfiConverterBytes.write(value.clear_state_program, buf) + _UniffiFfiConverterOptionalTypeStateSchema.write(value.global_state_schema, buf) + _UniffiFfiConverterOptionalTypeStateSchema.write(value.local_state_schema, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_program_pages, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class AppUpdateParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, app_id:int, approval_program:bytes, clear_state_program:bytes, args:typing.Optional[typing.List[bytes]] = _DEFAULT, account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.app_id = app_id + self.approval_program = approval_program + self.clear_state_program = clear_state_program + if args is _DEFAULT: + self.args = None + else: + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppUpdateParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, app_id={}, approval_program={}, clear_state_program={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.app_id, self.approval_program, self.clear_state_program, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.app_id != other.app_id: + return False + if self.approval_program != other.approval_program: + return False + if self.clear_state_program != other.clear_state_program: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppUpdateParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppUpdateParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + approval_program=_UniffiFfiConverterBytes.read(buf), + clear_state_program=_UniffiFfiConverterBytes.read(buf), + args=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterBytes.check_lower(value.approval_program) + _UniffiFfiConverterBytes.check_lower(value.clear_state_program) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterBytes.write(value.approval_program, buf) + _UniffiFfiConverterBytes.write(value.clear_state_program, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class AppDeleteParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, app_id:int, args:typing.Optional[typing.List[bytes]] = _DEFAULT, account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.app_id = app_id + if args is _DEFAULT: + self.args = None + else: + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppDeleteParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, app_id={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.app_id, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.app_id != other.app_id: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppDeleteParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppDeleteParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + args=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class AppCreateMethodCallParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, on_complete:algokit_transact.OnApplicationComplete, approval_program:bytes, clear_state_program:bytes, global_state_schema:typing.Optional[algokit_transact.StateSchema] = _DEFAULT, local_state_schema:typing.Optional[algokit_transact.StateSchema] = _DEFAULT, extra_program_pages:typing.Optional[int] = _DEFAULT, method:AbiMethod, args:typing.List[AppMethodCallArg], account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.on_complete = on_complete + self.approval_program = approval_program + self.clear_state_program = clear_state_program + if global_state_schema is _DEFAULT: + self.global_state_schema = None + else: + self.global_state_schema = global_state_schema + if local_state_schema is _DEFAULT: + self.local_state_schema = None + else: + self.local_state_schema = local_state_schema + if extra_program_pages is _DEFAULT: + self.extra_program_pages = None + else: + self.extra_program_pages = extra_program_pages + self.method = method + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppCreateMethodCallParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, on_complete={}, approval_program={}, clear_state_program={}, global_state_schema={}, local_state_schema={}, extra_program_pages={}, method={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.on_complete, self.approval_program, self.clear_state_program, self.global_state_schema, self.local_state_schema, self.extra_program_pages, self.method, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.on_complete != other.on_complete: + return False + if self.approval_program != other.approval_program: + return False + if self.clear_state_program != other.clear_state_program: + return False + if self.global_state_schema != other.global_state_schema: + return False + if self.local_state_schema != other.local_state_schema: + return False + if self.extra_program_pages != other.extra_program_pages: + return False + if self.method != other.method: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppCreateMethodCallParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppCreateMethodCallParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + on_complete=algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.read(buf), + approval_program=_UniffiFfiConverterBytes.read(buf), + clear_state_program=_UniffiFfiConverterBytes.read(buf), + global_state_schema=_UniffiFfiConverterOptionalTypeStateSchema.read(buf), + local_state_schema=_UniffiFfiConverterOptionalTypeStateSchema.read(buf), + extra_program_pages=_UniffiFfiConverterOptionalUInt64.read(buf), + method=_UniffiFfiConverterTypeABIMethod.read(buf), + args=_UniffiFfiConverterSequenceTypeAppMethodCallArg.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.check_lower(value.on_complete) + _UniffiFfiConverterBytes.check_lower(value.approval_program) + _UniffiFfiConverterBytes.check_lower(value.clear_state_program) + _UniffiFfiConverterOptionalTypeStateSchema.check_lower(value.global_state_schema) + _UniffiFfiConverterOptionalTypeStateSchema.check_lower(value.local_state_schema) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_program_pages) + _UniffiFfiConverterTypeABIMethod.check_lower(value.method) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.write(value.on_complete, buf) + _UniffiFfiConverterBytes.write(value.approval_program, buf) + _UniffiFfiConverterBytes.write(value.clear_state_program, buf) + _UniffiFfiConverterOptionalTypeStateSchema.write(value.global_state_schema, buf) + _UniffiFfiConverterOptionalTypeStateSchema.write(value.local_state_schema, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_program_pages, buf) + _UniffiFfiConverterTypeABIMethod.write(value.method, buf) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class AppUpdateMethodCallParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, app_id:int, approval_program:bytes, clear_state_program:bytes, method:AbiMethod, args:typing.List[AppMethodCallArg], account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.app_id = app_id + self.approval_program = approval_program + self.clear_state_program = clear_state_program + self.method = method + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppUpdateMethodCallParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, app_id={}, approval_program={}, clear_state_program={}, method={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.app_id, self.approval_program, self.clear_state_program, self.method, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.app_id != other.app_id: + return False + if self.approval_program != other.approval_program: + return False + if self.clear_state_program != other.clear_state_program: + return False + if self.method != other.method: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppUpdateMethodCallParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppUpdateMethodCallParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + approval_program=_UniffiFfiConverterBytes.read(buf), + clear_state_program=_UniffiFfiConverterBytes.read(buf), + method=_UniffiFfiConverterTypeABIMethod.read(buf), + args=_UniffiFfiConverterSequenceTypeAppMethodCallArg.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterBytes.check_lower(value.approval_program) + _UniffiFfiConverterBytes.check_lower(value.clear_state_program) + _UniffiFfiConverterTypeABIMethod.check_lower(value.method) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterBytes.write(value.approval_program, buf) + _UniffiFfiConverterBytes.write(value.clear_state_program, buf) + _UniffiFfiConverterTypeABIMethod.write(value.method, buf) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class AppDeleteMethodCallParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, app_id:int, method:AbiMethod, args:typing.List[AppMethodCallArg], account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.app_id = app_id + self.method = method + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppDeleteMethodCallParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, app_id={}, method={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.app_id, self.method, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.app_id != other.app_id: + return False + if self.method != other.method: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppDeleteMethodCallParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppDeleteMethodCallParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + method=_UniffiFfiConverterTypeABIMethod.read(buf), + args=_UniffiFfiConverterSequenceTypeAppMethodCallArg.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterTypeABIMethod.check_lower(value.method) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterTypeABIMethod.write(value.method, buf) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class TransactionWithSigner: + def __init__(self, *, transaction:algokit_transact.Transaction, signer:TransactionSigner): + self.transaction = transaction + self.signer = signer + + + + + def __str__(self): + return "TransactionWithSigner(transaction={}, signer={})".format(self.transaction, self.signer) + def __eq__(self, other): + if self.transaction != other.transaction: + return False + if self.signer != other.signer: + return False + return True + +class _UniffiFfiConverterTypeTransactionWithSigner(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionWithSigner( + transaction=algokit_transact._UniffiFfiConverterTypeTransaction.read(buf), + signer=_UniffiFfiConverterTypeTransactionSigner.read(buf), + ) + + @staticmethod + def check_lower(value): + algokit_transact._UniffiFfiConverterTypeTransaction.check_lower(value.transaction) + _UniffiFfiConverterTypeTransactionSigner.check_lower(value.signer) + + @staticmethod + def write(value, buf): + algokit_transact._UniffiFfiConverterTypeTransaction.write(value.transaction, buf) + _UniffiFfiConverterTypeTransactionSigner.write(value.signer, buf) + +@dataclass +class PaymentParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, receiver:str, amount:int): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.receiver = receiver + self.amount = amount + + + + + def __str__(self): + return "PaymentParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, receiver={}, amount={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.receiver, self.amount) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.receiver != other.receiver: + return False + if self.amount != other.amount: + return False + return True + +class _UniffiFfiConverterTypePaymentParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return PaymentParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + receiver=_UniffiFfiConverterString.read(buf), + amount=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterString.check_lower(value.receiver) + _UniffiFfiConverterUInt64.check_lower(value.amount) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterString.write(value.receiver, buf) + _UniffiFfiConverterUInt64.write(value.amount, buf) + +@dataclass +class AssetTransferParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int, amount:int, receiver:str): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + self.amount = amount + self.receiver = receiver + + + + + def __str__(self): + return "AssetTransferParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={}, amount={}, receiver={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id, self.amount, self.receiver) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + if self.amount != other.amount: + return False + if self.receiver != other.receiver: + return False + return True + +class _UniffiFfiConverterTypeAssetTransferParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetTransferParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + amount=_UniffiFfiConverterUInt64.read(buf), + receiver=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterUInt64.check_lower(value.amount) + _UniffiFfiConverterString.check_lower(value.receiver) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterUInt64.write(value.amount, buf) + _UniffiFfiConverterString.write(value.receiver, buf) + +@dataclass +class AssetOptInParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + + + + + def __str__(self): + return "AssetOptInParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + return True + +class _UniffiFfiConverterTypeAssetOptInParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetOptInParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + +@dataclass +class AssetOptOutParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int, close_remainder_to:typing.Optional[str] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + if close_remainder_to is _DEFAULT: + self.close_remainder_to = None + else: + self.close_remainder_to = close_remainder_to + + + + + def __str__(self): + return "AssetOptOutParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={}, close_remainder_to={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id, self.close_remainder_to) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + if self.close_remainder_to != other.close_remainder_to: + return False + return True + +class _UniffiFfiConverterTypeAssetOptOutParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetOptOutParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + close_remainder_to=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterOptionalString.check_lower(value.close_remainder_to) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterOptionalString.write(value.close_remainder_to, buf) + +@dataclass +class AssetClawbackParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int, amount:int, receiver:str, clawback_target:str): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + self.amount = amount + self.receiver = receiver + self.clawback_target = clawback_target + + + + + def __str__(self): + return "AssetClawbackParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={}, amount={}, receiver={}, clawback_target={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id, self.amount, self.receiver, self.clawback_target) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + if self.amount != other.amount: + return False + if self.receiver != other.receiver: + return False + if self.clawback_target != other.clawback_target: + return False + return True + +class _UniffiFfiConverterTypeAssetClawbackParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetClawbackParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + amount=_UniffiFfiConverterUInt64.read(buf), + receiver=_UniffiFfiConverterString.read(buf), + clawback_target=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterUInt64.check_lower(value.amount) + _UniffiFfiConverterString.check_lower(value.receiver) + _UniffiFfiConverterString.check_lower(value.clawback_target) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterUInt64.write(value.amount, buf) + _UniffiFfiConverterString.write(value.receiver, buf) + _UniffiFfiConverterString.write(value.clawback_target, buf) + +class _UniffiFfiConverterOptionalBoolean(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterBoolean.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterBoolean.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterBoolean.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class AssetCreateParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, total:int, decimals:typing.Optional[int] = _DEFAULT, default_frozen:typing.Optional[bool] = _DEFAULT, asset_name:typing.Optional[str] = _DEFAULT, unit_name:typing.Optional[str] = _DEFAULT, url:typing.Optional[str] = _DEFAULT, metadata_hash:typing.Optional[bytes] = _DEFAULT, manager:typing.Optional[str] = _DEFAULT, reserve:typing.Optional[str] = _DEFAULT, freeze:typing.Optional[str] = _DEFAULT, clawback:typing.Optional[str] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.total = total + if decimals is _DEFAULT: + self.decimals = None + else: + self.decimals = decimals + if default_frozen is _DEFAULT: + self.default_frozen = None + else: + self.default_frozen = default_frozen + if asset_name is _DEFAULT: + self.asset_name = None + else: + self.asset_name = asset_name + if unit_name is _DEFAULT: + self.unit_name = None + else: + self.unit_name = unit_name + if url is _DEFAULT: + self.url = None + else: + self.url = url + if metadata_hash is _DEFAULT: + self.metadata_hash = None + else: + self.metadata_hash = metadata_hash + if manager is _DEFAULT: + self.manager = None + else: + self.manager = manager + if reserve is _DEFAULT: + self.reserve = None + else: + self.reserve = reserve + if freeze is _DEFAULT: + self.freeze = None + else: + self.freeze = freeze + if clawback is _DEFAULT: + self.clawback = None + else: + self.clawback = clawback + + + + + def __str__(self): + return "AssetCreateParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, total={}, decimals={}, default_frozen={}, asset_name={}, unit_name={}, url={}, metadata_hash={}, manager={}, reserve={}, freeze={}, clawback={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.total, self.decimals, self.default_frozen, self.asset_name, self.unit_name, self.url, self.metadata_hash, self.manager, self.reserve, self.freeze, self.clawback) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.total != other.total: + return False + if self.decimals != other.decimals: + return False + if self.default_frozen != other.default_frozen: + return False + if self.asset_name != other.asset_name: + return False + if self.unit_name != other.unit_name: + return False + if self.url != other.url: + return False + if self.metadata_hash != other.metadata_hash: + return False + if self.manager != other.manager: + return False + if self.reserve != other.reserve: + return False + if self.freeze != other.freeze: + return False + if self.clawback != other.clawback: + return False + return True + +class _UniffiFfiConverterTypeAssetCreateParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetCreateParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + total=_UniffiFfiConverterUInt64.read(buf), + decimals=_UniffiFfiConverterOptionalUInt32.read(buf), + default_frozen=_UniffiFfiConverterOptionalBoolean.read(buf), + asset_name=_UniffiFfiConverterOptionalString.read(buf), + unit_name=_UniffiFfiConverterOptionalString.read(buf), + url=_UniffiFfiConverterOptionalString.read(buf), + metadata_hash=_UniffiFfiConverterOptionalBytes.read(buf), + manager=_UniffiFfiConverterOptionalString.read(buf), + reserve=_UniffiFfiConverterOptionalString.read(buf), + freeze=_UniffiFfiConverterOptionalString.read(buf), + clawback=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.total) + _UniffiFfiConverterOptionalUInt32.check_lower(value.decimals) + _UniffiFfiConverterOptionalBoolean.check_lower(value.default_frozen) + _UniffiFfiConverterOptionalString.check_lower(value.asset_name) + _UniffiFfiConverterOptionalString.check_lower(value.unit_name) + _UniffiFfiConverterOptionalString.check_lower(value.url) + _UniffiFfiConverterOptionalBytes.check_lower(value.metadata_hash) + _UniffiFfiConverterOptionalString.check_lower(value.manager) + _UniffiFfiConverterOptionalString.check_lower(value.reserve) + _UniffiFfiConverterOptionalString.check_lower(value.freeze) + _UniffiFfiConverterOptionalString.check_lower(value.clawback) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.total, buf) + _UniffiFfiConverterOptionalUInt32.write(value.decimals, buf) + _UniffiFfiConverterOptionalBoolean.write(value.default_frozen, buf) + _UniffiFfiConverterOptionalString.write(value.asset_name, buf) + _UniffiFfiConverterOptionalString.write(value.unit_name, buf) + _UniffiFfiConverterOptionalString.write(value.url, buf) + _UniffiFfiConverterOptionalBytes.write(value.metadata_hash, buf) + _UniffiFfiConverterOptionalString.write(value.manager, buf) + _UniffiFfiConverterOptionalString.write(value.reserve, buf) + _UniffiFfiConverterOptionalString.write(value.freeze, buf) + _UniffiFfiConverterOptionalString.write(value.clawback, buf) + +@dataclass +class AssetConfigParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int, manager:typing.Optional[str] = _DEFAULT, reserve:typing.Optional[str] = _DEFAULT, freeze:typing.Optional[str] = _DEFAULT, clawback:typing.Optional[str] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + if manager is _DEFAULT: + self.manager = None + else: + self.manager = manager + if reserve is _DEFAULT: + self.reserve = None + else: + self.reserve = reserve + if freeze is _DEFAULT: + self.freeze = None + else: + self.freeze = freeze + if clawback is _DEFAULT: + self.clawback = None + else: + self.clawback = clawback + + + + + def __str__(self): + return "AssetConfigParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={}, manager={}, reserve={}, freeze={}, clawback={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id, self.manager, self.reserve, self.freeze, self.clawback) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + if self.manager != other.manager: + return False + if self.reserve != other.reserve: + return False + if self.freeze != other.freeze: + return False + if self.clawback != other.clawback: + return False + return True + +class _UniffiFfiConverterTypeAssetConfigParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetConfigParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + manager=_UniffiFfiConverterOptionalString.read(buf), + reserve=_UniffiFfiConverterOptionalString.read(buf), + freeze=_UniffiFfiConverterOptionalString.read(buf), + clawback=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterOptionalString.check_lower(value.manager) + _UniffiFfiConverterOptionalString.check_lower(value.reserve) + _UniffiFfiConverterOptionalString.check_lower(value.freeze) + _UniffiFfiConverterOptionalString.check_lower(value.clawback) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterOptionalString.write(value.manager, buf) + _UniffiFfiConverterOptionalString.write(value.reserve, buf) + _UniffiFfiConverterOptionalString.write(value.freeze, buf) + _UniffiFfiConverterOptionalString.write(value.clawback, buf) + +@dataclass +class AssetDestroyParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + + + + + def __str__(self): + return "AssetDestroyParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + return True + +class _UniffiFfiConverterTypeAssetDestroyParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetDestroyParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + +@dataclass +class AssetFreezeParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int, target_address:str): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + self.target_address = target_address + + + + + def __str__(self): + return "AssetFreezeParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={}, target_address={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id, self.target_address) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + if self.target_address != other.target_address: + return False + return True + +class _UniffiFfiConverterTypeAssetFreezeParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetFreezeParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + target_address=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterString.check_lower(value.target_address) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterString.write(value.target_address, buf) + +@dataclass +class AssetUnfreezeParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, asset_id:int, target_address:str): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.asset_id = asset_id + self.target_address = target_address + + + + + def __str__(self): + return "AssetUnfreezeParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, asset_id={}, target_address={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.asset_id, self.target_address) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.asset_id != other.asset_id: + return False + if self.target_address != other.target_address: + return False + return True + +class _UniffiFfiConverterTypeAssetUnfreezeParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AssetUnfreezeParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterUInt64.read(buf), + target_address=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.asset_id) + _UniffiFfiConverterString.check_lower(value.target_address) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.asset_id, buf) + _UniffiFfiConverterString.write(value.target_address, buf) + +@dataclass +class AppCallParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, app_id:int, on_complete:algokit_transact.OnApplicationComplete, args:typing.Optional[typing.List[bytes]] = _DEFAULT, account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.app_id = app_id + self.on_complete = on_complete + if args is _DEFAULT: + self.args = None + else: + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + + + + + def __str__(self): + return "AppCallParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, app_id={}, on_complete={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.app_id, self.on_complete, self.args, self.account_references, self.app_references, self.asset_references, self.box_references) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.app_id != other.app_id: + return False + if self.on_complete != other.on_complete: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + return True + +class _UniffiFfiConverterTypeAppCallParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppCallParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + on_complete=algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.read(buf), + args=_UniffiFfiConverterOptionalSequenceBytes.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.check_lower(value.on_complete) + _UniffiFfiConverterOptionalSequenceBytes.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.write(value.on_complete, buf) + _UniffiFfiConverterOptionalSequenceBytes.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + +@dataclass +class OnlineKeyRegistrationParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, vote_key:bytes, selection_key:bytes, vote_first:int, vote_last:int, vote_key_dilution:int, state_proof_key:typing.Optional[bytes] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.vote_key = vote_key + self.selection_key = selection_key + self.vote_first = vote_first + self.vote_last = vote_last + self.vote_key_dilution = vote_key_dilution + if state_proof_key is _DEFAULT: + self.state_proof_key = None + else: + self.state_proof_key = state_proof_key + + + + + def __str__(self): + return "OnlineKeyRegistrationParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, vote_key={}, selection_key={}, vote_first={}, vote_last={}, vote_key_dilution={}, state_proof_key={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.vote_key, self.selection_key, self.vote_first, self.vote_last, self.vote_key_dilution, self.state_proof_key) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.vote_key != other.vote_key: + return False + if self.selection_key != other.selection_key: + return False + if self.vote_first != other.vote_first: + return False + if self.vote_last != other.vote_last: + return False + if self.vote_key_dilution != other.vote_key_dilution: + return False + if self.state_proof_key != other.state_proof_key: + return False + return True + +class _UniffiFfiConverterTypeOnlineKeyRegistrationParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return OnlineKeyRegistrationParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + vote_key=_UniffiFfiConverterBytes.read(buf), + selection_key=_UniffiFfiConverterBytes.read(buf), + vote_first=_UniffiFfiConverterUInt64.read(buf), + vote_last=_UniffiFfiConverterUInt64.read(buf), + vote_key_dilution=_UniffiFfiConverterUInt64.read(buf), + state_proof_key=_UniffiFfiConverterOptionalBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterBytes.check_lower(value.vote_key) + _UniffiFfiConverterBytes.check_lower(value.selection_key) + _UniffiFfiConverterUInt64.check_lower(value.vote_first) + _UniffiFfiConverterUInt64.check_lower(value.vote_last) + _UniffiFfiConverterUInt64.check_lower(value.vote_key_dilution) + _UniffiFfiConverterOptionalBytes.check_lower(value.state_proof_key) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterBytes.write(value.vote_key, buf) + _UniffiFfiConverterBytes.write(value.selection_key, buf) + _UniffiFfiConverterUInt64.write(value.vote_first, buf) + _UniffiFfiConverterUInt64.write(value.vote_last, buf) + _UniffiFfiConverterUInt64.write(value.vote_key_dilution, buf) + _UniffiFfiConverterOptionalBytes.write(value.state_proof_key, buf) + +@dataclass +class OfflineKeyRegistrationParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + + + + + def __str__(self): + return "OfflineKeyRegistrationParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + return True + +class _UniffiFfiConverterTypeOfflineKeyRegistrationParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return OfflineKeyRegistrationParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + +@dataclass +class NonParticipationKeyRegistrationParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + + + + + def __str__(self): + return "NonParticipationKeyRegistrationParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + return True + +class _UniffiFfiConverterTypeNonParticipationKeyRegistrationParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return NonParticipationKeyRegistrationParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + + + + + + +class AppMethodCallArg: + def __init__(self): + raise RuntimeError("AppMethodCallArg cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + @dataclass + class ABI_REFERENCE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ABI_REFERENCE{self._values!r}" + def __eq__(self, other): + if not other.is_ABI_REFERENCE(): + return False + return self._values == other._values + + @dataclass + class DEFAULT_VALUE: + """ + Sentinel to request ARC-56 default resolution for this argument (handled by AppClient params builder) +""" + + def __init__(self, ): + pass + + + + + + def __str__(self): + return "AppMethodCallArg.DEFAULT_VALUE()".format() + def __eq__(self, other): + if not other.is_DEFAULT_VALUE(): + return False + return True + + @dataclass + class TRANSACTION_PLACE_HOLDER: + """ + Placeholder for a transaction-typed argument. Not encoded; satisfied by a transaction + included in the same group (extracted from other method call arguments). +""" + + def __init__(self, ): + pass + + + + + + def __str__(self): + return "AppMethodCallArg.TRANSACTION_PLACE_HOLDER()".format() + def __eq__(self, other): + if not other.is_TRANSACTION_PLACE_HOLDER(): + return False + return True + + @dataclass + class ABI_VALUE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ABI_VALUE{self._values!r}" + def __eq__(self, other): + if not other.is_ABI_VALUE(): + return False + return self._values == other._values + + @dataclass + class APP_CREATE_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_CREATE_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_CREATE_CALL(): + return False + return self._values == other._values + + @dataclass + class APP_UPDATE_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_UPDATE_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_UPDATE_CALL(): + return False + return self._values == other._values + + @dataclass + class APP_DELETE_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_DELETE_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_DELETE_CALL(): + return False + return self._values == other._values + + @dataclass + class APP_CALL_METHOD_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_CALL_METHOD_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_CALL_METHOD_CALL(): + return False + return self._values == other._values + + @dataclass + class APP_CREATE_METHOD_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_CREATE_METHOD_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_CREATE_METHOD_CALL(): + return False + return self._values == other._values + + @dataclass + class APP_UPDATE_METHOD_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_UPDATE_METHOD_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_UPDATE_METHOD_CALL(): + return False + return self._values == other._values + + @dataclass + class APP_DELETE_METHOD_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_DELETE_METHOD_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_DELETE_METHOD_CALL(): + return False + return self._values == other._values + + @dataclass + class TRANSACTION: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.TRANSACTION{self._values!r}" + def __eq__(self, other): + if not other.is_TRANSACTION(): + return False + return self._values == other._values + + @dataclass + class TRANSACTION_WITH_SIGNER: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.TRANSACTION_WITH_SIGNER{self._values!r}" + def __eq__(self, other): + if not other.is_TRANSACTION_WITH_SIGNER(): + return False + return self._values == other._values + + @dataclass + class PAYMENT: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.PAYMENT{self._values!r}" + def __eq__(self, other): + if not other.is_PAYMENT(): + return False + return self._values == other._values + + @dataclass + class ACCOUNT_CLOSE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ACCOUNT_CLOSE{self._values!r}" + def __eq__(self, other): + if not other.is_ACCOUNT_CLOSE(): + return False + return self._values == other._values + + @dataclass + class ASSET_TRANSFER: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_TRANSFER{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_TRANSFER(): + return False + return self._values == other._values + + @dataclass + class ASSET_OPT_IN: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_OPT_IN{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_OPT_IN(): + return False + return self._values == other._values + + @dataclass + class ASSET_OPT_OUT: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_OPT_OUT{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_OPT_OUT(): + return False + return self._values == other._values + + @dataclass + class ASSET_CLAWBACK: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_CLAWBACK{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_CLAWBACK(): + return False + return self._values == other._values + + @dataclass + class ASSET_CREATE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_CREATE{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_CREATE(): + return False + return self._values == other._values + + @dataclass + class ASSET_CONFIG: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_CONFIG{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_CONFIG(): + return False + return self._values == other._values + + @dataclass + class ASSET_DESTROY: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_DESTROY{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_DESTROY(): + return False + return self._values == other._values + + @dataclass + class ASSET_FREEZE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_FREEZE{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_FREEZE(): + return False + return self._values == other._values + + @dataclass + class ASSET_UNFREEZE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ASSET_UNFREEZE{self._values!r}" + def __eq__(self, other): + if not other.is_ASSET_UNFREEZE(): + return False + return self._values == other._values + + @dataclass + class APP_CALL: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.APP_CALL{self._values!r}" + def __eq__(self, other): + if not other.is_APP_CALL(): + return False + return self._values == other._values + + @dataclass + class ONLINE_KEY_REGISTRATION: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.ONLINE_KEY_REGISTRATION{self._values!r}" + def __eq__(self, other): + if not other.is_ONLINE_KEY_REGISTRATION(): + return False + return self._values == other._values + + @dataclass + class OFFLINE_KEY_REGISTRATION: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.OFFLINE_KEY_REGISTRATION{self._values!r}" + def __eq__(self, other): + if not other.is_OFFLINE_KEY_REGISTRATION(): + return False + return self._values == other._values + + @dataclass + class NON_PARTICIPATION_KEY_REGISTRATION: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION{self._values!r}" + def __eq__(self, other): + if not other.is_NON_PARTICIPATION_KEY_REGISTRATION(): + return False + return self._values == other._values + + + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking + # whether an instance is that variant. + def is_ABI_REFERENCE(self) -> bool: + return isinstance(self, AppMethodCallArg.ABI_REFERENCE) + def is_abi_reference(self) -> bool: + return isinstance(self, AppMethodCallArg.ABI_REFERENCE) + def is_DEFAULT_VALUE(self) -> bool: + return isinstance(self, AppMethodCallArg.DEFAULT_VALUE) + def is_default_value(self) -> bool: + return isinstance(self, AppMethodCallArg.DEFAULT_VALUE) + def is_TRANSACTION_PLACE_HOLDER(self) -> bool: + return isinstance(self, AppMethodCallArg.TRANSACTION_PLACE_HOLDER) + def is_transaction_place_holder(self) -> bool: + return isinstance(self, AppMethodCallArg.TRANSACTION_PLACE_HOLDER) + def is_ABI_VALUE(self) -> bool: + return isinstance(self, AppMethodCallArg.ABI_VALUE) + def is_abi_value(self) -> bool: + return isinstance(self, AppMethodCallArg.ABI_VALUE) + def is_APP_CREATE_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CREATE_CALL) + def is_app_create_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CREATE_CALL) + def is_APP_UPDATE_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_UPDATE_CALL) + def is_app_update_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_UPDATE_CALL) + def is_APP_DELETE_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_DELETE_CALL) + def is_app_delete_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_DELETE_CALL) + def is_APP_CALL_METHOD_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CALL_METHOD_CALL) + def is_app_call_method_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CALL_METHOD_CALL) + def is_APP_CREATE_METHOD_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CREATE_METHOD_CALL) + def is_app_create_method_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CREATE_METHOD_CALL) + def is_APP_UPDATE_METHOD_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_UPDATE_METHOD_CALL) + def is_app_update_method_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_UPDATE_METHOD_CALL) + def is_APP_DELETE_METHOD_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_DELETE_METHOD_CALL) + def is_app_delete_method_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_DELETE_METHOD_CALL) + def is_TRANSACTION(self) -> bool: + return isinstance(self, AppMethodCallArg.TRANSACTION) + def is_transaction(self) -> bool: + return isinstance(self, AppMethodCallArg.TRANSACTION) + def is_TRANSACTION_WITH_SIGNER(self) -> bool: + return isinstance(self, AppMethodCallArg.TRANSACTION_WITH_SIGNER) + def is_transaction_with_signer(self) -> bool: + return isinstance(self, AppMethodCallArg.TRANSACTION_WITH_SIGNER) + def is_PAYMENT(self) -> bool: + return isinstance(self, AppMethodCallArg.PAYMENT) + def is_payment(self) -> bool: + return isinstance(self, AppMethodCallArg.PAYMENT) + def is_ACCOUNT_CLOSE(self) -> bool: + return isinstance(self, AppMethodCallArg.ACCOUNT_CLOSE) + def is_account_close(self) -> bool: + return isinstance(self, AppMethodCallArg.ACCOUNT_CLOSE) + def is_ASSET_TRANSFER(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_TRANSFER) + def is_asset_transfer(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_TRANSFER) + def is_ASSET_OPT_IN(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_OPT_IN) + def is_asset_opt_in(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_OPT_IN) + def is_ASSET_OPT_OUT(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_OPT_OUT) + def is_asset_opt_out(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_OPT_OUT) + def is_ASSET_CLAWBACK(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_CLAWBACK) + def is_asset_clawback(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_CLAWBACK) + def is_ASSET_CREATE(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_CREATE) + def is_asset_create(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_CREATE) + def is_ASSET_CONFIG(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_CONFIG) + def is_asset_config(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_CONFIG) + def is_ASSET_DESTROY(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_DESTROY) + def is_asset_destroy(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_DESTROY) + def is_ASSET_FREEZE(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_FREEZE) + def is_asset_freeze(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_FREEZE) + def is_ASSET_UNFREEZE(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_UNFREEZE) + def is_asset_unfreeze(self) -> bool: + return isinstance(self, AppMethodCallArg.ASSET_UNFREEZE) + def is_APP_CALL(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CALL) + def is_app_call(self) -> bool: + return isinstance(self, AppMethodCallArg.APP_CALL) + def is_ONLINE_KEY_REGISTRATION(self) -> bool: + return isinstance(self, AppMethodCallArg.ONLINE_KEY_REGISTRATION) + def is_online_key_registration(self) -> bool: + return isinstance(self, AppMethodCallArg.ONLINE_KEY_REGISTRATION) + def is_OFFLINE_KEY_REGISTRATION(self) -> bool: + return isinstance(self, AppMethodCallArg.OFFLINE_KEY_REGISTRATION) + def is_offline_key_registration(self) -> bool: + return isinstance(self, AppMethodCallArg.OFFLINE_KEY_REGISTRATION) + def is_NON_PARTICIPATION_KEY_REGISTRATION(self) -> bool: + return isinstance(self, AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION) + def is_non_participation_key_registration(self) -> bool: + return isinstance(self, AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +AppMethodCallArg.ABI_REFERENCE = type("AppMethodCallArg.ABI_REFERENCE", (AppMethodCallArg.ABI_REFERENCE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.DEFAULT_VALUE = type("AppMethodCallArg.DEFAULT_VALUE", (AppMethodCallArg.DEFAULT_VALUE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.TRANSACTION_PLACE_HOLDER = type("AppMethodCallArg.TRANSACTION_PLACE_HOLDER", (AppMethodCallArg.TRANSACTION_PLACE_HOLDER, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ABI_VALUE = type("AppMethodCallArg.ABI_VALUE", (AppMethodCallArg.ABI_VALUE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_CREATE_CALL = type("AppMethodCallArg.APP_CREATE_CALL", (AppMethodCallArg.APP_CREATE_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_UPDATE_CALL = type("AppMethodCallArg.APP_UPDATE_CALL", (AppMethodCallArg.APP_UPDATE_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_DELETE_CALL = type("AppMethodCallArg.APP_DELETE_CALL", (AppMethodCallArg.APP_DELETE_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_CALL_METHOD_CALL = type("AppMethodCallArg.APP_CALL_METHOD_CALL", (AppMethodCallArg.APP_CALL_METHOD_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_CREATE_METHOD_CALL = type("AppMethodCallArg.APP_CREATE_METHOD_CALL", (AppMethodCallArg.APP_CREATE_METHOD_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_UPDATE_METHOD_CALL = type("AppMethodCallArg.APP_UPDATE_METHOD_CALL", (AppMethodCallArg.APP_UPDATE_METHOD_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_DELETE_METHOD_CALL = type("AppMethodCallArg.APP_DELETE_METHOD_CALL", (AppMethodCallArg.APP_DELETE_METHOD_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.TRANSACTION = type("AppMethodCallArg.TRANSACTION", (AppMethodCallArg.TRANSACTION, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.TRANSACTION_WITH_SIGNER = type("AppMethodCallArg.TRANSACTION_WITH_SIGNER", (AppMethodCallArg.TRANSACTION_WITH_SIGNER, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.PAYMENT = type("AppMethodCallArg.PAYMENT", (AppMethodCallArg.PAYMENT, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ACCOUNT_CLOSE = type("AppMethodCallArg.ACCOUNT_CLOSE", (AppMethodCallArg.ACCOUNT_CLOSE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_TRANSFER = type("AppMethodCallArg.ASSET_TRANSFER", (AppMethodCallArg.ASSET_TRANSFER, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_OPT_IN = type("AppMethodCallArg.ASSET_OPT_IN", (AppMethodCallArg.ASSET_OPT_IN, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_OPT_OUT = type("AppMethodCallArg.ASSET_OPT_OUT", (AppMethodCallArg.ASSET_OPT_OUT, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_CLAWBACK = type("AppMethodCallArg.ASSET_CLAWBACK", (AppMethodCallArg.ASSET_CLAWBACK, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_CREATE = type("AppMethodCallArg.ASSET_CREATE", (AppMethodCallArg.ASSET_CREATE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_CONFIG = type("AppMethodCallArg.ASSET_CONFIG", (AppMethodCallArg.ASSET_CONFIG, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_DESTROY = type("AppMethodCallArg.ASSET_DESTROY", (AppMethodCallArg.ASSET_DESTROY, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_FREEZE = type("AppMethodCallArg.ASSET_FREEZE", (AppMethodCallArg.ASSET_FREEZE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ASSET_UNFREEZE = type("AppMethodCallArg.ASSET_UNFREEZE", (AppMethodCallArg.ASSET_UNFREEZE, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.APP_CALL = type("AppMethodCallArg.APP_CALL", (AppMethodCallArg.APP_CALL, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.ONLINE_KEY_REGISTRATION = type("AppMethodCallArg.ONLINE_KEY_REGISTRATION", (AppMethodCallArg.ONLINE_KEY_REGISTRATION, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.OFFLINE_KEY_REGISTRATION = type("AppMethodCallArg.OFFLINE_KEY_REGISTRATION", (AppMethodCallArg.OFFLINE_KEY_REGISTRATION, AppMethodCallArg,), {}) # type: ignore +AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION = type("AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION", (AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION, AppMethodCallArg,), {}) # type: ignore + + + + +class _UniffiFfiConverterTypeAppMethodCallArg(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return AppMethodCallArg.ABI_REFERENCE( + _UniffiFfiConverterTypeABIReferenceValue.read(buf), + ) + if variant == 2: + return AppMethodCallArg.DEFAULT_VALUE( + ) + if variant == 3: + return AppMethodCallArg.TRANSACTION_PLACE_HOLDER( + ) + if variant == 4: + return AppMethodCallArg.ABI_VALUE( + _UniffiFfiConverterTypeABIValue.read(buf), + ) + if variant == 5: + return AppMethodCallArg.APP_CREATE_CALL( + _UniffiFfiConverterTypeAppCreateParams.read(buf), + ) + if variant == 6: + return AppMethodCallArg.APP_UPDATE_CALL( + _UniffiFfiConverterTypeAppUpdateParams.read(buf), + ) + if variant == 7: + return AppMethodCallArg.APP_DELETE_CALL( + _UniffiFfiConverterTypeAppDeleteParams.read(buf), + ) + if variant == 8: + return AppMethodCallArg.APP_CALL_METHOD_CALL( + _UniffiFfiConverterTypeAppCallMethodCallParams.read(buf), + ) + if variant == 9: + return AppMethodCallArg.APP_CREATE_METHOD_CALL( + _UniffiFfiConverterTypeAppCreateMethodCallParams.read(buf), + ) + if variant == 10: + return AppMethodCallArg.APP_UPDATE_METHOD_CALL( + _UniffiFfiConverterTypeAppUpdateMethodCallParams.read(buf), + ) + if variant == 11: + return AppMethodCallArg.APP_DELETE_METHOD_CALL( + _UniffiFfiConverterTypeAppDeleteMethodCallParams.read(buf), + ) + if variant == 12: + return AppMethodCallArg.TRANSACTION( + algokit_transact._UniffiFfiConverterTypeTransaction.read(buf), + ) + if variant == 13: + return AppMethodCallArg.TRANSACTION_WITH_SIGNER( + _UniffiFfiConverterTypeTransactionWithSigner.read(buf), + ) + if variant == 14: + return AppMethodCallArg.PAYMENT( + _UniffiFfiConverterTypePaymentParams.read(buf), + ) + if variant == 15: + return AppMethodCallArg.ACCOUNT_CLOSE( + _UniffiFfiConverterTypeAccountCloseParams.read(buf), + ) + if variant == 16: + return AppMethodCallArg.ASSET_TRANSFER( + _UniffiFfiConverterTypeAssetTransferParams.read(buf), + ) + if variant == 17: + return AppMethodCallArg.ASSET_OPT_IN( + _UniffiFfiConverterTypeAssetOptInParams.read(buf), + ) + if variant == 18: + return AppMethodCallArg.ASSET_OPT_OUT( + _UniffiFfiConverterTypeAssetOptOutParams.read(buf), + ) + if variant == 19: + return AppMethodCallArg.ASSET_CLAWBACK( + _UniffiFfiConverterTypeAssetClawbackParams.read(buf), + ) + if variant == 20: + return AppMethodCallArg.ASSET_CREATE( + _UniffiFfiConverterTypeAssetCreateParams.read(buf), + ) + if variant == 21: + return AppMethodCallArg.ASSET_CONFIG( + _UniffiFfiConverterTypeAssetConfigParams.read(buf), + ) + if variant == 22: + return AppMethodCallArg.ASSET_DESTROY( + _UniffiFfiConverterTypeAssetDestroyParams.read(buf), + ) + if variant == 23: + return AppMethodCallArg.ASSET_FREEZE( + _UniffiFfiConverterTypeAssetFreezeParams.read(buf), + ) + if variant == 24: + return AppMethodCallArg.ASSET_UNFREEZE( + _UniffiFfiConverterTypeAssetUnfreezeParams.read(buf), + ) + if variant == 25: + return AppMethodCallArg.APP_CALL( + _UniffiFfiConverterTypeAppCallParams.read(buf), + ) + if variant == 26: + return AppMethodCallArg.ONLINE_KEY_REGISTRATION( + _UniffiFfiConverterTypeOnlineKeyRegistrationParams.read(buf), + ) + if variant == 27: + return AppMethodCallArg.OFFLINE_KEY_REGISTRATION( + _UniffiFfiConverterTypeOfflineKeyRegistrationParams.read(buf), + ) + if variant == 28: + return AppMethodCallArg.NON_PARTICIPATION_KEY_REGISTRATION( + _UniffiFfiConverterTypeNonParticipationKeyRegistrationParams.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_ABI_REFERENCE(): + _UniffiFfiConverterTypeABIReferenceValue.check_lower(value._values[0]) + return + if value.is_DEFAULT_VALUE(): + return + if value.is_TRANSACTION_PLACE_HOLDER(): + return + if value.is_ABI_VALUE(): + _UniffiFfiConverterTypeABIValue.check_lower(value._values[0]) + return + if value.is_APP_CREATE_CALL(): + _UniffiFfiConverterTypeAppCreateParams.check_lower(value._values[0]) + return + if value.is_APP_UPDATE_CALL(): + _UniffiFfiConverterTypeAppUpdateParams.check_lower(value._values[0]) + return + if value.is_APP_DELETE_CALL(): + _UniffiFfiConverterTypeAppDeleteParams.check_lower(value._values[0]) + return + if value.is_APP_CALL_METHOD_CALL(): + _UniffiFfiConverterTypeAppCallMethodCallParams.check_lower(value._values[0]) + return + if value.is_APP_CREATE_METHOD_CALL(): + _UniffiFfiConverterTypeAppCreateMethodCallParams.check_lower(value._values[0]) + return + if value.is_APP_UPDATE_METHOD_CALL(): + _UniffiFfiConverterTypeAppUpdateMethodCallParams.check_lower(value._values[0]) + return + if value.is_APP_DELETE_METHOD_CALL(): + _UniffiFfiConverterTypeAppDeleteMethodCallParams.check_lower(value._values[0]) + return + if value.is_TRANSACTION(): + algokit_transact._UniffiFfiConverterTypeTransaction.check_lower(value._values[0]) + return + if value.is_TRANSACTION_WITH_SIGNER(): + _UniffiFfiConverterTypeTransactionWithSigner.check_lower(value._values[0]) + return + if value.is_PAYMENT(): + _UniffiFfiConverterTypePaymentParams.check_lower(value._values[0]) + return + if value.is_ACCOUNT_CLOSE(): + _UniffiFfiConverterTypeAccountCloseParams.check_lower(value._values[0]) + return + if value.is_ASSET_TRANSFER(): + _UniffiFfiConverterTypeAssetTransferParams.check_lower(value._values[0]) + return + if value.is_ASSET_OPT_IN(): + _UniffiFfiConverterTypeAssetOptInParams.check_lower(value._values[0]) + return + if value.is_ASSET_OPT_OUT(): + _UniffiFfiConverterTypeAssetOptOutParams.check_lower(value._values[0]) + return + if value.is_ASSET_CLAWBACK(): + _UniffiFfiConverterTypeAssetClawbackParams.check_lower(value._values[0]) + return + if value.is_ASSET_CREATE(): + _UniffiFfiConverterTypeAssetCreateParams.check_lower(value._values[0]) + return + if value.is_ASSET_CONFIG(): + _UniffiFfiConverterTypeAssetConfigParams.check_lower(value._values[0]) + return + if value.is_ASSET_DESTROY(): + _UniffiFfiConverterTypeAssetDestroyParams.check_lower(value._values[0]) + return + if value.is_ASSET_FREEZE(): + _UniffiFfiConverterTypeAssetFreezeParams.check_lower(value._values[0]) + return + if value.is_ASSET_UNFREEZE(): + _UniffiFfiConverterTypeAssetUnfreezeParams.check_lower(value._values[0]) + return + if value.is_APP_CALL(): + _UniffiFfiConverterTypeAppCallParams.check_lower(value._values[0]) + return + if value.is_ONLINE_KEY_REGISTRATION(): + _UniffiFfiConverterTypeOnlineKeyRegistrationParams.check_lower(value._values[0]) + return + if value.is_OFFLINE_KEY_REGISTRATION(): + _UniffiFfiConverterTypeOfflineKeyRegistrationParams.check_lower(value._values[0]) + return + if value.is_NON_PARTICIPATION_KEY_REGISTRATION(): + _UniffiFfiConverterTypeNonParticipationKeyRegistrationParams.check_lower(value._values[0]) + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value.is_ABI_REFERENCE(): + buf.write_i32(1) + _UniffiFfiConverterTypeABIReferenceValue.write(value._values[0], buf) + if value.is_DEFAULT_VALUE(): + buf.write_i32(2) + if value.is_TRANSACTION_PLACE_HOLDER(): + buf.write_i32(3) + if value.is_ABI_VALUE(): + buf.write_i32(4) + _UniffiFfiConverterTypeABIValue.write(value._values[0], buf) + if value.is_APP_CREATE_CALL(): + buf.write_i32(5) + _UniffiFfiConverterTypeAppCreateParams.write(value._values[0], buf) + if value.is_APP_UPDATE_CALL(): + buf.write_i32(6) + _UniffiFfiConverterTypeAppUpdateParams.write(value._values[0], buf) + if value.is_APP_DELETE_CALL(): + buf.write_i32(7) + _UniffiFfiConverterTypeAppDeleteParams.write(value._values[0], buf) + if value.is_APP_CALL_METHOD_CALL(): + buf.write_i32(8) + _UniffiFfiConverterTypeAppCallMethodCallParams.write(value._values[0], buf) + if value.is_APP_CREATE_METHOD_CALL(): + buf.write_i32(9) + _UniffiFfiConverterTypeAppCreateMethodCallParams.write(value._values[0], buf) + if value.is_APP_UPDATE_METHOD_CALL(): + buf.write_i32(10) + _UniffiFfiConverterTypeAppUpdateMethodCallParams.write(value._values[0], buf) + if value.is_APP_DELETE_METHOD_CALL(): + buf.write_i32(11) + _UniffiFfiConverterTypeAppDeleteMethodCallParams.write(value._values[0], buf) + if value.is_TRANSACTION(): + buf.write_i32(12) + algokit_transact._UniffiFfiConverterTypeTransaction.write(value._values[0], buf) + if value.is_TRANSACTION_WITH_SIGNER(): + buf.write_i32(13) + _UniffiFfiConverterTypeTransactionWithSigner.write(value._values[0], buf) + if value.is_PAYMENT(): + buf.write_i32(14) + _UniffiFfiConverterTypePaymentParams.write(value._values[0], buf) + if value.is_ACCOUNT_CLOSE(): + buf.write_i32(15) + _UniffiFfiConverterTypeAccountCloseParams.write(value._values[0], buf) + if value.is_ASSET_TRANSFER(): + buf.write_i32(16) + _UniffiFfiConverterTypeAssetTransferParams.write(value._values[0], buf) + if value.is_ASSET_OPT_IN(): + buf.write_i32(17) + _UniffiFfiConverterTypeAssetOptInParams.write(value._values[0], buf) + if value.is_ASSET_OPT_OUT(): + buf.write_i32(18) + _UniffiFfiConverterTypeAssetOptOutParams.write(value._values[0], buf) + if value.is_ASSET_CLAWBACK(): + buf.write_i32(19) + _UniffiFfiConverterTypeAssetClawbackParams.write(value._values[0], buf) + if value.is_ASSET_CREATE(): + buf.write_i32(20) + _UniffiFfiConverterTypeAssetCreateParams.write(value._values[0], buf) + if value.is_ASSET_CONFIG(): + buf.write_i32(21) + _UniffiFfiConverterTypeAssetConfigParams.write(value._values[0], buf) + if value.is_ASSET_DESTROY(): + buf.write_i32(22) + _UniffiFfiConverterTypeAssetDestroyParams.write(value._values[0], buf) + if value.is_ASSET_FREEZE(): + buf.write_i32(23) + _UniffiFfiConverterTypeAssetFreezeParams.write(value._values[0], buf) + if value.is_ASSET_UNFREEZE(): + buf.write_i32(24) + _UniffiFfiConverterTypeAssetUnfreezeParams.write(value._values[0], buf) + if value.is_APP_CALL(): + buf.write_i32(25) + _UniffiFfiConverterTypeAppCallParams.write(value._values[0], buf) + if value.is_ONLINE_KEY_REGISTRATION(): + buf.write_i32(26) + _UniffiFfiConverterTypeOnlineKeyRegistrationParams.write(value._values[0], buf) + if value.is_OFFLINE_KEY_REGISTRATION(): + buf.write_i32(27) + _UniffiFfiConverterTypeOfflineKeyRegistrationParams.write(value._values[0], buf) + if value.is_NON_PARTICIPATION_KEY_REGISTRATION(): + buf.write_i32(28) + _UniffiFfiConverterTypeNonParticipationKeyRegistrationParams.write(value._values[0], buf) + + + +class _UniffiFfiConverterSequenceTypeAppMethodCallArg(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeAppMethodCallArg.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeAppMethodCallArg.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeAppMethodCallArg.read(buf) for i in range(count) + ] + +@dataclass +class AppCallMethodCallParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT, app_id:int, method:AbiMethod, args:typing.List[AppMethodCallArg], account_references:typing.Optional[typing.List[str]] = _DEFAULT, app_references:typing.Optional[typing.List[int]] = _DEFAULT, asset_references:typing.Optional[typing.List[int]] = _DEFAULT, box_references:typing.Optional[typing.List[algokit_transact.BoxReference]] = _DEFAULT, on_complete:algokit_transact.OnApplicationComplete): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + self.app_id = app_id + self.method = method + self.args = args + if account_references is _DEFAULT: + self.account_references = None + else: + self.account_references = account_references + if app_references is _DEFAULT: + self.app_references = None + else: + self.app_references = app_references + if asset_references is _DEFAULT: + self.asset_references = None + else: + self.asset_references = asset_references + if box_references is _DEFAULT: + self.box_references = None + else: + self.box_references = box_references + self.on_complete = on_complete + + + + + def __str__(self): + return "AppCallMethodCallParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={}, app_id={}, method={}, args={}, account_references={}, app_references={}, asset_references={}, box_references={}, on_complete={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round, self.app_id, self.method, self.args, self.account_references, self.app_references, self.asset_references, self.box_references, self.on_complete) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.app_id != other.app_id: + return False + if self.method != other.method: + return False + if self.args != other.args: + return False + if self.account_references != other.account_references: + return False + if self.app_references != other.app_references: + return False + if self.asset_references != other.asset_references: + return False + if self.box_references != other.box_references: + return False + if self.on_complete != other.on_complete: + return False + return True + +class _UniffiFfiConverterTypeAppCallMethodCallParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return AppCallMethodCallParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt32.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterUInt64.read(buf), + method=_UniffiFfiConverterTypeABIMethod.read(buf), + args=_UniffiFfiConverterSequenceTypeAppMethodCallArg.read(buf), + account_references=_UniffiFfiConverterOptionalSequenceString.read(buf), + app_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + asset_references=_UniffiFfiConverterOptionalSequenceUInt64.read(buf), + box_references=_UniffiFfiConverterOptionalSequenceTypeBoxReference.read(buf), + on_complete=algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt32.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.app_id) + _UniffiFfiConverterTypeABIMethod.check_lower(value.method) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.check_lower(value.args) + _UniffiFfiConverterOptionalSequenceString.check_lower(value.account_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.app_references) + _UniffiFfiConverterOptionalSequenceUInt64.check_lower(value.asset_references) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.check_lower(value.box_references) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.check_lower(value.on_complete) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt32.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.app_id, buf) + _UniffiFfiConverterTypeABIMethod.write(value.method, buf) + _UniffiFfiConverterSequenceTypeAppMethodCallArg.write(value.args, buf) + _UniffiFfiConverterOptionalSequenceString.write(value.account_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.app_references, buf) + _UniffiFfiConverterOptionalSequenceUInt64.write(value.asset_references, buf) + _UniffiFfiConverterOptionalSequenceTypeBoxReference.write(value.box_references, buf) + algokit_transact._UniffiFfiConverterTypeOnApplicationComplete.write(value.on_complete, buf) + +@dataclass +class CommonParams: + def __init__(self, *, sender:str, signer:typing.Optional[TransactionSigner] = _DEFAULT, rekey_to:typing.Optional[str] = _DEFAULT, note:typing.Optional[bytes] = _DEFAULT, lease:typing.Optional[bytes] = _DEFAULT, static_fee:typing.Optional[int] = _DEFAULT, extra_fee:typing.Optional[int] = _DEFAULT, max_fee:typing.Optional[int] = _DEFAULT, validity_window:typing.Optional[int] = _DEFAULT, first_valid_round:typing.Optional[int] = _DEFAULT, last_valid_round:typing.Optional[int] = _DEFAULT): + self.sender = sender + if signer is _DEFAULT: + self.signer = None + else: + self.signer = signer + if rekey_to is _DEFAULT: + self.rekey_to = None + else: + self.rekey_to = rekey_to + if note is _DEFAULT: + self.note = None + else: + self.note = note + if lease is _DEFAULT: + self.lease = None + else: + self.lease = lease + if static_fee is _DEFAULT: + self.static_fee = None + else: + self.static_fee = static_fee + if extra_fee is _DEFAULT: + self.extra_fee = None + else: + self.extra_fee = extra_fee + if max_fee is _DEFAULT: + self.max_fee = None + else: + self.max_fee = max_fee + if validity_window is _DEFAULT: + self.validity_window = None + else: + self.validity_window = validity_window + if first_valid_round is _DEFAULT: + self.first_valid_round = None + else: + self.first_valid_round = first_valid_round + if last_valid_round is _DEFAULT: + self.last_valid_round = None + else: + self.last_valid_round = last_valid_round + + + + + def __str__(self): + return "CommonParams(sender={}, signer={}, rekey_to={}, note={}, lease={}, static_fee={}, extra_fee={}, max_fee={}, validity_window={}, first_valid_round={}, last_valid_round={})".format(self.sender, self.signer, self.rekey_to, self.note, self.lease, self.static_fee, self.extra_fee, self.max_fee, self.validity_window, self.first_valid_round, self.last_valid_round) + def __eq__(self, other): + if self.sender != other.sender: + return False + if self.signer != other.signer: + return False + if self.rekey_to != other.rekey_to: + return False + if self.note != other.note: + return False + if self.lease != other.lease: + return False + if self.static_fee != other.static_fee: + return False + if self.extra_fee != other.extra_fee: + return False + if self.max_fee != other.max_fee: + return False + if self.validity_window != other.validity_window: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + return True + +class _UniffiFfiConverterTypeCommonParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return CommonParams( + sender=_UniffiFfiConverterString.read(buf), + signer=_UniffiFfiConverterOptionalTypeTransactionSigner.read(buf), + rekey_to=_UniffiFfiConverterOptionalString.read(buf), + note=_UniffiFfiConverterOptionalBytes.read(buf), + lease=_UniffiFfiConverterOptionalBytes.read(buf), + static_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + extra_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + max_fee=_UniffiFfiConverterOptionalUInt64.read(buf), + validity_window=_UniffiFfiConverterOptionalUInt64.read(buf), + first_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + last_valid_round=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.sender) + _UniffiFfiConverterOptionalTypeTransactionSigner.check_lower(value.signer) + _UniffiFfiConverterOptionalString.check_lower(value.rekey_to) + _UniffiFfiConverterOptionalBytes.check_lower(value.note) + _UniffiFfiConverterOptionalBytes.check_lower(value.lease) + _UniffiFfiConverterOptionalUInt64.check_lower(value.static_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.extra_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.max_fee) + _UniffiFfiConverterOptionalUInt64.check_lower(value.validity_window) + _UniffiFfiConverterOptionalUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.last_valid_round) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.sender, buf) + _UniffiFfiConverterOptionalTypeTransactionSigner.write(value.signer, buf) + _UniffiFfiConverterOptionalString.write(value.rekey_to, buf) + _UniffiFfiConverterOptionalBytes.write(value.note, buf) + _UniffiFfiConverterOptionalBytes.write(value.lease, buf) + _UniffiFfiConverterOptionalUInt64.write(value.static_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.extra_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.max_fee, buf) + _UniffiFfiConverterOptionalUInt64.write(value.validity_window, buf) + _UniffiFfiConverterOptionalUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.last_valid_round, buf) + +@dataclass +class SuggestedParams: + def __init__(self, *, fee:int, first_valid_round:int, last_valid_round:int, genesis_hash:bytes, genesis_id:str): + self.fee = fee + self.first_valid_round = first_valid_round + self.last_valid_round = last_valid_round + self.genesis_hash = genesis_hash + self.genesis_id = genesis_id + + + + + def __str__(self): + return "SuggestedParams(fee={}, first_valid_round={}, last_valid_round={}, genesis_hash={}, genesis_id={})".format(self.fee, self.first_valid_round, self.last_valid_round, self.genesis_hash, self.genesis_id) + def __eq__(self, other): + if self.fee != other.fee: + return False + if self.first_valid_round != other.first_valid_round: + return False + if self.last_valid_round != other.last_valid_round: + return False + if self.genesis_hash != other.genesis_hash: + return False + if self.genesis_id != other.genesis_id: + return False + return True + +class _UniffiFfiConverterTypeSuggestedParams(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SuggestedParams( + fee=_UniffiFfiConverterUInt64.read(buf), + first_valid_round=_UniffiFfiConverterUInt64.read(buf), + last_valid_round=_UniffiFfiConverterUInt64.read(buf), + genesis_hash=_UniffiFfiConverterBytes.read(buf), + genesis_id=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterUInt64.check_lower(value.fee) + _UniffiFfiConverterUInt64.check_lower(value.first_valid_round) + _UniffiFfiConverterUInt64.check_lower(value.last_valid_round) + _UniffiFfiConverterBytes.check_lower(value.genesis_hash) + _UniffiFfiConverterString.check_lower(value.genesis_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterUInt64.write(value.fee, buf) + _UniffiFfiConverterUInt64.write(value.first_valid_round, buf) + _UniffiFfiConverterUInt64.write(value.last_valid_round, buf) + _UniffiFfiConverterBytes.write(value.genesis_hash, buf) + _UniffiFfiConverterString.write(value.genesis_id, buf) + +@dataclass +class TestAccount: + def __init__(self, *, address:str, private_key:bytes, mnemonic:str): + self.address = address + self.private_key = private_key + self.mnemonic = mnemonic + + + + + def __str__(self): + return "TestAccount(address={}, private_key={}, mnemonic={})".format(self.address, self.private_key, self.mnemonic) + def __eq__(self, other): + if self.address != other.address: + return False + if self.private_key != other.private_key: + return False + if self.mnemonic != other.mnemonic: + return False + return True + +class _UniffiFfiConverterTypeTestAccount(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TestAccount( + address=_UniffiFfiConverterString.read(buf), + private_key=_UniffiFfiConverterBytes.read(buf), + mnemonic=_UniffiFfiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.address) + _UniffiFfiConverterBytes.check_lower(value.private_key) + _UniffiFfiConverterString.check_lower(value.mnemonic) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.address, buf) + _UniffiFfiConverterBytes.write(value.private_key, buf) + _UniffiFfiConverterString.write(value.mnemonic, buf) + +@dataclass +class TestResult: + """ + Result of a single test +""" + def __init__(self, *, name:str, passed:bool, duration_ms:int, error:typing.Optional[str]): + self.name = name + self.passed = passed + self.duration_ms = duration_ms + self.error = error + + + + + def __str__(self): + return "TestResult(name={}, passed={}, duration_ms={}, error={})".format(self.name, self.passed, self.duration_ms, self.error) + def __eq__(self, other): + if self.name != other.name: + return False + if self.passed != other.passed: + return False + if self.duration_ms != other.duration_ms: + return False + if self.error != other.error: + return False + return True + +class _UniffiFfiConverterTypeTestResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TestResult( + name=_UniffiFfiConverterString.read(buf), + passed=_UniffiFfiConverterBoolean.read(buf), + duration_ms=_UniffiFfiConverterUInt64.read(buf), + error=_UniffiFfiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.name) + _UniffiFfiConverterBoolean.check_lower(value.passed) + _UniffiFfiConverterUInt64.check_lower(value.duration_ms) + _UniffiFfiConverterOptionalString.check_lower(value.error) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.name, buf) + _UniffiFfiConverterBoolean.write(value.passed, buf) + _UniffiFfiConverterUInt64.write(value.duration_ms, buf) + _UniffiFfiConverterOptionalString.write(value.error, buf) + +class _UniffiFfiConverterSequenceTypeTestResult(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeTestResult.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeTestResult.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeTestResult.read(buf) for i in range(count) + ] + +@dataclass +class TestSuiteResult: + """ + Result of an entire test suite +""" + def __init__(self, *, name:str, results:typing.List[TestResult], all_passed:bool, total_duration_ms:int): + self.name = name + self.results = results + self.all_passed = all_passed + self.total_duration_ms = total_duration_ms + + + + + def __str__(self): + return "TestSuiteResult(name={}, results={}, all_passed={}, total_duration_ms={})".format(self.name, self.results, self.all_passed, self.total_duration_ms) + def __eq__(self, other): + if self.name != other.name: + return False + if self.results != other.results: + return False + if self.all_passed != other.all_passed: + return False + if self.total_duration_ms != other.total_duration_ms: + return False + return True + +class _UniffiFfiConverterTypeTestSuiteResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TestSuiteResult( + name=_UniffiFfiConverterString.read(buf), + results=_UniffiFfiConverterSequenceTypeTestResult.read(buf), + all_passed=_UniffiFfiConverterBoolean.read(buf), + total_duration_ms=_UniffiFfiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.name) + _UniffiFfiConverterSequenceTypeTestResult.check_lower(value.results) + _UniffiFfiConverterBoolean.check_lower(value.all_passed) + _UniffiFfiConverterUInt64.check_lower(value.total_duration_ms) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.name, buf) + _UniffiFfiConverterSequenceTypeTestResult.write(value.results, buf) + _UniffiFfiConverterBoolean.write(value.all_passed, buf) + _UniffiFfiConverterUInt64.write(value.total_duration_ms, buf) + + + +class _UniffiFfiConverterOptionalTypeABIReturn(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeABIReturn.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeABIReturn.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeABIReturn.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + +@dataclass +class TransactionResult: + def __init__(self, *, transaction:algokit_transact.Transaction, transaction_id:str, confirmation:algod_client_ffi.PendingTransactionResponse, abi_return:typing.Optional[AbiReturn]): + self.transaction = transaction + self.transaction_id = transaction_id + self.confirmation = confirmation + self.abi_return = abi_return + + + + + def __str__(self): + return "TransactionResult(transaction={}, transaction_id={}, confirmation={}, abi_return={})".format(self.transaction, self.transaction_id, self.confirmation, self.abi_return) + def __eq__(self, other): + if self.transaction != other.transaction: + return False + if self.transaction_id != other.transaction_id: + return False + if self.confirmation != other.confirmation: + return False + if self.abi_return != other.abi_return: + return False + return True + +class _UniffiFfiConverterTypeTransactionResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionResult( + transaction=algokit_transact._UniffiFfiConverterTypeTransaction.read(buf), + transaction_id=_UniffiFfiConverterString.read(buf), + confirmation=algod_client_ffi._UniffiFfiConverterTypePendingTransactionResponse.read(buf), + abi_return=_UniffiFfiConverterOptionalTypeABIReturn.read(buf), + ) + + @staticmethod + def check_lower(value): + algokit_transact._UniffiFfiConverterTypeTransaction.check_lower(value.transaction) + _UniffiFfiConverterString.check_lower(value.transaction_id) + algod_client_ffi._UniffiFfiConverterTypePendingTransactionResponse.check_lower(value.confirmation) + _UniffiFfiConverterOptionalTypeABIReturn.check_lower(value.abi_return) + + @staticmethod + def write(value, buf): + algokit_transact._UniffiFfiConverterTypeTransaction.write(value.transaction, buf) + _UniffiFfiConverterString.write(value.transaction_id, buf) + algod_client_ffi._UniffiFfiConverterTypePendingTransactionResponse.write(value.confirmation, buf) + _UniffiFfiConverterOptionalTypeABIReturn.write(value.abi_return, buf) + +class _UniffiFfiConverterSequenceTypeTransactionResult(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeTransactionResult.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeTransactionResult.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeTransactionResult.read(buf) for i in range(count) + ] + +@dataclass +class TransactionComposerSendResult: + def __init__(self, *, group:typing.Optional[bytes], results:typing.List[TransactionResult]): + self.group = group + self.results = results + + + + + def __str__(self): + return "TransactionComposerSendResult(group={}, results={})".format(self.group, self.results) + def __eq__(self, other): + if self.group != other.group: + return False + if self.results != other.results: + return False + return True + +class _UniffiFfiConverterTypeTransactionComposerSendResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionComposerSendResult( + group=_UniffiFfiConverterOptionalBytes.read(buf), + results=_UniffiFfiConverterSequenceTypeTransactionResult.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterOptionalBytes.check_lower(value.group) + _UniffiFfiConverterSequenceTypeTransactionResult.check_lower(value.results) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterOptionalBytes.write(value.group, buf) + _UniffiFfiConverterSequenceTypeTransactionResult.write(value.results, buf) + +@dataclass +class TransactionInfo: + def __init__(self, *, tx_id:str, confirmed_round:typing.Optional[int], asset_id:typing.Optional[int], app_id:typing.Optional[int]): + self.tx_id = tx_id + self.confirmed_round = confirmed_round + self.asset_id = asset_id + self.app_id = app_id + + + + + def __str__(self): + return "TransactionInfo(tx_id={}, confirmed_round={}, asset_id={}, app_id={})".format(self.tx_id, self.confirmed_round, self.asset_id, self.app_id) + def __eq__(self, other): + if self.tx_id != other.tx_id: + return False + if self.confirmed_round != other.confirmed_round: + return False + if self.asset_id != other.asset_id: + return False + if self.app_id != other.app_id: + return False + return True + +class _UniffiFfiConverterTypeTransactionInfo(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionInfo( + tx_id=_UniffiFfiConverterString.read(buf), + confirmed_round=_UniffiFfiConverterOptionalUInt64.read(buf), + asset_id=_UniffiFfiConverterOptionalUInt64.read(buf), + app_id=_UniffiFfiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiFfiConverterString.check_lower(value.tx_id) + _UniffiFfiConverterOptionalUInt64.check_lower(value.confirmed_round) + _UniffiFfiConverterOptionalUInt64.check_lower(value.asset_id) + _UniffiFfiConverterOptionalUInt64.check_lower(value.app_id) + + @staticmethod + def write(value, buf): + _UniffiFfiConverterString.write(value.tx_id, buf) + _UniffiFfiConverterOptionalUInt64.write(value.confirmed_round, buf) + _UniffiFfiConverterOptionalUInt64.write(value.asset_id, buf) + _UniffiFfiConverterOptionalUInt64.write(value.app_id, buf) + + +class StructFieldProtocol(typing.Protocol): + """ + Represents a field in a struct +""" + + pass + +class StructField(StructFieldProtocol): + """ + Represents a field in a struct +""" + + _handle: ctypes.c_uint64 + def __init__(self, name: str,field_type: StructFieldType): + + _UniffiFfiConverterString.check_lower(name) + + _UniffiFfiConverterTypeStructFieldType.check_lower(field_type) + _uniffi_lowered_args = ( + _UniffiFfiConverterString.lower(name), + _UniffiFfiConverterTypeStructFieldType.lower(field_type), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeStructField.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_structfield_new, + *_uniffi_lowered_args, + ) + self._handle = _uniffi_ffi_result + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_structfield, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_structfield, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + + + + + +class _UniffiFfiConverterTypeStructField: + @staticmethod + def lift(value: int) -> StructField: + return StructField._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: StructField): + if not isinstance(value, StructField): + raise TypeError("Expected StructField instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: StructField) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> StructField: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: StructField, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + +class _UniffiFfiConverterSequenceTypeStructField(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeStructField.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeStructField.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeStructField.read(buf) for i in range(count) + ] + + + + + + +class StructFieldType: + def __init__(self): + raise RuntimeError("StructFieldType cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + @dataclass + class TYPE: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"StructFieldType.TYPE{self._values!r}" + def __eq__(self, other): + if not other.is_TYPE(): + return False + return self._values == other._values + + @dataclass + class FIELDS: + + def __init__(self, *values): + if len(values) != 1: + raise TypeError(f"Expected 1 arguments, found {len(values)}") + self._values = values + + def __getitem__(self, index): + return self._values[index] + + + + + + + def __str__(self): + return f"StructFieldType.FIELDS{self._values!r}" + def __eq__(self, other): + if not other.is_FIELDS(): + return False + return self._values == other._values + + + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking + # whether an instance is that variant. + def is_TYPE(self) -> bool: + return isinstance(self, StructFieldType.TYPE) + def is_type(self) -> bool: + return isinstance(self, StructFieldType.TYPE) + def is_FIELDS(self) -> bool: + return isinstance(self, StructFieldType.FIELDS) + def is_fields(self) -> bool: + return isinstance(self, StructFieldType.FIELDS) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +StructFieldType.TYPE = type("StructFieldType.TYPE", (StructFieldType.TYPE, StructFieldType,), {}) # type: ignore +StructFieldType.FIELDS = type("StructFieldType.FIELDS", (StructFieldType.FIELDS, StructFieldType,), {}) # type: ignore + + + + +class _UniffiFfiConverterTypeStructFieldType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return StructFieldType.TYPE( + _UniffiFfiConverterTypeABIType.read(buf), + ) + if variant == 2: + return StructFieldType.FIELDS( + _UniffiFfiConverterSequenceTypeStructField.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_TYPE(): + _UniffiFfiConverterTypeABIType.check_lower(value._values[0]) + return + if value.is_FIELDS(): + _UniffiFfiConverterSequenceTypeStructField.check_lower(value._values[0]) + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value.is_TYPE(): + buf.write_i32(1) + _UniffiFfiConverterTypeABIType.write(value._values[0], buf) + if value.is_FIELDS(): + buf.write_i32(2) + _UniffiFfiConverterSequenceTypeStructField.write(value._values[0], buf) + + + + +class AbiStructProtocol(typing.Protocol): + + pass + +class AbiStruct(AbiStructProtocol): + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_abistruct, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_abistruct, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + + + + + +class _UniffiFfiConverterTypeABIStruct: + @staticmethod + def lift(value: int) -> AbiStruct: + return AbiStruct._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: AbiStruct): + if not isinstance(value, AbiStruct): + raise TypeError("Expected AbiStruct instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: AbiStruct) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> AbiStruct: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: AbiStruct, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class ComposerTrait(): + + async def build(self, ) -> None: + raise NotImplementedError + async def send(self, ) -> TransactionComposerSendResult: + raise NotImplementedError + async def wait_for_confirmation(self, tx_id: str,max_rounds_to_wait: int) -> algod_client_ffi.PendingTransactionResponse: + raise NotImplementedError + def add_payment(self, params: PaymentParams) -> None: + raise NotImplementedError + def add_asset_create(self, params: AssetCreateParams) -> None: + raise NotImplementedError + def add_asset_config(self, params: AssetConfigParams) -> None: + raise NotImplementedError + def add_asset_destroy(self, params: AssetDestroyParams) -> None: + raise NotImplementedError + def add_asset_freeze(self, params: AssetFreezeParams) -> None: + raise NotImplementedError + def add_asset_unfreeze(self, params: AssetUnfreezeParams) -> None: + raise NotImplementedError + def add_asset_transfer(self, params: AssetTransferParams) -> None: + raise NotImplementedError + def add_asset_opt_in(self, params: AssetOptInParams) -> None: + raise NotImplementedError + def add_asset_opt_out(self, params: AssetOptOutParams) -> None: + raise NotImplementedError + def add_asset_clawback(self, params: AssetClawbackParams) -> None: + raise NotImplementedError + def add_app_create(self, params: AppCreateParams) -> None: + raise NotImplementedError + def add_app_call(self, params: AppCallParams) -> None: + raise NotImplementedError + def add_app_update(self, params: AppUpdateParams) -> None: + raise NotImplementedError + def add_app_delete(self, params: AppDeleteParams) -> None: + raise NotImplementedError + def add_app_call_method_call(self, params: AppCallMethodCallParams) -> None: + raise NotImplementedError + def add_app_create_method_call(self, params: AppCreateMethodCallParams) -> None: + raise NotImplementedError + def add_app_update_method_call(self, params: AppUpdateMethodCallParams) -> None: + raise NotImplementedError + def add_app_delete_method_call(self, params: AppDeleteMethodCallParams) -> None: + raise NotImplementedError + +class ComposerTraitImpl(ComposerTrait): + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composertrait, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composertrait, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + async def build(self, ) -> None: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_build(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_void, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_void, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def send(self, ) -> TransactionComposerSendResult: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionComposerSendResult.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_send(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def wait_for_confirmation(self, tx_id: str,max_rounds_to_wait: int) -> algod_client_ffi.PendingTransactionResponse: + + _UniffiFfiConverterString.check_lower(tx_id) + + _UniffiFfiConverterUInt32.check_lower(max_rounds_to_wait) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(tx_id), + _UniffiFfiConverterUInt32.lower(max_rounds_to_wait), + ) + _uniffi_lift_return = algod_client_ffi._UniffiFfiConverterTypePendingTransactionResponse.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_wait_for_confirmation(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + def add_payment(self, params: PaymentParams) -> None: + + _UniffiFfiConverterTypePaymentParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypePaymentParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_payment, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_create(self, params: AssetCreateParams) -> None: + + _UniffiFfiConverterTypeAssetCreateParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetCreateParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_create, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_config(self, params: AssetConfigParams) -> None: + + _UniffiFfiConverterTypeAssetConfigParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetConfigParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_config, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_destroy(self, params: AssetDestroyParams) -> None: + + _UniffiFfiConverterTypeAssetDestroyParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetDestroyParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_destroy, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_freeze(self, params: AssetFreezeParams) -> None: + + _UniffiFfiConverterTypeAssetFreezeParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetFreezeParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_freeze, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_unfreeze(self, params: AssetUnfreezeParams) -> None: + + _UniffiFfiConverterTypeAssetUnfreezeParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetUnfreezeParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_unfreeze, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_transfer(self, params: AssetTransferParams) -> None: + + _UniffiFfiConverterTypeAssetTransferParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetTransferParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_transfer, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_opt_in(self, params: AssetOptInParams) -> None: + + _UniffiFfiConverterTypeAssetOptInParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetOptInParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_opt_in, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_opt_out(self, params: AssetOptOutParams) -> None: + + _UniffiFfiConverterTypeAssetOptOutParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetOptOutParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_opt_out, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_clawback(self, params: AssetClawbackParams) -> None: + + _UniffiFfiConverterTypeAssetClawbackParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetClawbackParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_asset_clawback, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_create(self, params: AppCreateParams) -> None: + + _UniffiFfiConverterTypeAppCreateParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCreateParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_create, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_call(self, params: AppCallParams) -> None: + + _UniffiFfiConverterTypeAppCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_update(self, params: AppUpdateParams) -> None: + + _UniffiFfiConverterTypeAppUpdateParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppUpdateParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_update, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_delete(self, params: AppDeleteParams) -> None: + + _UniffiFfiConverterTypeAppDeleteParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppDeleteParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_delete, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_call_method_call(self, params: AppCallMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppCallMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCallMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_call_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_create_method_call(self, params: AppCreateMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppCreateMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCreateMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_create_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_update_method_call(self, params: AppUpdateMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppUpdateMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppUpdateMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_update_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_delete_method_call(self, params: AppDeleteMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppDeleteMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppDeleteMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composertrait_add_app_delete_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + + +# Put all the bits inside a class to keep the top-level namespace clean +class _UniffiTraitImplComposerTraitImpl: + # For each method, generate a callback function to pass to Rust + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD0 + def build( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.build + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultVoid( + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD1 + def send( + uniffi_handle, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.send + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiFfiConverterTypeTransactionComposerSendResult.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultRustBuffer( + _UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD2 + def wait_for_confirmation( + uniffi_handle, + tx_id, + max_rounds_to_wait, + uniffi_future_callback, + uniffi_callback_data, + uniffi_out_dropped_callback, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(tx_id), _UniffiFfiConverterUInt32.lift(max_rounds_to_wait), ) + uniffi_method = uniffi_obj.wait_for_confirmation + return uniffi_method(*uniffi_args) + def handle_success(return_value): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultalgodClientFfiRustBuffer( + algod_client_ffi._UniffiFfiConverterTypePendingTransactionResponse.lower(return_value), + _UniffiRustCallStatus.default() + ) + ) + + def handle_error(status_code, rust_buffer): + uniffi_future_callback( + uniffi_callback_data, + _UniffiForeignFutureResultalgodClientFfiRustBuffer( + algod_client_ffi._UniffiRustBuffer.default(), + _UniffiRustCallStatus(status_code, rust_buffer), + ) + ) + _uniffi_trait_interface_call_async_with_error( + make_call, + uniffi_out_dropped_callback, + handle_success, + handle_error, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD3 + def add_payment( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypePaymentParams.lift(params), ) + uniffi_method = uniffi_obj.add_payment + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD4 + def add_asset_create( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetCreateParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_create + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD5 + def add_asset_config( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetConfigParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_config + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD6 + def add_asset_destroy( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetDestroyParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_destroy + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD7 + def add_asset_freeze( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetFreezeParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_freeze + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD8 + def add_asset_unfreeze( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetUnfreezeParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_unfreeze + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD9 + def add_asset_transfer( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetTransferParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_transfer + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD10 + def add_asset_opt_in( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetOptInParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_opt_in + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD11 + def add_asset_opt_out( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetOptOutParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_opt_out + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD12 + def add_asset_clawback( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAssetClawbackParams.lift(params), ) + uniffi_method = uniffi_obj.add_asset_clawback + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD13 + def add_app_create( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppCreateParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_create + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD14 + def add_app_call( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppCallParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_call + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD15 + def add_app_update( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppUpdateParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_update + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD16 + def add_app_delete( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppDeleteParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_delete + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD17 + def add_app_call_method_call( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppCallMethodCallParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_call_method_call + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD18 + def add_app_create_method_call( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppCreateMethodCallParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_create_method_call + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD19 + def add_app_update_method_call( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppUpdateMethodCallParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_update_method_call + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT_METHOD20 + def add_app_delete_method_call( + uniffi_handle, + params, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerTrait._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterTypeAppDeleteMethodCallParams.lift(params), ) + uniffi_method = uniffi_obj.add_app_delete_method_call + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT + def _uniffi_free(uniffi_handle): + _UniffiFfiConverterTypeComposerTrait._handle_map.remove(uniffi_handle) + + @_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_COMPOSER_TRAIT + def _uniffi_clone(uniffi_handle): + return _UniffiFfiConverterTypeComposerTrait._handle_map.clone(uniffi_handle) + + # Generate the FFI VTable. This has a field for each callback interface method. + _uniffi_vtable = _UniffiVTableCallbackInterfaceAlgokitUtilsFfiComposerTrait( + _uniffi_free, + _uniffi_clone, + build, + send, + wait_for_confirmation, + add_payment, + add_asset_create, + add_asset_config, + add_asset_destroy, + add_asset_freeze, + add_asset_unfreeze, + add_asset_transfer, + add_asset_opt_in, + add_asset_opt_out, + add_asset_clawback, + add_app_create, + add_app_call, + add_app_update, + add_app_delete, + add_app_call_method_call, + add_app_create_method_call, + add_app_update_method_call, + add_app_delete_method_call, + ) + # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever, + # or else bad things will happen when Rust tries to access it. + _UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_composertrait(ctypes.byref(_uniffi_vtable)) + +class _UniffiFfiConverterTypeComposerTrait: + _handle_map = _UniffiHandleMap() + + @staticmethod + def lift(value: int): + if (value & 1) == 0: + # Rust-generated handle, construct a new class that uses the handle to implement the + # interface + return ComposerTraitImpl._uniffi_make_instance(value) + else: + # Python-generated handle, get the object from the handle map + return _UniffiFfiConverterTypeComposerTrait._handle_map.remove(value) + + @staticmethod + def check_lower(value: ComposerTrait): + if not isinstance(value, ComposerTrait): + raise TypeError("Expected ComposerTrait subclass, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: ComposerTrait): + if isinstance(value, ComposerTraitImpl): + # Rust-implementated object. Clone the handle and return it + return value._uniffi_clone_handle() + else: + # Python-implementated object, generate a new vtable handle and return that. + return _UniffiFfiConverterTypeComposerTrait._handle_map.insert(value) + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: ComposerTrait, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class ComposerProtocol(typing.Protocol): + + def add_app_call(self, params: AppCallParams) -> None: + raise NotImplementedError + def add_app_call_method_call(self, params: AppCallMethodCallParams) -> None: + raise NotImplementedError + def add_app_create(self, params: AppCreateParams) -> None: + raise NotImplementedError + def add_app_create_method_call(self, params: AppCreateMethodCallParams) -> None: + raise NotImplementedError + def add_app_delete(self, params: AppDeleteParams) -> None: + raise NotImplementedError + def add_app_delete_method_call(self, params: AppDeleteMethodCallParams) -> None: + raise NotImplementedError + def add_app_update(self, params: AppUpdateParams) -> None: + raise NotImplementedError + def add_app_update_method_call(self, params: AppUpdateMethodCallParams) -> None: + raise NotImplementedError + def add_asset_clawback(self, params: AssetClawbackParams) -> None: + raise NotImplementedError + def add_asset_config(self, params: AssetConfigParams) -> None: + raise NotImplementedError + def add_asset_create(self, params: AssetCreateParams) -> None: + raise NotImplementedError + def add_asset_destroy(self, params: AssetDestroyParams) -> None: + raise NotImplementedError + def add_asset_freeze(self, params: AssetFreezeParams) -> None: + raise NotImplementedError + def add_asset_opt_in(self, params: AssetOptInParams) -> None: + raise NotImplementedError + def add_asset_opt_out(self, params: AssetOptOutParams) -> None: + raise NotImplementedError + def add_asset_transfer(self, params: AssetTransferParams) -> None: + raise NotImplementedError + def add_asset_unfreeze(self, params: AssetUnfreezeParams) -> None: + raise NotImplementedError + def add_payment(self, params: PaymentParams) -> None: + raise NotImplementedError + async def build(self, ) -> None: + raise NotImplementedError + async def send(self, ) -> TransactionComposerSendResult: + raise NotImplementedError + async def wait_for_confirmation(self, tx_id: str,max_rounds_to_wait: int) -> algod_client_ffi.PendingTransactionResponse: + raise NotImplementedError + +class Composer(ComposerProtocol, ComposerTrait): + + _handle: ctypes.c_uint64 + def __init__(self, algod_client: algod_client_ffi.AlgodClient,signer_getter: TransactionSignerGetter): + + algod_client_ffi._UniffiFfiConverterTypeAlgodClient.check_lower(algod_client) + + _UniffiFfiConverterTypeTransactionSignerGetter.check_lower(signer_getter) + _uniffi_lowered_args = ( + algod_client_ffi._UniffiFfiConverterTypeAlgodClient.lower(algod_client), + _UniffiFfiConverterTypeTransactionSignerGetter.lower(signer_getter), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeComposer.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_composer_new, + *_uniffi_lowered_args, + ) + self._handle = _uniffi_ffi_result + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composer, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composer, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + def add_app_call(self, params: AppCallParams) -> None: + + _UniffiFfiConverterTypeAppCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_call_method_call(self, params: AppCallMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppCallMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCallMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_call_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_create(self, params: AppCreateParams) -> None: + + _UniffiFfiConverterTypeAppCreateParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCreateParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_create, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_create_method_call(self, params: AppCreateMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppCreateMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppCreateMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_create_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_delete(self, params: AppDeleteParams) -> None: + + _UniffiFfiConverterTypeAppDeleteParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppDeleteParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_delete, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_delete_method_call(self, params: AppDeleteMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppDeleteMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppDeleteMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_delete_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_update(self, params: AppUpdateParams) -> None: + + _UniffiFfiConverterTypeAppUpdateParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppUpdateParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_update, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_app_update_method_call(self, params: AppUpdateMethodCallParams) -> None: + + _UniffiFfiConverterTypeAppUpdateMethodCallParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAppUpdateMethodCallParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_app_update_method_call, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_clawback(self, params: AssetClawbackParams) -> None: + + _UniffiFfiConverterTypeAssetClawbackParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetClawbackParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_clawback, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_config(self, params: AssetConfigParams) -> None: + + _UniffiFfiConverterTypeAssetConfigParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetConfigParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_config, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_create(self, params: AssetCreateParams) -> None: + + _UniffiFfiConverterTypeAssetCreateParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetCreateParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_create, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_destroy(self, params: AssetDestroyParams) -> None: + + _UniffiFfiConverterTypeAssetDestroyParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetDestroyParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_destroy, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_freeze(self, params: AssetFreezeParams) -> None: + + _UniffiFfiConverterTypeAssetFreezeParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetFreezeParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_freeze, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_opt_in(self, params: AssetOptInParams) -> None: + + _UniffiFfiConverterTypeAssetOptInParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetOptInParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_opt_in, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_opt_out(self, params: AssetOptOutParams) -> None: + + _UniffiFfiConverterTypeAssetOptOutParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetOptOutParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_opt_out, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_transfer(self, params: AssetTransferParams) -> None: + + _UniffiFfiConverterTypeAssetTransferParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetTransferParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_transfer, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_asset_unfreeze(self, params: AssetUnfreezeParams) -> None: + + _UniffiFfiConverterTypeAssetUnfreezeParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeAssetUnfreezeParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_asset_unfreeze, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def add_payment(self, params: PaymentParams) -> None: + + _UniffiFfiConverterTypePaymentParams.check_lower(params) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypePaymentParams.lower(params), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_add_payment, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + async def build(self, ) -> None: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_build(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_void, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_void, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_void, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def send(self, ) -> TransactionComposerSendResult: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionComposerSendResult.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_send(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + async def wait_for_confirmation(self, tx_id: str,max_rounds_to_wait: int) -> algod_client_ffi.PendingTransactionResponse: + + _UniffiFfiConverterString.check_lower(tx_id) + + _UniffiFfiConverterUInt32.check_lower(max_rounds_to_wait) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(tx_id), + _UniffiFfiConverterUInt32.lower(max_rounds_to_wait), + ) + _uniffi_lift_return = algod_client_ffi._UniffiFfiConverterTypePendingTransactionResponse.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composer_wait_for_confirmation(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + + + + + +class _UniffiFfiConverterTypeComposer: + @staticmethod + def lift(value: int) -> Composer: + return Composer._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: Composer): + if not isinstance(value, Composer): + raise TypeError("Expected Composer instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: Composer) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> Composer: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: Composer, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class ComposerFactory(): + + def create_composer(self, ) -> ComposerTrait: + raise NotImplementedError + +class ComposerFactoryImpl(ComposerFactory): + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_composerfactory, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_composerfactory, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + def create_composer(self, ) -> ComposerTrait: + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeComposerTrait.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_composerfactory_create_composer, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + + +# Put all the bits inside a class to keep the top-level namespace clean +class _UniffiTraitImplComposerFactoryImpl: + # For each method, generate a callback function to pass to Rust + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY_METHOD0 + def create_composer( + uniffi_handle, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeComposerFactory._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = () + uniffi_method = uniffi_obj.create_composer + return uniffi_method(*uniffi_args) + def write_return_value(v): + uniffi_out_return[0] = _UniffiFfiConverterTypeComposerTrait.lower(v) + _uniffi_trait_interface_call( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + ) + + @_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY + def _uniffi_free(uniffi_handle): + _UniffiFfiConverterTypeComposerFactory._handle_map.remove(uniffi_handle) + + @_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_COMPOSER_FACTORY + def _uniffi_clone(uniffi_handle): + return _UniffiFfiConverterTypeComposerFactory._handle_map.clone(uniffi_handle) + + # Generate the FFI VTable. This has a field for each callback interface method. + _uniffi_vtable = _UniffiVTableCallbackInterfaceAlgokitUtilsFfiComposerFactory( + _uniffi_free, + _uniffi_clone, + create_composer, + ) + # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever, + # or else bad things will happen when Rust tries to access it. + _UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_composerfactory(ctypes.byref(_uniffi_vtable)) + +class _UniffiFfiConverterTypeComposerFactory: + _handle_map = _UniffiHandleMap() + + @staticmethod + def lift(value: int): + if (value & 1) == 0: + # Rust-generated handle, construct a new class that uses the handle to implement the + # interface + return ComposerFactoryImpl._uniffi_make_instance(value) + else: + # Python-generated handle, get the object from the handle map + return _UniffiFfiConverterTypeComposerFactory._handle_map.remove(value) + + @staticmethod + def check_lower(value: ComposerFactory): + if not isinstance(value, ComposerFactory): + raise TypeError("Expected ComposerFactory subclass, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: ComposerFactory): + if isinstance(value, ComposerFactoryImpl): + # Rust-implementated object. Clone the handle and return it + return value._uniffi_clone_handle() + else: + # Python-implementated object, generate a new vtable handle and return that. + return _UniffiFfiConverterTypeComposerFactory._handle_map.insert(value) + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: ComposerFactory, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class DefaultComposerFactoryProtocol(typing.Protocol): + + pass + +class DefaultComposerFactory(DefaultComposerFactoryProtocol): + + _handle: ctypes.c_uint64 + def __init__(self, algod_client: algod_client_ffi.AlgodClient,signer_getter: TransactionSignerGetter): + + algod_client_ffi._UniffiFfiConverterTypeAlgodClient.check_lower(algod_client) + + _UniffiFfiConverterTypeTransactionSignerGetter.check_lower(signer_getter) + _uniffi_lowered_args = ( + algod_client_ffi._UniffiFfiConverterTypeAlgodClient.lower(algod_client), + _UniffiFfiConverterTypeTransactionSignerGetter.lower(signer_getter), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeDefaultComposerFactory.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_constructor_defaultcomposerfactory_new, + *_uniffi_lowered_args, + ) + self._handle = _uniffi_ffi_result + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_defaultcomposerfactory, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_defaultcomposerfactory, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + + + + + +class _UniffiFfiConverterTypeDefaultComposerFactory: + @staticmethod + def lift(value: int) -> DefaultComposerFactory: + return DefaultComposerFactory._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: DefaultComposerFactory): + if not isinstance(value, DefaultComposerFactory): + raise TypeError("Expected DefaultComposerFactory instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: DefaultComposerFactory) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> DefaultComposerFactory: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: DefaultComposerFactory, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + +class _UniffiFfiConverterOptionalTypeTestAccount(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiFfiConverterTypeTestAccount.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiFfiConverterTypeTestAccount.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiFfiConverterTypeTestAccount.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + +class TestFixtureProtocol(typing.Protocol): + """ + Test fixture that provides high-level test operations using foreign traits + This enables test orchestration in Rust while delegating I/O to target languages +""" + + async def create_test_asset(self, creator: TestAccount,freeze_manager: typing.Optional[TestAccount]) -> int: + """ + Create a test asset with optional freeze manager + Returns the asset ID +""" + raise NotImplementedError + def dispenser_account(self, ) -> TestAccount: + """ + Get the dispenser account (useful for tests) +""" + raise NotImplementedError + async def fund_account(self, account: TestAccount,amount: int) -> str: + """ + Fund an account with ALGO from the dispenser + Uses the composer factory to create a fresh composer for this operation +""" + raise NotImplementedError + def generate_account(self, ) -> TestAccount: + """ + Generate a new test account and register it with the signer getter +""" + raise NotImplementedError + +class TestFixture(TestFixtureProtocol): + """ + Test fixture that provides high-level test operations using foreign traits + This enables test orchestration in Rust while delegating I/O to target languages +""" + + _handle: ctypes.c_uint64 + def __init__(self, *args, **kw): + raise ValueError("async constructors not supported.") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_testfixture, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_testfixture, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + async def create_test_asset(self, creator: TestAccount,freeze_manager: typing.Optional[TestAccount]) -> int: + """ + Create a test asset with optional freeze manager + Returns the asset ID +""" + + _UniffiFfiConverterTypeTestAccount.check_lower(creator) + + _UniffiFfiConverterOptionalTypeTestAccount.check_lower(freeze_manager) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeTestAccount.lower(creator), + _UniffiFfiConverterOptionalTypeTestAccount.lower(freeze_manager), + ) + _uniffi_lift_return = _UniffiFfiConverterUInt64.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_create_test_asset(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_u64, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_u64, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_u64, + _uniffi_lift_return, + _uniffi_error_converter, + ) + def dispenser_account(self, ) -> TestAccount: + """ + Get the dispenser account (useful for tests) +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTestAccount.lift + _uniffi_error_converter = None + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_dispenser_account, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + async def fund_account(self, account: TestAccount,amount: int) -> str: + """ + Fund an account with ALGO from the dispenser + Uses the composer factory to create a fresh composer for this operation +""" + + _UniffiFfiConverterTypeTestAccount.check_lower(account) + + _UniffiFfiConverterUInt64.check_lower(amount) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterTypeTestAccount.lower(account), + _UniffiFfiConverterUInt64.lower(amount), + ) + _uniffi_lift_return = _UniffiFfiConverterString.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_fund_account(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + def generate_account(self, ) -> TestAccount: + """ + Generate a new test account and register it with the signer getter +""" + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTestAccount.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_testfixture_generate_account, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + + + +class _UniffiFfiConverterTypeTestFixture: + @staticmethod + def lift(value: int) -> TestFixture: + return TestFixture._uniffi_make_instance(value) + + @staticmethod + def check_lower(value: TestFixture): + if not isinstance(value, TestFixture): + raise TypeError("Expected TestFixture instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TestFixture) -> ctypes.c_uint64: + return value._uniffi_clone_handle() + + @classmethod + def read(cls, buf: _UniffiRustBuffer) -> TestFixture: + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TestFixture, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class TransactionSignerGetter(): + + def get_signer(self, address: str) -> TransactionSigner: + raise NotImplementedError + def register_account(self, address: str,mnemonic: str) -> None: + """ + Register an account with the signer getter + This allows test fixtures to register accounts so they can be retrieved later via get_signer +""" + raise NotImplementedError + +class TransactionSignerGetterImpl(TransactionSignerGetter): + + _handle: ctypes.c_uint64 + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + handle = getattr(self, "_handle", None) + if handle is not None: + _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_free_transactionsignergetter, handle) + + def _uniffi_clone_handle(self): + return _uniffi_rust_call(_UniffiLib.uniffi_algokit_utils_ffi_fn_clone_transactionsignergetter, self._handle) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _uniffi_make_instance(cls, handle): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required handle. + inst = cls.__new__(cls) + inst._handle = handle + return inst + def get_signer(self, address: str) -> TransactionSigner: + + _UniffiFfiConverterString.check_lower(address) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTransactionSigner.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsignergetter_get_signer, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + def register_account(self, address: str,mnemonic: str) -> None: + """ + Register an account with the signer getter + This allows test fixtures to register accounts so they can be retrieved later via get_signer +""" + + _UniffiFfiConverterString.check_lower(address) + + _UniffiFfiConverterString.check_lower(mnemonic) + _uniffi_lowered_args = ( + self._uniffi_clone_handle(), + _UniffiFfiConverterString.lower(address), + _UniffiFfiConverterString.lower(mnemonic), + ) + _uniffi_lift_return = lambda val: None + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + _uniffi_ffi_result = _uniffi_rust_call_with_error( + _uniffi_error_converter, + _UniffiLib.uniffi_algokit_utils_ffi_fn_method_transactionsignergetter_register_account, + *_uniffi_lowered_args, + ) + return _uniffi_lift_return(_uniffi_ffi_result) + + + + +# Put all the bits inside a class to keep the top-level namespace clean +class _UniffiTraitImplTransactionSignerGetterImpl: + # For each method, generate a callback function to pass to Rust + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER_METHOD0 + def get_signer( + uniffi_handle, + address, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeTransactionSignerGetter._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), ) + uniffi_method = uniffi_obj.get_signer + return uniffi_method(*uniffi_args) + def write_return_value(v): + uniffi_out_return[0] = _UniffiFfiConverterTypeTransactionSigner.lower(v) + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER_METHOD1 + def register_account( + uniffi_handle, + address, + mnemonic, + uniffi_out_return, + uniffi_call_status_ptr, + ): + uniffi_obj = _UniffiFfiConverterTypeTransactionSignerGetter._handle_map.get(uniffi_handle) + def make_call(): + uniffi_args = (_UniffiFfiConverterString.lift(address), _UniffiFfiConverterString.lift(mnemonic), ) + uniffi_method = uniffi_obj.register_account + return uniffi_method(*uniffi_args) + write_return_value = lambda v: None + _uniffi_trait_interface_call_with_error( + uniffi_call_status_ptr.contents, + make_call, + write_return_value, + UtilsError, + _UniffiFfiConverterTypeUtilsError.lower, + ) + + @_UNIFFI_CALLBACK_INTERFACE_FREE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER + def _uniffi_free(uniffi_handle): + _UniffiFfiConverterTypeTransactionSignerGetter._handle_map.remove(uniffi_handle) + + @_UNIFFI_CALLBACK_INTERFACE_CLONE_ALGOKIT_UTILS_FFI_TRANSACTION_SIGNER_GETTER + def _uniffi_clone(uniffi_handle): + return _UniffiFfiConverterTypeTransactionSignerGetter._handle_map.clone(uniffi_handle) + + # Generate the FFI VTable. This has a field for each callback interface method. + _uniffi_vtable = _UniffiVTableCallbackInterfaceAlgokitUtilsFfiTransactionSignerGetter( + _uniffi_free, + _uniffi_clone, + get_signer, + register_account, + ) + # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever, + # or else bad things will happen when Rust tries to access it. + _UniffiLib.uniffi_algokit_utils_ffi_fn_init_callback_vtable_transactionsignergetter(ctypes.byref(_uniffi_vtable)) + +class _UniffiFfiConverterTypeTransactionSignerGetter: + _handle_map = _UniffiHandleMap() + + @staticmethod + def lift(value: int): + if (value & 1) == 0: + # Rust-generated handle, construct a new class that uses the handle to implement the + # interface + return TransactionSignerGetterImpl._uniffi_make_instance(value) + else: + # Python-generated handle, get the object from the handle map + return _UniffiFfiConverterTypeTransactionSignerGetter._handle_map.remove(value) + + @staticmethod + def check_lower(value: TransactionSignerGetter): + if not isinstance(value, TransactionSignerGetter): + raise TypeError("Expected TransactionSignerGetter subclass, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionSignerGetter): + if isinstance(value, TransactionSignerGetterImpl): + # Rust-implementated object. Clone the handle and return it + return value._uniffi_clone_handle() + else: + # Python-implementated object, generate a new vtable handle and return that. + return _UniffiFfiConverterTypeTransactionSignerGetter._handle_map.insert(value) + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw handle value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TransactionSignerGetter, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class _UniffiFfiConverterUInt16(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u16" + VALUE_MIN = 0 + VALUE_MAX = 2**16 + + @staticmethod + def read(buf): + return buf.read_u16() + + @staticmethod + def write(value, buf): + buf.write_u16(value) + +class _UniffiFfiConverterSequenceTypeABIType(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiFfiConverterTypeABIType.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiFfiConverterTypeABIType.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiFfiConverterTypeABIType.read(buf) for i in range(count) + ] + + +async def run_asset_freeze_test_suite(algod_client: algod_client_ffi.AlgodClientTrait,composer_factory: ComposerFactory,signer_getter: TransactionSignerGetter) -> TestSuiteResult: + """ + Run the complete asset freeze test suite + This is the main entry point called from Python/Swift/Kotlin +""" + + algod_client_ffi._UniffiFfiConverterTypeAlgodClientTrait.check_lower(algod_client) + + _UniffiFfiConverterTypeComposerFactory.check_lower(composer_factory) + + _UniffiFfiConverterTypeTransactionSignerGetter.check_lower(signer_getter) + _uniffi_lowered_args = ( + algod_client_ffi._UniffiFfiConverterTypeAlgodClientTrait.lower(algod_client), + _UniffiFfiConverterTypeComposerFactory.lower(composer_factory), + _UniffiFfiConverterTypeTransactionSignerGetter.lower(signer_getter), + ) + _uniffi_lift_return = _UniffiFfiConverterTypeTestSuiteResult.lift + _uniffi_error_converter = _UniffiFfiConverterTypeUtilsError + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_algokit_utils_ffi_fn_func_run_asset_freeze_test_suite(*_uniffi_lowered_args), + _UniffiLib.ffi_algokit_utils_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_algokit_utils_ffi_rust_future_free_rust_buffer, + _uniffi_lift_return, + _uniffi_error_converter, + ) + +__all__ = [ + "InternalError", + "UtilsError", + "AbiTransactionType", + "AbiReferenceType", + "AbiMethodArgType", + "AbiReferenceValue", + "AppMethodCallArg", + "StructFieldType", + "AbiMethodArg", + "AbiMethod", + "AbiReturn", + "AccountCloseParams", + "AccountInfo", + "AppCreateParams", + "AppUpdateParams", + "AppDeleteParams", + "AppCreateMethodCallParams", + "AppUpdateMethodCallParams", + "AppDeleteMethodCallParams", + "TransactionWithSigner", + "PaymentParams", + "AssetTransferParams", + "AssetOptInParams", + "AssetOptOutParams", + "AssetClawbackParams", + "AssetCreateParams", + "AssetConfigParams", + "AssetDestroyParams", + "AssetFreezeParams", + "AssetUnfreezeParams", + "AppCallParams", + "OnlineKeyRegistrationParams", + "OfflineKeyRegistrationParams", + "NonParticipationKeyRegistrationParams", + "AppCallMethodCallParams", + "CommonParams", + "SuggestedParams", + "TestAccount", + "TestResult", + "TestSuiteResult", + "TransactionResult", + "TransactionComposerSendResult", + "TransactionInfo", + "run_asset_freeze_test_suite", + "AbiValue", + "AbiValueProtocol", + "AbiType", + "AbiTypeProtocol", + "TransactionSignerImpl", + "TransactionSigner", + "StructField", + "StructFieldProtocol", + "AbiStruct", + "AbiStructProtocol", + "ComposerTraitImpl", + "ComposerTrait", + "Composer", + "ComposerProtocol", + "ComposerFactoryImpl", + "ComposerFactory", + "DefaultComposerFactory", + "DefaultComposerFactoryProtocol", + "TestFixture", + "TestFixtureProtocol", + "TransactionSignerGetterImpl", + "TransactionSignerGetter", +] \ No newline at end of file diff --git a/packages/python/algokit_utils/algokit_utils/ffi_algod_client.py b/packages/python/algokit_utils/algokit_utils/ffi_algod_client.py deleted file mode 100644 index d34a983ac..000000000 --- a/packages/python/algokit_utils/algokit_utils/ffi_algod_client.py +++ /dev/null @@ -1,139 +0,0 @@ -""" -Python implementation of AlgodClientTrait foreign trait. - -This enables Python to provide async algod operations to Rust test code, -with Python controlling the async context while Rust orchestrates test logic. -""" - -import asyncio -import base64 -import json -from typing import List -from algokit_utils.algokit_http_client import HttpClient, HttpMethod -from algokit_utils.algokit_utils_ffi import ( - AlgodClientTrait, - AccountInfo, - TransactionInfo, - SuggestedParams, - UtilsError, -) - - -class PythonAlgodClient(AlgodClientTrait): # type: ignore - """Python implementation of async AlgodClient trait using HttpClient""" - - def __init__(self, http_client: HttpClient): - self.http_client = http_client - - async def send_transaction(self, txn: List[int]) -> str: # type: ignore - """Send transaction bytes and return transaction ID""" - txn_bytes = bytes(txn) # Convert from List[int] to bytes - - try: - response = await self.http_client.request( - method=HttpMethod.POST, - path="v2/transactions", - query=None, - body=txn_bytes, - headers={"Content-Type": "application/x-binary"}, - ) - - result = json.loads(response.body.decode("utf-8")) - return result["txId"] - except Exception as e: - raise UtilsError.UtilsError(f"Failed to send transaction: {e}") - - async def get_account_info(self, address: str) -> AccountInfo: # type: ignore - """Get account information from algod""" - try: - response = await self.http_client.request( - method=HttpMethod.GET, - path=f"v2/accounts/{address}", - query=None, - body=None, - headers=None, - ) - - data = json.loads(response.body.decode("utf-8")) - return AccountInfo( - balance=data.get("amount", 0), - min_balance=data.get("min-balance", 0), - created_apps=[app["id"] for app in data.get("created-apps", [])], - created_assets=[ - asset["index"] for asset in data.get("created-assets", []) - ], - ) - except Exception as e: - raise UtilsError.UtilsError(f"Failed to get account info: {e}") - - async def get_transaction_info(self, tx_id: str) -> TransactionInfo: # type: ignore - """Get transaction information by ID""" - try: - # Try pending transactions first - response = await self.http_client.request( - method=HttpMethod.GET, - path=f"v2/transactions/pending/{tx_id}", - query=None, - body=None, - headers=None, - ) - - data = json.loads(response.body.decode("utf-8")) - except Exception: - # If not found in pending, try confirmed transactions - try: - response = await self.http_client.request( - method=HttpMethod.GET, - path=f"v2/transactions/{tx_id}", - query=None, - body=None, - headers=None, - ) - - data = json.loads(response.body.decode("utf-8")) - except Exception as e: - raise UtilsError.UtilsError(f"Transaction not found: {e}") - - return TransactionInfo( - tx_id=tx_id, - confirmed_round=data.get("confirmed-round"), - asset_id=data.get("asset-index"), - app_id=data.get("application-index"), - ) - - async def wait_for_confirmation(self, tx_id: str) -> TransactionInfo: # type: ignore - """Wait for transaction confirmation""" - for attempt in range(10): # Wait up to 10 rounds - try: - info = await self.get_transaction_info(tx_id) - if info.confirmed_round: - return info - except: - pass - await asyncio.sleep(1) - - raise UtilsError.UtilsError( - f"Transaction {tx_id} not confirmed after 10 rounds" - ) - - async def get_suggested_params(self) -> SuggestedParams: # type: ignore - """Get suggested transaction parameters""" - try: - response = await self.http_client.request( - method=HttpMethod.GET, - path="v2/transactions/params", - query=None, - body=None, - headers=None, - ) - - data = json.loads(response.body.decode("utf-8")) - return SuggestedParams( - fee=data.get("fee", 1000), - first_valid_round=data["last-round"], - last_valid_round=data["last-round"] + 1000, - genesis_hash=list(base64.b64decode(data["genesis-hash"])), - genesis_id=data["genesis-id"], - ) - except Exception as e: - raise UtilsError.UtilsError(f"Failed to get suggested params: {e}") \ No newline at end of file diff --git a/packages/python/algokit_utils/algokit_utils/ffi_composer.py b/packages/python/algokit_utils/algokit_utils/ffi_composer.py index 2670b83db..5d4e17b0d 100644 --- a/packages/python/algokit_utils/algokit_utils/ffi_composer.py +++ b/packages/python/algokit_utils/algokit_utils/ffi_composer.py @@ -8,111 +8,8 @@ eliminating the need to pass them on every method call. """ -from typing import List - - -class PythonComposer: - """Python implementation wrapping the concrete Rust Composer for async trait compatibility""" - - def __init__(self, algod_client, signer_getter): - """ - Args: - algod_client: The concrete AlgodClient FFI object - signer_getter: The TransactionSignerGetter implementation - """ - # Import here to avoid circular dependency - from algokit_utils.algokit_utils_ffi import Composer - - # Store dependencies for stateful API - self.algod_client = algod_client - self.signer_getter = signer_getter - - # Create the concrete Rust Composer with dependencies - self._composer = Composer(algod_client, signer_getter) - - async def build(self) -> None: - """Build the composed transactions""" - await self._composer.build() - - async def send(self) -> List[str]: - """Send the composed transactions""" - result = await self._composer.send() - return result.transaction_ids - - async def add_payment(self, params) -> None: - """Add payment transaction to composition""" - self._composer.add_payment(params) - - async def add_asset_create(self, params) -> None: - """Add asset create transaction to composition""" - self._composer.add_asset_create(params) - - async def add_asset_reconfigure(self, params) -> None: - """Add asset reconfigure transaction to composition""" - self._composer.add_asset_reconfigure(params) - - async def add_asset_destroy(self, params) -> None: - """Add asset destroy transaction to composition""" - self._composer.add_asset_destroy(params) - - async def add_asset_freeze(self, params) -> None: - """Add asset freeze transaction to composition""" - self._composer.add_asset_freeze(params) - - async def add_asset_unfreeze(self, params) -> None: - """Add asset unfreeze transaction to composition""" - self._composer.add_asset_unfreeze(params) - - async def add_asset_transfer(self, params) -> None: - """Add asset transfer transaction to composition""" - self._composer.add_asset_transfer(params) - - async def add_asset_opt_in(self, params) -> None: - """Add asset opt-in transaction to composition""" - self._composer.add_asset_opt_in(params) - - async def add_asset_opt_out(self, params) -> None: - """Add asset opt-out transaction to composition""" - self._composer.add_asset_opt_out(params) - - async def add_asset_clawback(self, params) -> None: - """Add asset clawback transaction to composition""" - self._composer.add_asset_clawback(params) - - async def add_app_create(self, params) -> None: - """Add app create transaction to composition""" - self._composer.add_app_create(params) - - async def add_app_call(self, params) -> None: - """Add app call transaction to composition""" - self._composer.add_app_call(params) - - async def add_app_update(self, params) -> None: - """Add app update transaction to composition""" - self._composer.add_app_update(params) - - async def add_app_delete(self, params) -> None: - """Add app delete transaction to composition""" - self._composer.add_app_delete(params) - - async def add_app_call_method_call(self, params) -> None: - """Add app call method call transaction to composition""" - self._composer.add_app_call_method_call(params) - - async def add_app_create_method_call(self, params) -> None: - """Add app create method call transaction to composition""" - self._composer.add_app_create_method_call(params) - - async def add_app_update_method_call(self, params) -> None: - """Add app update method call transaction to composition""" - self._composer.add_app_update_method_call(params) - - async def add_app_delete_method_call(self, params) -> None: - """Add app delete method call transaction to composition""" - self._composer.add_app_delete_method_call(params) - - -class PythonComposerFactory: +from algokit_utils import Composer, ComposerFactory +class PythonComposerFactory(ComposerFactory): """Python implementation of ComposerFactory that creates fresh composer instances""" def __init__(self, algod_client, signer_getter): @@ -124,6 +21,6 @@ def __init__(self, algod_client, signer_getter): self.algod_client = algod_client self.signer_getter = signer_getter - def create_composer(self) -> PythonComposer: + def create_composer(self) -> Composer: """Create a fresh composer instance with stored dependencies""" - return PythonComposer(self.algod_client, self.signer_getter) + return Composer(self.algod_client, self.signer_getter) diff --git a/packages/python/algokit_utils/poetry.lock b/packages/python/algokit_utils/poetry.lock index 2da8afae0..18836f697 100644 --- a/packages/python/algokit_utils/poetry.lock +++ b/packages/python/algokit_utils/poetry.lock @@ -2,7 +2,7 @@ [[package]] name = "algokit-transact" -version = "1.0.0a67" +version = "1.0.0a77" description = "" optional = false python-versions = ">=3.9,<4.0" diff --git a/packages/python/algokit_utils/tests/__init__.py b/packages/python/algokit_utils/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/packages/python/algokit_utils/tests/test_ffi_async.py b/packages/python/algokit_utils/tests/test_ffi_async.py index a1bd1901a..be62c8988 100644 --- a/packages/python/algokit_utils/tests/test_ffi_async.py +++ b/packages/python/algokit_utils/tests/test_ffi_async.py @@ -8,10 +8,10 @@ """ import pytest -from algokit_utils.ffi_algod_client import PythonAlgodClient +from algokit_utils.algod_client_ffi import AlgodClient from algokit_utils.ffi_composer import PythonComposerFactory from tests.test_utils import HttpClientImpl, MultiAccountSignerGetter -from algokit_utils.algokit_utils_ffi import AlgodClient +from algokit_utils.algod_client_ffi import AlgodClient @pytest.mark.asyncio @@ -20,14 +20,13 @@ async def test_asset_freeze_comprehensive(): # Create Python implementations of async traits using existing HttpClient http_client = HttpClientImpl() - algod_client = PythonAlgodClient(http_client) + algod_client = AlgodClient(http_client) # Create the concrete FFI components - ffi_algod = AlgodClient(http_client) ffi_signer_getter = MultiAccountSignerGetter() # Create composer factory - composer_factory = PythonComposerFactory(ffi_algod, ffi_signer_getter) + composer_factory = PythonComposerFactory(algod_client, ffi_signer_getter) # Run the async Rust test suite - dispenser mnemonic is now fetched internally try: @@ -36,11 +35,15 @@ async def test_asset_freeze_comprehensive(): # Run the async Rust test suite # Rust will fetch dispenser mnemonic from localnet internally result = await run_asset_freeze_test_suite( - algod_client, # PythonAlgodClient (foreign trait impl) + algod_client, # Concrete AlgodClient which implements the foreign trait composer_factory, # PythonComposerFactory (foreign trait impl) ffi_signer_getter # MultiAccountSignerGetter (foreign trait impl) ) + for res in result.results: + if not res.passed: + raise RuntimeError(f"Test '{res.name}' failed with error: {res.error}") + # Assert all tests passed assert result.all_passed, f"Test suite failed: {result.name}" @@ -64,4 +67,4 @@ async def test_asset_freeze_comprehensive(): if __name__ == "__main__": - pass \ No newline at end of file + pass diff --git a/packages/python/algokit_utils/tests/test_utils.py b/packages/python/algokit_utils/tests/test_utils.py index 1f6ff0528..82ac182ee 100644 --- a/packages/python/algokit_utils/tests/test_utils.py +++ b/packages/python/algokit_utils/tests/test_utils.py @@ -7,7 +7,8 @@ Transaction, encode_transaction, ) -from algokit_utils import AlgodClient, TransactionSigner +from algokit_utils import TransactionSigner +from algokit_utils.algod_client_ffi import AlgodClient from algokit_utils.algokit_utils_ffi import ( AbiMethod, AbiMethodArg, diff --git a/tools/api_tools/src/main.rs b/tools/api_tools/src/main.rs index a09efd99f..0c591e0a8 100644 --- a/tools/api_tools/src/main.rs +++ b/tools/api_tools/src/main.rs @@ -155,6 +155,7 @@ struct RsClientConfig { output_rel: &'static str, package_name: &'static str, description: &'static str, + generate_ffi_crate: bool, } const ALGOD_RS_CLIENT: RsClientConfig = RsClientConfig { @@ -162,6 +163,7 @@ const ALGOD_RS_CLIENT: RsClientConfig = RsClientConfig { output_rel: "crates/algod_client", package_name: "algod_client", description: "API client for algod interaction.", + generate_ffi_crate: true, }; const INDEXER_RS_CLIENT: RsClientConfig = RsClientConfig { @@ -169,6 +171,7 @@ const INDEXER_RS_CLIENT: RsClientConfig = RsClientConfig { output_rel: "crates/indexer_client", package_name: "indexer_client", description: "API client for indexer interaction.", + generate_ffi_crate: false, }; const KMD_RS_CLIENT: RsClientConfig = RsClientConfig { @@ -176,26 +179,51 @@ const KMD_RS_CLIENT: RsClientConfig = RsClientConfig { output_rel: "crates/kmd_client", package_name: "kmd_client", description: "API client for kmd interaction.", + generate_ffi_crate: false, }; fn generate_rs_client(config: &RsClientConfig) -> Result<()> { - run( - &format!( - "uv run python -m rust_oas_generator.cli ../specs/{}.oas3.json --output ../../{}/ --package-name {} --description \"{}\"", - config.spec, config.output_rel, config.package_name, config.description - ), - Some(Path::new("api/oas_generator")), - None, - )?; + for ffi in [true, false] { + if ffi && !config.generate_ffi_crate { + continue; + } - run( - &format!( - "cargo fmt --manifest-path Cargo.toml -p {}", - config.package_name - ), - None, - None, - )?; + let output_rel = if ffi { + format!("{}_ffi", config.output_rel) + } else { + config.output_rel.to_string() + }; + + let package_name = if ffi { + format!("{}_ffi", config.package_name) + } else { + config.package_name.to_string() + }; + + run( + &format!( + "uv run python -m rust_oas_generator.cli ../specs/{}.oas3.json --output ../../{}/ --package-name {} --description \"{}\"", + config.spec, output_rel, package_name, config.description + ), + Some(Path::new("api/oas_generator")), + None, + )?; + + run( + &format!( + "cargo clippy --allow-dirty --fix --manifest-path Cargo.toml -p {}", + package_name + ), + None, + None, + )?; + + run( + &format!("cargo fmt --manifest-path Cargo.toml -p {}", package_name), + None, + None, + )?; + } Ok(()) }