From 0fa11ebba7dc1979d2c3fd5c300ae80e8bf2d1ee Mon Sep 17 00:00:00 2001 From: /alex/ Date: Wed, 30 Jul 2025 16:38:26 +0200 Subject: [PATCH 01/12] add ServiceConfig as Record --- bindings/python/test.py | 17 ++- crates/iota-sdk-ffi/src/types/graphql.rs | 138 ++++++++++++++++++++++- 2 files changed, 152 insertions(+), 3 deletions(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index b4718071d..51ba4b89d 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -1,4 +1,4 @@ -from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter +from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter, ServiceConfig import asyncio async def main(): @@ -23,5 +23,20 @@ async def main(): filter=EventFilter(sender=my_address) + service_config=ServiceConfig(default_page_size=2, + enabled_features=[], + max_move_value_depth=0, + max_output_nodes=0, + max_page_size=0, + max_query_depth=0, + max_query_nodes=0, + max_query_payload_size=0, + max_type_argument_depth=0, + max_type_argument_width=0, + max_type_nodes=0, + mutation_timeout_ms=0, + request_timeout_ms=0) + + if __name__ == '__main__': asyncio.run(main()) diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index 318e8f977..eeb28565f 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -745,5 +745,139 @@ pub struct MoveFunction(pub iota_graphql_client::query_types::MoveFunction); #[derive(Debug, derive_more::From, uniffi::Object)] pub struct MoveModule(pub iota_graphql_client::query_types::MoveModule); -#[derive(Clone, Debug, derive_more::From, uniffi::Object)] -pub struct ServiceConfig(pub iota_graphql_client::query_types::ServiceConfig); +type CoreServiceConfig = iota_graphql_client::query_types::ServiceConfig; + +#[derive(Clone, Debug, uniffi::Record)] +pub struct ServiceConfig { + /// Default number of elements allowed on a single page of a connection. + pub default_page_size: i32, + /// List of all features that are enabled on this RPC service. + pub enabled_features: Vec, + // TODO This field is retrieved as a string, instead of i32 + /// Maximum estimated cost of a database query used to serve a GraphQL + /// request. This is measured in the same units that the database uses + /// in EXPLAIN queries. + // pub max_db_query_cost: i32, + /// Maximum nesting allowed in struct fields when calculating the layout of + /// a single Move Type. + pub max_move_value_depth: i32, + /// The maximum number of output nodes in a GraphQL response. + /// Non-connection nodes have a count of 1, while connection nodes are + /// counted as the specified 'first' or 'last' number of items, or the + /// default_page_size as set by the server if those arguments are not + /// set. Counts accumulate multiplicatively down the query tree. For + /// example, if a query starts with a connection of first: 10 and has a + /// field to a connection with last: 20, the count at the second level + /// would be 200 nodes. This is then summed to the count of 10 nodes + /// at the first level, for a total of 210 nodes. + pub max_output_nodes: i32, + /// Maximum number of elements allowed on a single page of a connection. + pub max_page_size: i32, + /// The maximum depth a GraphQL query can be to be accepted by this service. + pub max_query_depth: i32, + /// The maximum number of nodes (field names) the service will accept in a + /// single query. + pub max_query_nodes: i32, + /// Maximum length of a query payload string. + pub max_query_payload_size: i32, + /// Maximum nesting allowed in type arguments in Move Types resolved by this + /// service. + pub max_type_argument_depth: i32, + /// Maximum number of type arguments passed into a generic instantiation of + /// a Move Type resolved by this service. + pub max_type_argument_width: i32, + /// Maximum number of structs that need to be processed when calculating the + /// layout of a single Move Type. + pub max_type_nodes: i32, + /// Maximum time in milliseconds spent waiting for a response from fullnode + /// after issuing a a transaction to execute. Note that the transaction + /// may still succeed even in the case of a timeout. Transactions are + /// idempotent, so a transaction that times out should be resubmitted + /// until the network returns a definite response (success or failure, not + /// timeout). + pub mutation_timeout_ms: i32, + /// Maximum time in milliseconds that will be spent to serve one query + /// request. + pub request_timeout_ms: i32, +} + +impl From for ServiceConfig { + fn from(value: CoreServiceConfig) -> Self { + Self { + default_page_size: value.default_page_size, + enabled_features: value.enabled_features.into_iter().map(Into::into).collect(), + max_move_value_depth: value.max_move_value_depth, + max_output_nodes: value.max_output_nodes, + max_page_size: value.max_page_size, + max_query_depth: value.max_query_depth, + max_query_nodes: value.max_query_nodes, + max_query_payload_size: value.max_query_payload_size, + max_type_argument_depth: value.max_type_argument_depth, + max_type_argument_width: value.max_type_argument_width, + max_type_nodes: value.max_type_nodes, + mutation_timeout_ms: value.mutation_timeout_ms, + request_timeout_ms: value.request_timeout_ms, + } + } +} + +impl From for CoreServiceConfig { + fn from(value: ServiceConfig) -> Self { + Self { + default_page_size: value.default_page_size, + enabled_features: value.enabled_features.into_iter().map(Into::into).collect(), + max_move_value_depth: value.max_move_value_depth, + max_output_nodes: value.max_output_nodes, + max_page_size: value.max_page_size, + max_query_depth: value.max_query_depth, + max_query_nodes: value.max_query_nodes, + max_query_payload_size: value.max_query_payload_size, + max_type_argument_depth: value.max_type_argument_depth, + max_type_argument_width: value.max_type_argument_width, + max_type_nodes: value.max_type_nodes, + mutation_timeout_ms: value.mutation_timeout_ms, + request_timeout_ms: value.request_timeout_ms, + } + } +} + +type CoreFeature = iota_graphql_client::query_types::Feature; + +#[derive(Clone, Debug, uniffi::Enum)] +pub enum Feature { + Analytics, + Coins, + DynamicFields, + NameService, + Subscriptions, + SystemState, + MoveRegistry, +} + +impl From for Feature { + fn from(value: CoreFeature) -> Self { + match value { + CoreFeature::Analytics => Self::Analytics, + CoreFeature::Coins => Self::Coins, + CoreFeature::DynamicFields => Self::DynamicFields, + CoreFeature::NameService => Self::NameService, + CoreFeature::Subscriptions => Self::Subscriptions, + CoreFeature::SystemState => Self::SystemState, + CoreFeature::MoveRegistry => Self::MoveRegistry, + } + } +} + +impl From for CoreFeature { + fn from(value: Feature) -> Self { + match value { + Feature::Analytics => Self::Analytics, + Feature::Coins => Self::Coins, + Feature::DynamicFields => Self::DynamicFields, + Feature::NameService => Self::NameService, + Feature::Subscriptions => Self::Subscriptions, + Feature::SystemState => Self::SystemState, + Feature::MoveRegistry => Self::MoveRegistry, + } + } +} From 7c6886be1b483c84f7915288280047506ca80482 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Mon, 4 Aug 2025 10:28:09 +0200 Subject: [PATCH 02/12] add CoinMetadata as Record --- bindings/python/test.py | 9 ++++- crates/iota-sdk-ffi/src/graphql.rs | 5 +-- crates/iota-sdk-ffi/src/types/graphql.rs | 51 +++++++++++++++++++++++- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index 51ba4b89d..f4434a7c8 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -1,4 +1,4 @@ -from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter, ServiceConfig +from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter, ServiceConfig, CoinMetadata import asyncio async def main(): @@ -37,6 +37,13 @@ async def main(): mutation_timeout_ms=0, request_timeout_ms=0) + coin_metadata=CoinMetadata(decimals=2, + description="test", + icon_url=None, + name="test", + symbol=None, + supply="1000", + version=0) if __name__ == '__main__': asyncio.run(main()) diff --git a/crates/iota-sdk-ffi/src/graphql.rs b/crates/iota-sdk-ffi/src/graphql.rs index c13e3b3fe..8a1df3e65 100644 --- a/crates/iota-sdk-ffi/src/graphql.rs +++ b/crates/iota-sdk-ffi/src/graphql.rs @@ -192,15 +192,14 @@ impl GraphQLClient { } /// Get the coin metadata for the coin type. - pub async fn coin_metadata(&self, coin_type: &str) -> Result>> { + pub async fn coin_metadata(&self, coin_type: &str) -> Result> { Ok(self .0 .read() .await .coin_metadata(coin_type) .await? - .map(Into::into) - .map(Arc::new)) + .map(Into::into)) } /// Get total supply for the coin type. diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index eeb28565f..9e6495fcd 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -10,6 +10,8 @@ use iota_graphql_client::{ }; use iota_types::{Identifier, StructTag, TransactionDigest}; +use iota_graphql_client::query_types::BigInt; + use crate::types::{ address::Address, object::ObjectId, @@ -736,8 +738,52 @@ impl From for iota_graphql_client::query_types::MoveObject { #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ProtocolConfigs(pub iota_graphql_client::query_types::ProtocolConfigs); -#[derive(Clone, Debug, derive_more::From, uniffi::Object)] -pub struct CoinMetadata(pub iota_graphql_client::query_types::CoinMetadata); +/// The coin metadata associated with the given coin type. +#[derive(Clone, Debug, uniffi::Record)] +pub struct CoinMetadata { + /// The number of decimal places used to represent the token. + pub decimals: Option, + /// Optional description of the token, provided by the creator of the token. + pub description: Option, + /// Icon URL of the coin. + pub icon_url: Option, + /// Full, official name of the token. + pub name: Option, + /// The token's identifying abbreviation. + pub symbol: Option, + /// The overall quantity of tokens that will be issued. + pub supply: Option, + /// Version of the token. + pub version: u64, +} + +impl From for CoinMetadata { + fn from(value: iota_graphql_client::query_types::CoinMetadata) -> Self { + Self { + decimals: value.decimals, + description: value.description, + icon_url: value.icon_url, + name: value.name, + symbol: value.symbol, + supply: value.supply.map(|s| s.0), + version: value.version, + } + } +} + +impl From for iota_graphql_client::query_types::CoinMetadata { + fn from(value: CoinMetadata) -> Self { + Self { + decimals: value.decimals, + description: value.description, + icon_url: value.icon_url, + name: value.name, + symbol: value.symbol, + supply: value.supply.map(|s| BigInt(s)), + version: value.version, + } + } +} #[derive(Debug, derive_more::From, uniffi::Object)] pub struct MoveFunction(pub iota_graphql_client::query_types::MoveFunction); @@ -747,6 +793,7 @@ pub struct MoveModule(pub iota_graphql_client::query_types::MoveModule); type CoreServiceConfig = iota_graphql_client::query_types::ServiceConfig; +/// Information about the configuration of the GraphQL service. #[derive(Clone, Debug, uniffi::Record)] pub struct ServiceConfig { /// Default number of elements allowed on a single page of a connection. From 06d3fe79c65c840cd0a8eeb7b8c526b30470a1bc Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 7 Aug 2025 08:27:02 +0200 Subject: [PATCH 03/12] clippy --- crates/iota-sdk-ffi/src/types/graphql.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index 9e6495fcd..ce7e6073c 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -779,7 +779,7 @@ impl From for iota_graphql_client::query_types::CoinMetadata { icon_url: value.icon_url, name: value.name, symbol: value.symbol, - supply: value.supply.map(|s| BigInt(s)), + supply: value.supply.map(BigInt), version: value.version, } } From 25ed69ebb4c960caa3a03f640d50d6918ac13d92 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 14:49:45 +0200 Subject: [PATCH 04/12] fix issues --- bindings/python/lib/iota_sdk_ffi.py | 2700 +++++++++++++++++----- crates/iota-sdk-ffi/src/types/graphql.rs | 45 +- 2 files changed, 2145 insertions(+), 600 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 2608bce66..197545406 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -495,13 +495,13 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 8422: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 34454: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 10872: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 48442: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 4408: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 12272: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 47707: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 40594: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 29988: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -517,7 +517,7 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events() != 41916: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx() != 22929: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx() != 41079: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_latest_checkpoint_sequence_number() != 40336: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -549,7 +549,7 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_reference_gas_price() != 39065: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() != 24210: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() != 11931: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_set_rpc_server() != 31958: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -599,10 +599,54 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes() != 21066: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_structtag_address() != 18393: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type() != 37745: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt() != 65306: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 47752: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() != 5316: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_kind() != 49492: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender() != 38190: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1() != 48710: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1() != 39808: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() != 1715: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt() != 15734: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag() != 20180: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt() != 55130: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_address() != 38219: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool() != 30264: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer() != 57678: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct() != 39029: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128() != 65460: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16() != 34540: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256() != 65130: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32() != 40795: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64() != 28705: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8() != 18761: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector() != 49992: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes() != 58901: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex() != 63442: @@ -667,6 +711,16 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate() != 49992: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() != 13756: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() != 37848: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_new() != 20682: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota() != 30839: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() != 4081: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_v1() != 6144: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1() != 37860: @@ -681,6 +735,28 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update() != 45772: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() != 44901: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool() != 19366: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer() != 12676: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag() != 53303: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128() != 41280: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16() != 13801: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256() != 13310: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32() != 9870: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64() != 59470: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8() != 9403: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector() != 46548: + 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. @@ -970,16 +1046,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_coin_id.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_coinmetadata.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_coinmetadata.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_coinmetadata.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_coinmetadata.restype = None _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1010,16 +1076,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_digest.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_dryrunresult.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_dryrunresult.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_dryrunresult.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_dryrunresult.restype = None _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_ed25519publickey.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1098,16 +1154,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_epoch.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_event.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_event.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_event.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_event.restype = None _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1252,7 +1298,7 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins.restype = ctypes.c_uint64 _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx.argtypes = ( ctypes.c_void_p, - _UniffiRustBuffer, + ctypes.c_void_p, _UniffiRustBuffer, ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx.restype = ctypes.c_uint64 @@ -1307,7 +1353,7 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx.argtypes = ( ctypes.c_void_p, _UniffiRustBuffer, - _UniffiRustBuffer, + ctypes.c_void_p, ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx.restype = ctypes.c_uint64 _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number.argtypes = ( @@ -1463,6 +1509,16 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiRustBuffer, ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_identifier.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_identifier.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_identifier.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_identifier.restype = None _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movefunction.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1616,16 +1672,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex.restype = _UniffiRustBuffer -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_objectref.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_objectref.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_objectref.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_objectref.restype = None _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_objecttype.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1734,16 +1780,90 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes.restype = _UniffiRustBuffer -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_serviceconfig.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_structtag.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_structtag.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_structtag.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_structtag.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_new.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_address.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_address.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transaction.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transaction_new.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transaction_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_expiration.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_serviceconfig.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_serviceconfig.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_expiration.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_serviceconfig.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_kind.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_kind.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_sender.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_sender.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactiondigest.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1849,6 +1969,127 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_typetag.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_address.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_address.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_address.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_address.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector.restype = ctypes.c_int8 _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_usersignature.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -2334,12 +2575,78 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_kind.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_kind.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes.restype = ctypes.c_uint16 @@ -2436,6 +2743,21 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_v1.restype = ctypes.c_uint16 @@ -2457,6 +2779,39 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector.restype = ctypes.c_uint16 _UniffiLib.ffi_iota_sdk_ffi_uniffi_contract_version.argtypes = ( ) _UniffiLib.ffi_iota_sdk_ffi_uniffi_contract_version.restype = ctypes.c_uint32 @@ -2710,10 +3065,6 @@ def write(value, buf): - - - - @@ -3033,37 +3384,140 @@ def write(value, buf): _UniffiConverterSequenceTypeCheckpointSummary.write(value.data, buf) -class CoinPage: +class CoinMetadata: """ - A page of items returned by the GraphQL server. + The coin metadata associated with the given coin type. """ - page_info: "PageInfo" + decimals: "typing.Optional[int]" """ - Information about the page, such as the cursor and whether there are - more pages. + The number of decimal places used to represent the token. """ - data: "typing.List[Coin]" + description: "typing.Optional[str]" """ - The data returned by the server. + Optional description of the token, provided by the creator of the token. """ - def __init__(self, *, page_info: "PageInfo", data: "typing.List[Coin]"): - self.page_info = page_info - self.data = data + icon_url: "typing.Optional[str]" + """ + Icon URL of the coin. + """ - def __str__(self): - return "CoinPage(page_info={}, data={})".format(self.page_info, self.data) + name: "typing.Optional[str]" + """ + Full, official name of the token. + """ - def __eq__(self, other): - if self.page_info != other.page_info: - return False - if self.data != other.data: - return False - return True + symbol: "typing.Optional[str]" + """ + The token's identifying abbreviation. + """ -class _UniffiConverterTypeCoinPage(_UniffiConverterRustBuffer): + supply: "typing.Optional[str]" + """ + The overall quantity of tokens that will be issued. + """ + + version: "int" + """ + Version of the token. + """ + + def __init__(self, *, decimals: "typing.Optional[int]", description: "typing.Optional[str]", icon_url: "typing.Optional[str]", name: "typing.Optional[str]", symbol: "typing.Optional[str]", supply: "typing.Optional[str]", version: "int"): + self.decimals = decimals + self.description = description + self.icon_url = icon_url + self.name = name + self.symbol = symbol + self.supply = supply + self.version = version + + def __str__(self): + return "CoinMetadata(decimals={}, description={}, icon_url={}, name={}, symbol={}, supply={}, version={})".format(self.decimals, self.description, self.icon_url, self.name, self.symbol, self.supply, self.version) + + def __eq__(self, other): + if self.decimals != other.decimals: + return False + if self.description != other.description: + return False + if self.icon_url != other.icon_url: + return False + if self.name != other.name: + return False + if self.symbol != other.symbol: + return False + if self.supply != other.supply: + return False + if self.version != other.version: + return False + return True + +class _UniffiConverterTypeCoinMetadata(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return CoinMetadata( + decimals=_UniffiConverterOptionalInt32.read(buf), + description=_UniffiConverterOptionalString.read(buf), + icon_url=_UniffiConverterOptionalString.read(buf), + name=_UniffiConverterOptionalString.read(buf), + symbol=_UniffiConverterOptionalString.read(buf), + supply=_UniffiConverterOptionalString.read(buf), + version=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterOptionalInt32.check_lower(value.decimals) + _UniffiConverterOptionalString.check_lower(value.description) + _UniffiConverterOptionalString.check_lower(value.icon_url) + _UniffiConverterOptionalString.check_lower(value.name) + _UniffiConverterOptionalString.check_lower(value.symbol) + _UniffiConverterOptionalString.check_lower(value.supply) + _UniffiConverterUInt64.check_lower(value.version) + + @staticmethod + def write(value, buf): + _UniffiConverterOptionalInt32.write(value.decimals, buf) + _UniffiConverterOptionalString.write(value.description, buf) + _UniffiConverterOptionalString.write(value.icon_url, buf) + _UniffiConverterOptionalString.write(value.name, buf) + _UniffiConverterOptionalString.write(value.symbol, buf) + _UniffiConverterOptionalString.write(value.supply, buf) + _UniffiConverterUInt64.write(value.version, buf) + + +class CoinPage: + """ + A page of items returned by the GraphQL server. + """ + + page_info: "PageInfo" + """ + Information about the page, such as the cursor and whether there are + more pages. + """ + + data: "typing.List[Coin]" + """ + The data returned by the server. + """ + + def __init__(self, *, page_info: "PageInfo", data: "typing.List[Coin]"): + self.page_info = page_info + self.data = data + + def __str__(self): + return "CoinPage(page_info={}, data={})".format(self.page_info, self.data) + + def __eq__(self, other): + if self.page_info != other.page_info: + return False + if self.data != other.data: + return False + return True + +class _UniffiConverterTypeCoinPage(_UniffiConverterRustBuffer): @staticmethod def read(buf): return CoinPage( @@ -3082,6 +3536,76 @@ def write(value, buf): _UniffiConverterSequenceTypeCoin.write(value.data, buf) +class DateTime: + value: "str" + def __init__(self, *, value: "str"): + self.value = value + + def __str__(self): + return "DateTime(value={})".format(self.value) + + def __eq__(self, other): + if self.value != other.value: + return False + return True + +class _UniffiConverterTypeDateTime(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DateTime( + value=_UniffiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.value) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.value, buf) + + +class DryRunResult: + """ + The result of a dry run, which includes the effects of the transaction and + any errors that may have occurred. + """ + + effects: "typing.Optional[TransactionEffects]" + error: "typing.Optional[str]" + def __init__(self, *, effects: "typing.Optional[TransactionEffects]", error: "typing.Optional[str]"): + self.effects = effects + self.error = error + + def __str__(self): + return "DryRunResult(effects={}, error={})".format(self.effects, self.error) + + def __eq__(self, other): + if self.effects != other.effects: + return False + if self.error != other.error: + return False + return True + +class _UniffiConverterTypeDryRunResult(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DryRunResult( + effects=_UniffiConverterOptionalTypeTransactionEffects.read(buf), + error=_UniffiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterOptionalTypeTransactionEffects.check_lower(value.effects) + _UniffiConverterOptionalString.check_lower(value.error) + + @staticmethod + def write(value, buf): + _UniffiConverterOptionalTypeTransactionEffects.write(value.effects, buf) + _UniffiConverterOptionalString.write(value.error, buf) + + class DynamicFieldName: """ The name part of a dynamic field, including its type, bcs, and json @@ -3390,6 +3914,98 @@ def write(value, buf): _UniffiConverterSequenceTypeEpoch.write(value.data, buf) +class Event: + """ + An event + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + event = object-id identifier address struct-tag bytes + ``` + """ + + package_id: "ObjectId" + """ + Package id of the top-level function invoked by a MoveCall command which + triggered this event to be emitted. + """ + + module: "str" + """ + Module name of the top-level function invoked by a MoveCall command + which triggered this event to be emitted. + """ + + sender: "Address" + """ + Address of the account that sent the transaction where this event was + emitted. + """ + + type: "str" + """ + The type of the event emitted + """ + + contents: "bytes" + """ + BCS serialized bytes of the event + """ + + def __init__(self, *, package_id: "ObjectId", module: "str", sender: "Address", type: "str", contents: "bytes"): + self.package_id = package_id + self.module = module + self.sender = sender + self.type = type + self.contents = contents + + def __str__(self): + return "Event(package_id={}, module={}, sender={}, type={}, contents={})".format(self.package_id, self.module, self.sender, self.type, self.contents) + + def __eq__(self, other): + if self.package_id != other.package_id: + return False + if self.module != other.module: + return False + if self.sender != other.sender: + return False + if self.type != other.type: + return False + if self.contents != other.contents: + return False + return True + +class _UniffiConverterTypeEvent(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return Event( + package_id=_UniffiConverterTypeObjectId.read(buf), + module=_UniffiConverterString.read(buf), + sender=_UniffiConverterTypeAddress.read(buf), + type=_UniffiConverterString.read(buf), + contents=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeObjectId.check_lower(value.package_id) + _UniffiConverterString.check_lower(value.module) + _UniffiConverterTypeAddress.check_lower(value.sender) + _UniffiConverterString.check_lower(value.type) + _UniffiConverterBytes.check_lower(value.contents) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeObjectId.write(value.package_id, buf) + _UniffiConverterString.write(value.module, buf) + _UniffiConverterTypeAddress.write(value.sender, buf) + _UniffiConverterString.write(value.type, buf) + _UniffiConverterBytes.write(value.contents, buf) + + class EventFilter: emitting_module: "typing.Optional[str]" event_type: "typing.Optional[str]" @@ -3623,6 +4239,35 @@ def write(value, buf): _UniffiConverterUInt64.write(value.budget, buf) +class GqlAddress: + address: "Address" + def __init__(self, *, address: "Address"): + self.address = address + + def __str__(self): + return "GqlAddress(address={})".format(self.address) + + def __eq__(self, other): + if self.address != other.address: + return False + return True + +class _UniffiConverterTypeGqlAddress(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return GqlAddress( + address=_UniffiConverterTypeAddress.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeAddress.check_lower(value.address) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeAddress.write(value.address, buf) + + class MoveLocation: """ Location in move bytecode where an error occurred @@ -3713,6 +4358,38 @@ def write(value, buf): _UniffiConverterOptionalString.write(value.function_name, buf) +class MoveObject: + bcs: "typing.Optional[str]" + def __init__(self, *, bcs: "typing.Optional[str]" = _DEFAULT): + if bcs is _DEFAULT: + self.bcs = None + else: + self.bcs = bcs + + def __str__(self): + return "MoveObject(bcs={})".format(self.bcs) + + def __eq__(self, other): + if self.bcs != other.bcs: + return False + return True + +class _UniffiConverterTypeMoveObject(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MoveObject( + bcs=_UniffiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterOptionalString.check_lower(value.bcs) + + @staticmethod + def write(value, buf): + _UniffiConverterOptionalString.write(value.bcs, buf) + + class MovePackagePage: """ A page of items returned by the GraphQL server. @@ -3854,6 +4531,49 @@ def write(value, buf): _UniffiConverterSequenceTypeObject.write(value.data, buf) +class ObjectRef: + address: "ObjectId" + digest: "str" + version: "int" + def __init__(self, *, address: "ObjectId", digest: "str", version: "int"): + self.address = address + self.digest = digest + self.version = version + + def __str__(self): + return "ObjectRef(address={}, digest={}, version={})".format(self.address, self.digest, self.version) + + def __eq__(self, other): + if self.address != other.address: + return False + if self.digest != other.digest: + return False + if self.version != other.version: + return False + return True + +class _UniffiConverterTypeObjectRef(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ObjectRef( + address=_UniffiConverterTypeObjectId.read(buf), + digest=_UniffiConverterString.read(buf), + version=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeObjectId.check_lower(value.address) + _UniffiConverterString.check_lower(value.digest) + _UniffiConverterUInt64.check_lower(value.version) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeObjectId.write(value.address, buf) + _UniffiConverterString.write(value.digest, buf) + _UniffiConverterUInt64.write(value.version, buf) + + class ObjectReference: """ Reference to an object @@ -3912,15 +4632,41 @@ def write(value, buf): class PageInfo: - has_previous_page: "bool" - has_next_page: "bool" + """ + Information about pagination in a connection. + """ + + has_previous_page: "bool" + """ + When paginating backwards, are there more items? + """ + + has_next_page: "bool" + """ + Are there more items when paginating forwards? + """ + start_cursor: "typing.Optional[str]" + """ + When paginating backwards, the cursor to continue. + """ + end_cursor: "typing.Optional[str]" - def __init__(self, *, has_previous_page: "bool", has_next_page: "bool", start_cursor: "typing.Optional[str]", end_cursor: "typing.Optional[str]"): + """ + When paginating forwards, the cursor to continue. + """ + + def __init__(self, *, has_previous_page: "bool", has_next_page: "bool", start_cursor: "typing.Optional[str]" = _DEFAULT, end_cursor: "typing.Optional[str]" = _DEFAULT): self.has_previous_page = has_previous_page self.has_next_page = has_next_page - self.start_cursor = start_cursor - self.end_cursor = end_cursor + if start_cursor is _DEFAULT: + self.start_cursor = None + else: + self.start_cursor = start_cursor + if end_cursor is _DEFAULT: + self.end_cursor = None + else: + self.end_cursor = end_cursor def __str__(self): return "PageInfo(has_previous_page={}, has_next_page={}, start_cursor={}, end_cursor={})".format(self.has_previous_page, self.has_next_page, self.start_cursor, self.end_cursor) @@ -3962,9 +4708,19 @@ def write(value, buf): class PaginationFilter: + """ + Pagination options for querying the GraphQL server. It defaults to forward + pagination with the GraphQL server's max page size. + """ + direction: "Direction" cursor: "typing.Optional[str]" limit: "typing.Optional[int]" + """ + The maximum number of items to return. If this is omitted, it will + lazily query the service configuration for the max page size. + """ + def __init__(self, *, direction: "Direction", cursor: "typing.Optional[str]" = _DEFAULT, limit: "typing.Optional[int]" = _DEFAULT): self.direction = direction if cursor is _DEFAULT: @@ -4010,6 +4766,197 @@ def write(value, buf): _UniffiConverterOptionalInt32.write(value.limit, buf) +class ServiceConfig: + """ + Information about the configuration of the GraphQL service. + """ + + default_page_size: "int" + """ + Default number of elements allowed on a single page of a connection. + """ + + enabled_features: "typing.List[Feature]" + """ + List of all features that are enabled on this RPC service. + """ + + max_move_value_depth: "int" + """ + Maximum estimated cost of a database query used to serve a GraphQL + request. This is measured in the same units that the database uses + in EXPLAIN queries. + Maximum nesting allowed in struct fields when calculating the layout of + a single Move Type. + """ + + max_output_nodes: "int" + """ + The maximum number of output nodes in a GraphQL response. + Non-connection nodes have a count of 1, while connection nodes are + counted as the specified 'first' or 'last' number of items, or the + default_page_size as set by the server if those arguments are not + set. Counts accumulate multiplicatively down the query tree. For + example, if a query starts with a connection of first: 10 and has a + field to a connection with last: 20, the count at the second level + would be 200 nodes. This is then summed to the count of 10 nodes + at the first level, for a total of 210 nodes. + """ + + max_page_size: "int" + """ + Maximum number of elements allowed on a single page of a connection. + """ + + max_query_depth: "int" + """ + The maximum depth a GraphQL query can be to be accepted by this service. + """ + + max_query_nodes: "int" + """ + The maximum number of nodes (field names) the service will accept in a + single query. + """ + + max_query_payload_size: "int" + """ + Maximum length of a query payload string. + """ + + max_type_argument_depth: "int" + """ + Maximum nesting allowed in type arguments in Move Types resolved by this + service. + """ + + max_type_argument_width: "int" + """ + Maximum number of type arguments passed into a generic instantiation of + a Move Type resolved by this service. + """ + + max_type_nodes: "int" + """ + Maximum number of structs that need to be processed when calculating the + layout of a single Move Type. + """ + + mutation_timeout_ms: "int" + """ + Maximum time in milliseconds spent waiting for a response from fullnode + after issuing a a transaction to execute. Note that the transaction + may still succeed even in the case of a timeout. Transactions are + idempotent, so a transaction that times out should be resubmitted + until the network returns a definite response (success or failure, not + timeout). + """ + + request_timeout_ms: "int" + """ + Maximum time in milliseconds that will be spent to serve one query + request. + """ + + def __init__(self, *, default_page_size: "int", enabled_features: "typing.List[Feature]", max_move_value_depth: "int", max_output_nodes: "int", max_page_size: "int", max_query_depth: "int", max_query_nodes: "int", max_query_payload_size: "int", max_type_argument_depth: "int", max_type_argument_width: "int", max_type_nodes: "int", mutation_timeout_ms: "int", request_timeout_ms: "int"): + self.default_page_size = default_page_size + self.enabled_features = enabled_features + self.max_move_value_depth = max_move_value_depth + self.max_output_nodes = max_output_nodes + self.max_page_size = max_page_size + self.max_query_depth = max_query_depth + self.max_query_nodes = max_query_nodes + self.max_query_payload_size = max_query_payload_size + self.max_type_argument_depth = max_type_argument_depth + self.max_type_argument_width = max_type_argument_width + self.max_type_nodes = max_type_nodes + self.mutation_timeout_ms = mutation_timeout_ms + self.request_timeout_ms = request_timeout_ms + + def __str__(self): + return "ServiceConfig(default_page_size={}, enabled_features={}, max_move_value_depth={}, max_output_nodes={}, max_page_size={}, max_query_depth={}, max_query_nodes={}, max_query_payload_size={}, max_type_argument_depth={}, max_type_argument_width={}, max_type_nodes={}, mutation_timeout_ms={}, request_timeout_ms={})".format(self.default_page_size, self.enabled_features, self.max_move_value_depth, self.max_output_nodes, self.max_page_size, self.max_query_depth, self.max_query_nodes, self.max_query_payload_size, self.max_type_argument_depth, self.max_type_argument_width, self.max_type_nodes, self.mutation_timeout_ms, self.request_timeout_ms) + + def __eq__(self, other): + if self.default_page_size != other.default_page_size: + return False + if self.enabled_features != other.enabled_features: + return False + if self.max_move_value_depth != other.max_move_value_depth: + return False + if self.max_output_nodes != other.max_output_nodes: + return False + if self.max_page_size != other.max_page_size: + return False + if self.max_query_depth != other.max_query_depth: + return False + if self.max_query_nodes != other.max_query_nodes: + return False + if self.max_query_payload_size != other.max_query_payload_size: + return False + if self.max_type_argument_depth != other.max_type_argument_depth: + return False + if self.max_type_argument_width != other.max_type_argument_width: + return False + if self.max_type_nodes != other.max_type_nodes: + return False + if self.mutation_timeout_ms != other.mutation_timeout_ms: + return False + if self.request_timeout_ms != other.request_timeout_ms: + return False + return True + +class _UniffiConverterTypeServiceConfig(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ServiceConfig( + default_page_size=_UniffiConverterInt32.read(buf), + enabled_features=_UniffiConverterSequenceTypeFeature.read(buf), + max_move_value_depth=_UniffiConverterInt32.read(buf), + max_output_nodes=_UniffiConverterInt32.read(buf), + max_page_size=_UniffiConverterInt32.read(buf), + max_query_depth=_UniffiConverterInt32.read(buf), + max_query_nodes=_UniffiConverterInt32.read(buf), + max_query_payload_size=_UniffiConverterInt32.read(buf), + max_type_argument_depth=_UniffiConverterInt32.read(buf), + max_type_argument_width=_UniffiConverterInt32.read(buf), + max_type_nodes=_UniffiConverterInt32.read(buf), + mutation_timeout_ms=_UniffiConverterInt32.read(buf), + request_timeout_ms=_UniffiConverterInt32.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterInt32.check_lower(value.default_page_size) + _UniffiConverterSequenceTypeFeature.check_lower(value.enabled_features) + _UniffiConverterInt32.check_lower(value.max_move_value_depth) + _UniffiConverterInt32.check_lower(value.max_output_nodes) + _UniffiConverterInt32.check_lower(value.max_page_size) + _UniffiConverterInt32.check_lower(value.max_query_depth) + _UniffiConverterInt32.check_lower(value.max_query_nodes) + _UniffiConverterInt32.check_lower(value.max_query_payload_size) + _UniffiConverterInt32.check_lower(value.max_type_argument_depth) + _UniffiConverterInt32.check_lower(value.max_type_argument_width) + _UniffiConverterInt32.check_lower(value.max_type_nodes) + _UniffiConverterInt32.check_lower(value.mutation_timeout_ms) + _UniffiConverterInt32.check_lower(value.request_timeout_ms) + + @staticmethod + def write(value, buf): + _UniffiConverterInt32.write(value.default_page_size, buf) + _UniffiConverterSequenceTypeFeature.write(value.enabled_features, buf) + _UniffiConverterInt32.write(value.max_move_value_depth, buf) + _UniffiConverterInt32.write(value.max_output_nodes, buf) + _UniffiConverterInt32.write(value.max_page_size, buf) + _UniffiConverterInt32.write(value.max_query_depth, buf) + _UniffiConverterInt32.write(value.max_query_nodes, buf) + _UniffiConverterInt32.write(value.max_query_payload_size, buf) + _UniffiConverterInt32.write(value.max_type_argument_depth, buf) + _UniffiConverterInt32.write(value.max_type_argument_width, buf) + _UniffiConverterInt32.write(value.max_type_nodes, buf) + _UniffiConverterInt32.write(value.mutation_timeout_ms, buf) + _UniffiConverterInt32.write(value.request_timeout_ms, buf) + + class SignedTransaction: transaction: "Transaction" signatures: "typing.List[UserSignature]" @@ -4095,70 +5042,6 @@ def write(value, buf): _UniffiConverterSequenceTypeSignedTransaction.write(value.data, buf) -class Transaction: - """ - A transaction - - # BCS - - The BCS serialized form for this type is defined by the following ABNF: - - ```text - transaction = %x00 transaction-v1 - - transaction-v1 = transaction-kind address gas-payment transaction-expiration - ``` - """ - - kind: "TransactionKind" - sender: "Address" - gas_payment: "GasPayment" - expiration: "TransactionExpiration" - def __init__(self, *, kind: "TransactionKind", sender: "Address", gas_payment: "GasPayment", expiration: "TransactionExpiration"): - self.kind = kind - self.sender = sender - self.gas_payment = gas_payment - self.expiration = expiration - - def __str__(self): - return "Transaction(kind={}, sender={}, gas_payment={}, expiration={})".format(self.kind, self.sender, self.gas_payment, self.expiration) - - def __eq__(self, other): - if self.kind != other.kind: - return False - if self.sender != other.sender: - return False - if self.gas_payment != other.gas_payment: - return False - if self.expiration != other.expiration: - return False - return True - -class _UniffiConverterTypeTransaction(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return Transaction( - kind=_UniffiConverterTypeTransactionKind.read(buf), - sender=_UniffiConverterTypeAddress.read(buf), - gas_payment=_UniffiConverterTypeGasPayment.read(buf), - expiration=_UniffiConverterTypeTransactionExpiration.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterTypeTransactionKind.check_lower(value.kind) - _UniffiConverterTypeAddress.check_lower(value.sender) - _UniffiConverterTypeGasPayment.check_lower(value.gas_payment) - _UniffiConverterTypeTransactionExpiration.check_lower(value.expiration) - - @staticmethod - def write(value, buf): - _UniffiConverterTypeTransactionKind.write(value.kind, buf) - _UniffiConverterTypeAddress.write(value.sender, buf) - _UniffiConverterTypeGasPayment.write(value.gas_payment, buf) - _UniffiConverterTypeTransactionExpiration.write(value.expiration, buf) - - class TransactionDataEffects: tx: "SignedTransaction" effects: "TransactionEffects" @@ -4672,6 +5555,35 @@ def write(value, buf): _UniffiConverterOptionalTypeObjectId.write(value.wrapped_or_deleted_object, buf) +class TypeParseError: + source: "str" + def __init__(self, *, source: "str"): + self.source = source + + def __str__(self): + return "TypeParseError(source={})".format(self.source) + + def __eq__(self, other): + if self.source != other.source: + return False + return True + +class _UniffiConverterTypeTypeParseError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TypeParseError( + source=_UniffiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.source) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.source, buf) + + class UnchangedSharedObject: """ A shared object that wasn't changed during execution @@ -5067,6 +5979,42 @@ def write(value, buf): _UniffiConverterUInt64.write(value.stake, buf) +class ValidatorConnection: + page_info: "PageInfo" + nodes: "typing.List[Validator]" + def __init__(self, *, page_info: "PageInfo", nodes: "typing.List[Validator]"): + self.page_info = page_info + self.nodes = nodes + + def __str__(self): + return "ValidatorConnection(page_info={}, nodes={})".format(self.page_info, self.nodes) + + def __eq__(self, other): + if self.page_info != other.page_info: + return False + if self.nodes != other.nodes: + return False + return True + +class _UniffiConverterTypeValidatorConnection(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ValidatorConnection( + page_info=_UniffiConverterTypePageInfo.read(buf), + nodes=_UniffiConverterSequenceTypeValidator.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypePageInfo.check_lower(value.page_info) + _UniffiConverterSequenceTypeValidator.check_lower(value.nodes) + + @staticmethod + def write(value, buf): + _UniffiConverterTypePageInfo.write(value.page_info, buf) + _UniffiConverterSequenceTypeValidator.write(value.nodes, buf) + + class ValidatorCredentials: authority_pub_key: "typing.Optional[Base64]" network_pub_key: "typing.Optional[Base64]" @@ -5187,6 +6135,35 @@ def write(value, buf): _UniffiConverterSequenceTypeValidator.write(value.data, buf) +class ValidatorSet: + active_validators: "ValidatorConnection" + def __init__(self, *, active_validators: "ValidatorConnection"): + self.active_validators = active_validators + + def __str__(self): + return "ValidatorSet(active_validators={})".format(self.active_validators) + + def __eq__(self, other): + if self.active_validators != other.active_validators: + return False + return True + +class _UniffiConverterTypeValidatorSet(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ValidatorSet( + active_validators=_UniffiConverterTypeValidatorConnection.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeValidatorConnection.check_lower(value.active_validators) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeValidatorConnection.write(value.active_validators, buf) + + @@ -5553,6 +6530,10 @@ def write(value, buf): class Direction(enum.Enum): + """ + Pagination direction. + """ + FORWARD = 0 BACKWARD = 1 @@ -5870,7 +6851,7 @@ def __eq__(self, other): return False return True - class IOTA_MOVE_VERIFICATION_ERROR: + class IOTA_MOVE_VERIFICATION: """ IOTA Move Bytecode Verification Error. """ @@ -5880,14 +6861,14 @@ def __init__(self,): pass def __str__(self): - return "ExecutionError.IOTA_MOVE_VERIFICATION_ERROR()".format() + return "ExecutionError.IOTA_MOVE_VERIFICATION()".format() def __eq__(self, other): - if not other.is_IOTA_MOVE_VERIFICATION_ERROR(): + if not other.is_IOTA_MOVE_VERIFICATION(): return False return True - class MOVE_PRIMITIVE_RUNTIME_ERROR: + class MOVE_PRIMITIVE_RUNTIME: """ Error from a non-abort instruction. Possible causes: @@ -5900,10 +6881,10 @@ def __init__(self,location: "typing.Optional[MoveLocation]"): self.location = location def __str__(self): - return "ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR(location={})".format(self.location) + return "ExecutionError.MOVE_PRIMITIVE_RUNTIME(location={})".format(self.location) def __eq__(self, other): - if not other.is_MOVE_PRIMITIVE_RUNTIME_ERROR(): + if not other.is_MOVE_PRIMITIVE_RUNTIME(): return False if self.location != other.location: return False @@ -5933,7 +6914,7 @@ def __eq__(self, other): return False return True - class VM_VERIFICATION_OR_DESERIALIZATION_ERROR: + class VM_VERIFICATION_OR_DESERIALIZATION: """ Bytecode verification error. """ @@ -5943,10 +6924,10 @@ def __init__(self,): pass def __str__(self): - return "ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR()".format() + return "ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION()".format() def __eq__(self, other): - if not other.is_VM_VERIFICATION_OR_DESERIALIZATION_ERROR(): + if not other.is_VM_VERIFICATION_OR_DESERIALIZATION(): return False return True @@ -6037,7 +7018,7 @@ def __eq__(self, other): return False return True - class COMMAND_ARGUMENT_ERROR: + class COMMAND_ARGUMENT: """ Invalid command argument """ @@ -6050,10 +7031,10 @@ def __init__(self,argument: "int", kind: "CommandArgumentError"): self.kind = kind def __str__(self): - return "ExecutionError.COMMAND_ARGUMENT_ERROR(argument={}, kind={})".format(self.argument, self.kind) + return "ExecutionError.COMMAND_ARGUMENT(argument={}, kind={})".format(self.argument, self.kind) def __eq__(self, other): - if not other.is_COMMAND_ARGUMENT_ERROR(): + if not other.is_COMMAND_ARGUMENT(): return False if self.argument != other.argument: return False @@ -6061,7 +7042,7 @@ def __eq__(self, other): return False return True - class TYPE_ARGUMENT_ERROR: + class TYPE_ARGUMENT: """ Type argument error """ @@ -6078,10 +7059,10 @@ def __init__(self,type_argument: "int", kind: "TypeArgumentError"): self.kind = kind def __str__(self): - return "ExecutionError.TYPE_ARGUMENT_ERROR(type_argument={}, kind={})".format(self.type_argument, self.kind) + return "ExecutionError.TYPE_ARGUMENT(type_argument={}, kind={})".format(self.type_argument, self.kind) def __eq__(self, other): - if not other.is_TYPE_ARGUMENT_ERROR(): + if not other.is_TYPE_ARGUMENT(): return False if self.type_argument != other.type_argument: return False @@ -6213,7 +7194,7 @@ def __eq__(self, other): return False return True - class PACKAGE_UPGRADE_ERROR: + class PACKAGE_UPGRADE: """ Invalid package upgrade """ @@ -6224,10 +7205,10 @@ def __init__(self,kind: "PackageUpgradeError"): self.kind = kind def __str__(self): - return "ExecutionError.PACKAGE_UPGRADE_ERROR(kind={})".format(self.kind) + return "ExecutionError.PACKAGE_UPGRADE(kind={})".format(self.kind) def __eq__(self, other): - if not other.is_PACKAGE_UPGRADE_ERROR(): + if not other.is_PACKAGE_UPGRADE(): return False if self.kind != other.kind: return False @@ -6494,22 +7475,22 @@ def is_PUBLISH_ERROR_NON_ZERO_ADDRESS(self) -> bool: return isinstance(self, ExecutionError.PUBLISH_ERROR_NON_ZERO_ADDRESS) def is_publish_error_non_zero_address(self) -> bool: return isinstance(self, ExecutionError.PUBLISH_ERROR_NON_ZERO_ADDRESS) - def is_IOTA_MOVE_VERIFICATION_ERROR(self) -> bool: - return isinstance(self, ExecutionError.IOTA_MOVE_VERIFICATION_ERROR) - def is_iota_move_verification_error(self) -> bool: - return isinstance(self, ExecutionError.IOTA_MOVE_VERIFICATION_ERROR) - def is_MOVE_PRIMITIVE_RUNTIME_ERROR(self) -> bool: - return isinstance(self, ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR) - def is_move_primitive_runtime_error(self) -> bool: - return isinstance(self, ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR) + def is_IOTA_MOVE_VERIFICATION(self) -> bool: + return isinstance(self, ExecutionError.IOTA_MOVE_VERIFICATION) + def is_iota_move_verification(self) -> bool: + return isinstance(self, ExecutionError.IOTA_MOVE_VERIFICATION) + def is_MOVE_PRIMITIVE_RUNTIME(self) -> bool: + return isinstance(self, ExecutionError.MOVE_PRIMITIVE_RUNTIME) + def is_move_primitive_runtime(self) -> bool: + return isinstance(self, ExecutionError.MOVE_PRIMITIVE_RUNTIME) def is_MOVE_ABORT(self) -> bool: return isinstance(self, ExecutionError.MOVE_ABORT) def is_move_abort(self) -> bool: return isinstance(self, ExecutionError.MOVE_ABORT) - def is_VM_VERIFICATION_OR_DESERIALIZATION_ERROR(self) -> bool: - return isinstance(self, ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR) - def is_vm_verification_or_deserialization_error(self) -> bool: - return isinstance(self, ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR) + def is_VM_VERIFICATION_OR_DESERIALIZATION(self) -> bool: + return isinstance(self, ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION) + def is_vm_verification_or_deserialization(self) -> bool: + return isinstance(self, ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION) def is_VM_INVARIANT_VIOLATION(self) -> bool: return isinstance(self, ExecutionError.VM_INVARIANT_VIOLATION) def is_vm_invariant_violation(self) -> bool: @@ -6530,14 +7511,14 @@ def is_NON_ENTRY_FUNCTION_INVOKED(self) -> bool: return isinstance(self, ExecutionError.NON_ENTRY_FUNCTION_INVOKED) def is_non_entry_function_invoked(self) -> bool: return isinstance(self, ExecutionError.NON_ENTRY_FUNCTION_INVOKED) - def is_COMMAND_ARGUMENT_ERROR(self) -> bool: - return isinstance(self, ExecutionError.COMMAND_ARGUMENT_ERROR) - def is_command_argument_error(self) -> bool: - return isinstance(self, ExecutionError.COMMAND_ARGUMENT_ERROR) - def is_TYPE_ARGUMENT_ERROR(self) -> bool: - return isinstance(self, ExecutionError.TYPE_ARGUMENT_ERROR) - def is_type_argument_error(self) -> bool: - return isinstance(self, ExecutionError.TYPE_ARGUMENT_ERROR) + def is_COMMAND_ARGUMENT(self) -> bool: + return isinstance(self, ExecutionError.COMMAND_ARGUMENT) + def is_command_argument(self) -> bool: + return isinstance(self, ExecutionError.COMMAND_ARGUMENT) + def is_TYPE_ARGUMENT(self) -> bool: + return isinstance(self, ExecutionError.TYPE_ARGUMENT) + def is_type_argument(self) -> bool: + return isinstance(self, ExecutionError.TYPE_ARGUMENT) def is_UNUSED_VALUE_WITHOUT_DROP(self) -> bool: return isinstance(self, ExecutionError.UNUSED_VALUE_WITHOUT_DROP) def is_unused_value_without_drop(self) -> bool: @@ -6562,10 +7543,10 @@ def is_PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE(self) -> bool: return isinstance(self, ExecutionError.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE) def is_publish_upgrade_dependency_downgrade(self) -> bool: return isinstance(self, ExecutionError.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE) - def is_PACKAGE_UPGRADE_ERROR(self) -> bool: - return isinstance(self, ExecutionError.PACKAGE_UPGRADE_ERROR) - def is_package_upgrade_error(self) -> bool: - return isinstance(self, ExecutionError.PACKAGE_UPGRADE_ERROR) + def is_PACKAGE_UPGRADE(self) -> bool: + return isinstance(self, ExecutionError.PACKAGE_UPGRADE) + def is_package_upgrade(self) -> bool: + return isinstance(self, ExecutionError.PACKAGE_UPGRADE) def is_WRITTEN_OBJECTS_TOO_LARGE(self) -> bool: return isinstance(self, ExecutionError.WRITTEN_OBJECTS_TOO_LARGE) def is_written_objects_too_large(self) -> bool: @@ -6625,24 +7606,24 @@ def is_invalid_linkage(self) -> bool: ExecutionError.INSUFFICIENT_COIN_BALANCE = type("ExecutionError.INSUFFICIENT_COIN_BALANCE", (ExecutionError.INSUFFICIENT_COIN_BALANCE, ExecutionError,), {}) # type: ignore ExecutionError.COIN_BALANCE_OVERFLOW = type("ExecutionError.COIN_BALANCE_OVERFLOW", (ExecutionError.COIN_BALANCE_OVERFLOW, ExecutionError,), {}) # type: ignore ExecutionError.PUBLISH_ERROR_NON_ZERO_ADDRESS = type("ExecutionError.PUBLISH_ERROR_NON_ZERO_ADDRESS", (ExecutionError.PUBLISH_ERROR_NON_ZERO_ADDRESS, ExecutionError,), {}) # type: ignore -ExecutionError.IOTA_MOVE_VERIFICATION_ERROR = type("ExecutionError.IOTA_MOVE_VERIFICATION_ERROR", (ExecutionError.IOTA_MOVE_VERIFICATION_ERROR, ExecutionError,), {}) # type: ignore -ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR = type("ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR", (ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR, ExecutionError,), {}) # type: ignore +ExecutionError.IOTA_MOVE_VERIFICATION = type("ExecutionError.IOTA_MOVE_VERIFICATION", (ExecutionError.IOTA_MOVE_VERIFICATION, ExecutionError,), {}) # type: ignore +ExecutionError.MOVE_PRIMITIVE_RUNTIME = type("ExecutionError.MOVE_PRIMITIVE_RUNTIME", (ExecutionError.MOVE_PRIMITIVE_RUNTIME, ExecutionError,), {}) # type: ignore ExecutionError.MOVE_ABORT = type("ExecutionError.MOVE_ABORT", (ExecutionError.MOVE_ABORT, ExecutionError,), {}) # type: ignore -ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR = type("ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR", (ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR, ExecutionError,), {}) # type: ignore +ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION = type("ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION", (ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION, ExecutionError,), {}) # type: ignore ExecutionError.VM_INVARIANT_VIOLATION = type("ExecutionError.VM_INVARIANT_VIOLATION", (ExecutionError.VM_INVARIANT_VIOLATION, ExecutionError,), {}) # type: ignore ExecutionError.FUNCTION_NOT_FOUND = type("ExecutionError.FUNCTION_NOT_FOUND", (ExecutionError.FUNCTION_NOT_FOUND, ExecutionError,), {}) # type: ignore ExecutionError.ARITY_MISMATCH = type("ExecutionError.ARITY_MISMATCH", (ExecutionError.ARITY_MISMATCH, ExecutionError,), {}) # type: ignore ExecutionError.TYPE_ARITY_MISMATCH = type("ExecutionError.TYPE_ARITY_MISMATCH", (ExecutionError.TYPE_ARITY_MISMATCH, ExecutionError,), {}) # type: ignore ExecutionError.NON_ENTRY_FUNCTION_INVOKED = type("ExecutionError.NON_ENTRY_FUNCTION_INVOKED", (ExecutionError.NON_ENTRY_FUNCTION_INVOKED, ExecutionError,), {}) # type: ignore -ExecutionError.COMMAND_ARGUMENT_ERROR = type("ExecutionError.COMMAND_ARGUMENT_ERROR", (ExecutionError.COMMAND_ARGUMENT_ERROR, ExecutionError,), {}) # type: ignore -ExecutionError.TYPE_ARGUMENT_ERROR = type("ExecutionError.TYPE_ARGUMENT_ERROR", (ExecutionError.TYPE_ARGUMENT_ERROR, ExecutionError,), {}) # type: ignore +ExecutionError.COMMAND_ARGUMENT = type("ExecutionError.COMMAND_ARGUMENT", (ExecutionError.COMMAND_ARGUMENT, ExecutionError,), {}) # type: ignore +ExecutionError.TYPE_ARGUMENT = type("ExecutionError.TYPE_ARGUMENT", (ExecutionError.TYPE_ARGUMENT, ExecutionError,), {}) # type: ignore ExecutionError.UNUSED_VALUE_WITHOUT_DROP = type("ExecutionError.UNUSED_VALUE_WITHOUT_DROP", (ExecutionError.UNUSED_VALUE_WITHOUT_DROP, ExecutionError,), {}) # type: ignore ExecutionError.INVALID_PUBLIC_FUNCTION_RETURN_TYPE = type("ExecutionError.INVALID_PUBLIC_FUNCTION_RETURN_TYPE", (ExecutionError.INVALID_PUBLIC_FUNCTION_RETURN_TYPE, ExecutionError,), {}) # type: ignore ExecutionError.INVALID_TRANSFER_OBJECT = type("ExecutionError.INVALID_TRANSFER_OBJECT", (ExecutionError.INVALID_TRANSFER_OBJECT, ExecutionError,), {}) # type: ignore ExecutionError.EFFECTS_TOO_LARGE = type("ExecutionError.EFFECTS_TOO_LARGE", (ExecutionError.EFFECTS_TOO_LARGE, ExecutionError,), {}) # type: ignore ExecutionError.PUBLISH_UPGRADE_MISSING_DEPENDENCY = type("ExecutionError.PUBLISH_UPGRADE_MISSING_DEPENDENCY", (ExecutionError.PUBLISH_UPGRADE_MISSING_DEPENDENCY, ExecutionError,), {}) # type: ignore ExecutionError.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE = type("ExecutionError.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE", (ExecutionError.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE, ExecutionError,), {}) # type: ignore -ExecutionError.PACKAGE_UPGRADE_ERROR = type("ExecutionError.PACKAGE_UPGRADE_ERROR", (ExecutionError.PACKAGE_UPGRADE_ERROR, ExecutionError,), {}) # type: ignore +ExecutionError.PACKAGE_UPGRADE = type("ExecutionError.PACKAGE_UPGRADE", (ExecutionError.PACKAGE_UPGRADE, ExecutionError,), {}) # type: ignore ExecutionError.WRITTEN_OBJECTS_TOO_LARGE = type("ExecutionError.WRITTEN_OBJECTS_TOO_LARGE", (ExecutionError.WRITTEN_OBJECTS_TOO_LARGE, ExecutionError,), {}) # type: ignore ExecutionError.CERTIFICATE_DENIED = type("ExecutionError.CERTIFICATE_DENIED", (ExecutionError.CERTIFICATE_DENIED, ExecutionError,), {}) # type: ignore ExecutionError.IOTA_MOVE_VERIFICATION_TIMEOUT = type("ExecutionError.IOTA_MOVE_VERIFICATION_TIMEOUT", (ExecutionError.IOTA_MOVE_VERIFICATION_TIMEOUT, ExecutionError,), {}) # type: ignore @@ -6698,10 +7679,10 @@ def read(buf): return ExecutionError.PUBLISH_ERROR_NON_ZERO_ADDRESS( ) if variant == 11: - return ExecutionError.IOTA_MOVE_VERIFICATION_ERROR( + return ExecutionError.IOTA_MOVE_VERIFICATION( ) if variant == 12: - return ExecutionError.MOVE_PRIMITIVE_RUNTIME_ERROR( + return ExecutionError.MOVE_PRIMITIVE_RUNTIME( _UniffiConverterOptionalTypeMoveLocation.read(buf), ) if variant == 13: @@ -6710,7 +7691,7 @@ def read(buf): _UniffiConverterUInt64.read(buf), ) if variant == 14: - return ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION_ERROR( + return ExecutionError.VM_VERIFICATION_OR_DESERIALIZATION( ) if variant == 15: return ExecutionError.VM_INVARIANT_VIOLATION( @@ -6728,12 +7709,12 @@ def read(buf): return ExecutionError.NON_ENTRY_FUNCTION_INVOKED( ) if variant == 20: - return ExecutionError.COMMAND_ARGUMENT_ERROR( + return ExecutionError.COMMAND_ARGUMENT( _UniffiConverterUInt16.read(buf), _UniffiConverterTypeCommandArgumentError.read(buf), ) if variant == 21: - return ExecutionError.TYPE_ARGUMENT_ERROR( + return ExecutionError.TYPE_ARGUMENT( _UniffiConverterUInt16.read(buf), _UniffiConverterTypeTypeArgumentError.read(buf), ) @@ -6761,7 +7742,7 @@ def read(buf): return ExecutionError.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE( ) if variant == 28: - return ExecutionError.PACKAGE_UPGRADE_ERROR( + return ExecutionError.PACKAGE_UPGRADE( _UniffiConverterTypePackageUpgradeError.read(buf), ) if variant == 29: @@ -6834,16 +7815,16 @@ def check_lower(value): return if value.is_PUBLISH_ERROR_NON_ZERO_ADDRESS(): return - if value.is_IOTA_MOVE_VERIFICATION_ERROR(): + if value.is_IOTA_MOVE_VERIFICATION(): return - if value.is_MOVE_PRIMITIVE_RUNTIME_ERROR(): + if value.is_MOVE_PRIMITIVE_RUNTIME(): _UniffiConverterOptionalTypeMoveLocation.check_lower(value.location) return if value.is_MOVE_ABORT(): _UniffiConverterTypeMoveLocation.check_lower(value.location) _UniffiConverterUInt64.check_lower(value.code) return - if value.is_VM_VERIFICATION_OR_DESERIALIZATION_ERROR(): + if value.is_VM_VERIFICATION_OR_DESERIALIZATION(): return if value.is_VM_INVARIANT_VIOLATION(): return @@ -6855,11 +7836,11 @@ def check_lower(value): return if value.is_NON_ENTRY_FUNCTION_INVOKED(): return - if value.is_COMMAND_ARGUMENT_ERROR(): + if value.is_COMMAND_ARGUMENT(): _UniffiConverterUInt16.check_lower(value.argument) _UniffiConverterTypeCommandArgumentError.check_lower(value.kind) return - if value.is_TYPE_ARGUMENT_ERROR(): + if value.is_TYPE_ARGUMENT(): _UniffiConverterUInt16.check_lower(value.type_argument) _UniffiConverterTypeTypeArgumentError.check_lower(value.kind) return @@ -6880,7 +7861,7 @@ def check_lower(value): return if value.is_PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE(): return - if value.is_PACKAGE_UPGRADE_ERROR(): + if value.is_PACKAGE_UPGRADE(): _UniffiConverterTypePackageUpgradeError.check_lower(value.kind) return if value.is_WRITTEN_OBJECTS_TOO_LARGE(): @@ -6942,16 +7923,16 @@ def write(value, buf): buf.write_i32(9) if value.is_PUBLISH_ERROR_NON_ZERO_ADDRESS(): buf.write_i32(10) - if value.is_IOTA_MOVE_VERIFICATION_ERROR(): + if value.is_IOTA_MOVE_VERIFICATION(): buf.write_i32(11) - if value.is_MOVE_PRIMITIVE_RUNTIME_ERROR(): + if value.is_MOVE_PRIMITIVE_RUNTIME(): buf.write_i32(12) _UniffiConverterOptionalTypeMoveLocation.write(value.location, buf) if value.is_MOVE_ABORT(): buf.write_i32(13) _UniffiConverterTypeMoveLocation.write(value.location, buf) _UniffiConverterUInt64.write(value.code, buf) - if value.is_VM_VERIFICATION_OR_DESERIALIZATION_ERROR(): + if value.is_VM_VERIFICATION_OR_DESERIALIZATION(): buf.write_i32(14) if value.is_VM_INVARIANT_VIOLATION(): buf.write_i32(15) @@ -6963,11 +7944,11 @@ def write(value, buf): buf.write_i32(18) if value.is_NON_ENTRY_FUNCTION_INVOKED(): buf.write_i32(19) - if value.is_COMMAND_ARGUMENT_ERROR(): + if value.is_COMMAND_ARGUMENT(): buf.write_i32(20) _UniffiConverterUInt16.write(value.argument, buf) _UniffiConverterTypeCommandArgumentError.write(value.kind, buf) - if value.is_TYPE_ARGUMENT_ERROR(): + if value.is_TYPE_ARGUMENT(): buf.write_i32(21) _UniffiConverterUInt16.write(value.type_argument, buf) _UniffiConverterTypeTypeArgumentError.write(value.kind, buf) @@ -6988,7 +7969,7 @@ def write(value, buf): buf.write_i32(26) if value.is_PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE(): buf.write_i32(27) - if value.is_PACKAGE_UPGRADE_ERROR(): + if value.is_PACKAGE_UPGRADE(): buf.write_i32(28) _UniffiConverterTypePackageUpgradeError.write(value.kind, buf) if value.is_WRITTEN_OBJECTS_TOO_LARGE(): @@ -7163,6 +8144,68 @@ def write(value, buf): +class Feature(enum.Enum): + ANALYTICS = 0 + + COINS = 1 + + DYNAMIC_FIELDS = 2 + + SUBSCRIPTIONS = 3 + + SYSTEM_STATE = 4 + + + +class _UniffiConverterTypeFeature(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Feature.ANALYTICS + if variant == 2: + return Feature.COINS + if variant == 3: + return Feature.DYNAMIC_FIELDS + if variant == 4: + return Feature.SUBSCRIPTIONS + if variant == 5: + return Feature.SYSTEM_STATE + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == Feature.ANALYTICS: + return + if value == Feature.COINS: + return + if value == Feature.DYNAMIC_FIELDS: + return + if value == Feature.SUBSCRIPTIONS: + return + if value == Feature.SYSTEM_STATE: + return + raise ValueError(value) + + @staticmethod + def write(value, buf): + if value == Feature.ANALYTICS: + buf.write_i32(1) + if value == Feature.COINS: + buf.write_i32(2) + if value == Feature.DYNAMIC_FIELDS: + buf.write_i32(3) + if value == Feature.SUBSCRIPTIONS: + buf.write_i32(4) + if value == Feature.SYSTEM_STATE: + buf.write_i32(5) + + + + + + + class IdOperation(enum.Enum): NONE = 0 @@ -8540,11 +9583,11 @@ def read(cls, buf): -class _UniffiConverterOptionalTypeCoinMetadata(_UniffiConverterRustBuffer): +class _UniffiConverterOptionalTypeEffectsAuxiliaryDataDigest(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): if value is not None: - _UniffiConverterTypeCoinMetadata.check_lower(value) + _UniffiConverterTypeEffectsAuxiliaryDataDigest.check_lower(value) @classmethod def write(cls, value, buf): @@ -8553,7 +9596,7 @@ def write(cls, value, buf): return buf.write_u8(1) - _UniffiConverterTypeCoinMetadata.write(value, buf) + _UniffiConverterTypeEffectsAuxiliaryDataDigest.write(value, buf) @classmethod def read(cls, buf): @@ -8561,44 +9604,17 @@ def read(cls, buf): if flag == 0: return None elif flag == 1: - return _UniffiConverterTypeCoinMetadata.read(buf) + return _UniffiConverterTypeEffectsAuxiliaryDataDigest.read(buf) else: raise InternalError("Unexpected flag byte for optional type") -class _UniffiConverterOptionalTypeEffectsAuxiliaryDataDigest(_UniffiConverterRustBuffer): +class _UniffiConverterOptionalTypeEpoch(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): if value is not None: - _UniffiConverterTypeEffectsAuxiliaryDataDigest.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterTypeEffectsAuxiliaryDataDigest.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterTypeEffectsAuxiliaryDataDigest.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - -class _UniffiConverterOptionalTypeEpoch(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterTypeEpoch.check_lower(value) + _UniffiConverterTypeEpoch.check_lower(value) @classmethod def write(cls, value, buf): @@ -8837,6 +9853,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeStructTag(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeStructTag.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeStructTag.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeStructTag.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeTransactionEffects(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -8891,6 +9934,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeTypeTag(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeTypeTag.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeTypeTag.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeTypeTag.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeCheckpointSummary(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -8918,6 +9988,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeCoinMetadata(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeCoinMetadata.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeCoinMetadata.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeCoinMetadata.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeDynamicFieldOutput(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -9475,31 +10572,6 @@ def read(cls, buf): -class _UniffiConverterSequenceTypeEvent(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterTypeEvent.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterTypeEvent.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterTypeEvent.read(buf) for i in range(count) - ] - - - class _UniffiConverterSequenceTypeMovePackage(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -9575,18 +10647,18 @@ def read(cls, buf): -class _UniffiConverterSequenceTypeObjectRef(_UniffiConverterRustBuffer): +class _UniffiConverterSequenceTypeTransactionDigest(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): for item in value: - _UniffiConverterTypeObjectRef.check_lower(item) + _UniffiConverterTypeTransactionDigest.check_lower(item) @classmethod def write(cls, value, buf): items = len(value) buf.write_i32(items) for item in value: - _UniffiConverterTypeObjectRef.write(item, buf) + _UniffiConverterTypeTransactionDigest.write(item, buf) @classmethod def read(cls, buf): @@ -9595,23 +10667,23 @@ def read(cls, buf): raise InternalError("Unexpected negative sequence length") return [ - _UniffiConverterTypeObjectRef.read(buf) for i in range(count) + _UniffiConverterTypeTransactionDigest.read(buf) for i in range(count) ] -class _UniffiConverterSequenceTypeTransactionDigest(_UniffiConverterRustBuffer): +class _UniffiConverterSequenceTypeTransactionEffects(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): for item in value: - _UniffiConverterTypeTransactionDigest.check_lower(item) + _UniffiConverterTypeTransactionEffects.check_lower(item) @classmethod def write(cls, value, buf): items = len(value) buf.write_i32(items) for item in value: - _UniffiConverterTypeTransactionDigest.write(item, buf) + _UniffiConverterTypeTransactionEffects.write(item, buf) @classmethod def read(cls, buf): @@ -9620,23 +10692,23 @@ def read(cls, buf): raise InternalError("Unexpected negative sequence length") return [ - _UniffiConverterTypeTransactionDigest.read(buf) for i in range(count) + _UniffiConverterTypeTransactionEffects.read(buf) for i in range(count) ] -class _UniffiConverterSequenceTypeTransactionEffects(_UniffiConverterRustBuffer): +class _UniffiConverterSequenceTypeTypeTag(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): for item in value: - _UniffiConverterTypeTransactionEffects.check_lower(item) + _UniffiConverterTypeTypeTag.check_lower(item) @classmethod def write(cls, value, buf): items = len(value) buf.write_i32(items) for item in value: - _UniffiConverterTypeTransactionEffects.write(item, buf) + _UniffiConverterTypeTypeTag.write(item, buf) @classmethod def read(cls, buf): @@ -9645,7 +10717,7 @@ def read(cls, buf): raise InternalError("Unexpected negative sequence length") return [ - _UniffiConverterTypeTransactionEffects.read(buf) for i in range(count) + _UniffiConverterTypeTypeTag.read(buf) for i in range(count) ] @@ -9750,6 +10822,56 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeEvent(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeEvent.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeEvent.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeEvent.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeObjectRef(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeObjectRef.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeObjectRef.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeObjectRef.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeObjectReference(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -9899,6 +11021,31 @@ def read(cls, buf): ] + +class _UniffiConverterSequenceTypeFeature(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeFeature.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeFeature.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeFeature.read(buf) for i in range(count) + ] + + class _UniffiConverterTypeBase64: @staticmethod def write(value, buf): @@ -10846,10 +11993,10 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: CoinProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class CoinMetadataProtocol(typing.Protocol): +class ConsensusCommitDigestProtocol(typing.Protocol): pass -# CoinMetadata is a Rust-only trait - it's a wrapper around a Rust implementation. -class CoinMetadata(): +# ConsensusCommitDigest is a Rust-only trait - it's a wrapper around a Rust implementation. +class ConsensusCommitDigest(): _pointer: ctypes.c_void_p def __init__(self, *args, **kwargs): @@ -10859,10 +12006,10 @@ def __del__(self): # In case of partial initialization of instances. pointer = getattr(self, "_pointer", None) if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_coinmetadata, pointer) + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest, pointer) def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_coinmetadata, self._pointer) + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest, self._pointer) # Used by alternative constructors or any methods which return this type. @classmethod @@ -10875,21 +12022,21 @@ def _make_instance_(cls, pointer): -class _UniffiConverterTypeCoinMetadata: +class _UniffiConverterTypeConsensusCommitDigest: @staticmethod def lift(value: int): - return CoinMetadata._make_instance_(value) + return ConsensusCommitDigest._make_instance_(value) @staticmethod - def check_lower(value: CoinMetadata): - if not isinstance(value, CoinMetadata): - raise TypeError("Expected CoinMetadata instance, {} found".format(type(value).__name__)) + def check_lower(value: ConsensusCommitDigest): + if not isinstance(value, ConsensusCommitDigest): + raise TypeError("Expected ConsensusCommitDigest instance, {} found".format(type(value).__name__)) @staticmethod - def lower(value: CoinMetadataProtocol): - if not isinstance(value, CoinMetadata): - raise TypeError("Expected CoinMetadata instance, {} found".format(type(value).__name__)) + def lower(value: ConsensusCommitDigestProtocol): + if not isinstance(value, ConsensusCommitDigest): + raise TypeError("Expected ConsensusCommitDigest instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -10900,12 +12047,12 @@ def read(cls, buf: _UniffiRustBuffer): return cls.lift(ptr) @classmethod - def write(cls, value: CoinMetadataProtocol, buf: _UniffiRustBuffer): + def write(cls, value: ConsensusCommitDigestProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class ConsensusCommitDigestProtocol(typing.Protocol): +class ConsensusCommitPrologueV1Protocol(typing.Protocol): pass -# ConsensusCommitDigest is a Rust-only trait - it's a wrapper around a Rust implementation. -class ConsensusCommitDigest(): +# ConsensusCommitPrologueV1 is a Rust-only trait - it's a wrapper around a Rust implementation. +class ConsensusCommitPrologueV1(): _pointer: ctypes.c_void_p def __init__(self, *args, **kwargs): @@ -10915,10 +12062,10 @@ def __del__(self): # In case of partial initialization of instances. pointer = getattr(self, "_pointer", None) if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest, pointer) + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_consensuscommitprologuev1, pointer) def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest, self._pointer) + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1, self._pointer) # Used by alternative constructors or any methods which return this type. @classmethod @@ -10931,77 +12078,21 @@ def _make_instance_(cls, pointer): -class _UniffiConverterTypeConsensusCommitDigest: +class _UniffiConverterTypeConsensusCommitPrologueV1: @staticmethod def lift(value: int): - return ConsensusCommitDigest._make_instance_(value) + return ConsensusCommitPrologueV1._make_instance_(value) @staticmethod - def check_lower(value: ConsensusCommitDigest): - if not isinstance(value, ConsensusCommitDigest): - raise TypeError("Expected ConsensusCommitDigest instance, {} found".format(type(value).__name__)) + def check_lower(value: ConsensusCommitPrologueV1): + if not isinstance(value, ConsensusCommitPrologueV1): + raise TypeError("Expected ConsensusCommitPrologueV1 instance, {} found".format(type(value).__name__)) @staticmethod - def lower(value: ConsensusCommitDigestProtocol): - if not isinstance(value, ConsensusCommitDigest): - raise TypeError("Expected ConsensusCommitDigest instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - - @classmethod - def write(cls, value: ConsensusCommitDigestProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) -class ConsensusCommitPrologueV1Protocol(typing.Protocol): - pass -# ConsensusCommitPrologueV1 is a Rust-only trait - it's a wrapper around a Rust implementation. -class ConsensusCommitPrologueV1(): - _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") - - def __del__(self): - # In case of partial initialization of instances. - pointer = getattr(self, "_pointer", None) - if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_consensuscommitprologuev1, pointer) - - def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1, self._pointer) - - # Used by alternative constructors or any methods which return this type. - @classmethod - def _make_instance_(cls, pointer): - # Lightly yucky way to bypass the usual __init__ logic - # and just create a new instance with the required pointer. - inst = cls.__new__(cls) - inst._pointer = pointer - return inst - - - -class _UniffiConverterTypeConsensusCommitPrologueV1: - - @staticmethod - def lift(value: int): - return ConsensusCommitPrologueV1._make_instance_(value) - - @staticmethod - def check_lower(value: ConsensusCommitPrologueV1): - if not isinstance(value, ConsensusCommitPrologueV1): - raise TypeError("Expected ConsensusCommitPrologueV1 instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: ConsensusCommitPrologueV1Protocol): - if not isinstance(value, ConsensusCommitPrologueV1): - raise TypeError("Expected ConsensusCommitPrologueV1 instance, {} found".format(type(value).__name__)) + def lower(value: ConsensusCommitPrologueV1Protocol): + if not isinstance(value, ConsensusCommitPrologueV1): + raise TypeError("Expected ConsensusCommitPrologueV1 instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -11104,62 +12195,6 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: DigestProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class DryRunResultProtocol(typing.Protocol): - pass -# DryRunResult is a Rust-only trait - it's a wrapper around a Rust implementation. -class DryRunResult(): - _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") - - def __del__(self): - # In case of partial initialization of instances. - pointer = getattr(self, "_pointer", None) - if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_dryrunresult, pointer) - - def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_dryrunresult, self._pointer) - - # Used by alternative constructors or any methods which return this type. - @classmethod - def _make_instance_(cls, pointer): - # Lightly yucky way to bypass the usual __init__ logic - # and just create a new instance with the required pointer. - inst = cls.__new__(cls) - inst._pointer = pointer - return inst - - - -class _UniffiConverterTypeDryRunResult: - - @staticmethod - def lift(value: int): - return DryRunResult._make_instance_(value) - - @staticmethod - def check_lower(value: DryRunResult): - if not isinstance(value, DryRunResult): - raise TypeError("Expected DryRunResult instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: DryRunResultProtocol): - if not isinstance(value, DryRunResult): - raise TypeError("Expected DryRunResult instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - - @classmethod - def write(cls, value: DryRunResultProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) class Ed25519PublicKeyProtocol(typing.Protocol): """ An ed25519 public key. @@ -11531,62 +12566,6 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: EpochProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class EventProtocol(typing.Protocol): - pass -# Event is a Rust-only trait - it's a wrapper around a Rust implementation. -class Event(): - _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") - - def __del__(self): - # In case of partial initialization of instances. - pointer = getattr(self, "_pointer", None) - if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_event, pointer) - - def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_event, self._pointer) - - # Used by alternative constructors or any methods which return this type. - @classmethod - def _make_instance_(cls, pointer): - # Lightly yucky way to bypass the usual __init__ logic - # and just create a new instance with the required pointer. - inst = cls.__new__(cls) - inst._pointer = pointer - return inst - - - -class _UniffiConverterTypeEvent: - - @staticmethod - def lift(value: int): - return Event._make_instance_(value) - - @staticmethod - def check_lower(value: Event): - if not isinstance(value, Event): - raise TypeError("Expected Event instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: EventProtocol): - if not isinstance(value, Event): - raise TypeError("Expected Event instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - - @classmethod - def write(cls, value: EventProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) class ExecutionTimeObservationsProtocol(typing.Protocol): pass # ExecutionTimeObservations is a Rust-only trait - it's a wrapper around a Rust implementation. @@ -12654,9 +13633,9 @@ async def dry_run_tx(self, tx: "Transaction",skip_checks: "typing.Union[object, _UniffiConverterTypeTransaction.lower(tx), _UniffiConverterOptionalBool.lower(skip_checks) ), - _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_pointer, - _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_pointer, - _UniffiLib.ffi_iota_sdk_ffi_rust_future_free_pointer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeDryRunResult.lift, @@ -12695,9 +13674,9 @@ async def dry_run_tx_kind(self, tx_kind: "TransactionKind",tx_meta: "Transaction _UniffiConverterTypeTransactionMetadata.lower(tx_meta), _UniffiConverterOptionalBool.lower(skip_checks) ), - _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_pointer, - _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_pointer, - _UniffiLib.ffi_iota_sdk_ffi_rust_future_free_pointer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeDryRunResult.lift, @@ -13488,9 +14467,9 @@ async def service_config(self, ) -> "ServiceConfig": _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_service_config( self._uniffi_clone_pointer(), ), - _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_pointer, - _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_pointer, - _UniffiLib.ffi_iota_sdk_ffi_rust_future_free_pointer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_iota_sdk_ffi_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeServiceConfig.lift, @@ -13824,6 +14803,94 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: GraphQlClientProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class IdentifierProtocol(typing.Protocol): + """ + A move identifier + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + identifier = %x01-80 ; length of the identifier + (ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) / + (UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE)) + + UNDERSCORE = %x95 + ``` + """ + + pass +# Identifier is a Rust-only trait - it's a wrapper around a Rust implementation. +class Identifier(): + """ + A move identifier + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + identifier = %x01-80 ; length of the identifier + (ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) / + (UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE)) + + UNDERSCORE = %x95 + ``` + """ + + _pointer: ctypes.c_void_p + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_identifier, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_identifier, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + +class _UniffiConverterTypeIdentifier: + + @staticmethod + def lift(value: int): + return Identifier._make_instance_(value) + + @staticmethod + def check_lower(value: Identifier): + if not isinstance(value, Identifier): + raise TypeError("Expected Identifier instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: IdentifierProtocol): + if not isinstance(value, Identifier): + raise TypeError("Expected Identifier instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: IdentifierProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class MoveFunctionProtocol(typing.Protocol): pass # MoveFunction is a Rust-only trait - it's a wrapper around a Rust implementation. @@ -14556,62 +15623,6 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: ObjectIdProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class ObjectRefProtocol(typing.Protocol): - pass -# ObjectRef is a Rust-only trait - it's a wrapper around a Rust implementation. -class ObjectRef(): - _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") - - def __del__(self): - # In case of partial initialization of instances. - pointer = getattr(self, "_pointer", None) - if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_objectref, pointer) - - def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_objectref, self._pointer) - - # Used by alternative constructors or any methods which return this type. - @classmethod - def _make_instance_(cls, pointer): - # Lightly yucky way to bypass the usual __init__ logic - # and just create a new instance with the required pointer. - inst = cls.__new__(cls) - inst._pointer = pointer - return inst - - - -class _UniffiConverterTypeObjectRef: - - @staticmethod - def lift(value: int): - return ObjectRef._make_instance_(value) - - @staticmethod - def check_lower(value: ObjectRef): - if not isinstance(value, ObjectRef): - raise TypeError("Expected ObjectRef instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: ObjectRefProtocol): - if not isinstance(value, ObjectRef): - raise TypeError("Expected ObjectRef instance, {} found".format(type(value).__name__)) - return value._uniffi_clone_pointer() - - @classmethod - def read(cls, buf: _UniffiRustBuffer): - ptr = buf.read_u64() - if ptr == 0: - raise InternalError("Raw pointer value was null") - return cls.lift(ptr) - - @classmethod - def write(cls, value: ObjectRefProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) class ObjectTypeProtocol(typing.Protocol): pass # ObjectType is a Rust-only trait - it's a wrapper around a Rust implementation. @@ -15120,23 +16131,235 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: Secp256r1PublicKeyProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class ServiceConfigProtocol(typing.Protocol): - pass -# ServiceConfig is a Rust-only trait - it's a wrapper around a Rust implementation. -class ServiceConfig(): +class StructTagProtocol(typing.Protocol): + """ + Type information for a move struct + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + struct-tag = address ; address of the package + identifier ; name of the module + identifier ; name of the type + (vector type-tag) ; type parameters + ``` + """ + + def address(self, ): + raise NotImplementedError + def coin_type(self, ): + """ + Checks if this is a Coin type + """ + + raise NotImplementedError + def coin_type_opt(self, ): + """ + Checks if this is a Coin type + """ + + raise NotImplementedError +# StructTag is a Rust-only trait - it's a wrapper around a Rust implementation. +class StructTag(): + """ + Type information for a move struct + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + struct-tag = address ; address of the package + identifier ; name of the module + identifier ; name of the type + (vector type-tag) ; type parameters + ``` + """ + _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + def __init__(self, address: "Address",module: "Identifier",name: "Identifier",type_params: "typing.List[TypeTag]"): + _UniffiConverterTypeAddress.check_lower(address) + + _UniffiConverterTypeIdentifier.check_lower(module) + + _UniffiConverterTypeIdentifier.check_lower(name) + + _UniffiConverterSequenceTypeTypeTag.check_lower(type_params) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_new, + _UniffiConverterTypeAddress.lower(address), + _UniffiConverterTypeIdentifier.lower(module), + _UniffiConverterTypeIdentifier.lower(name), + _UniffiConverterSequenceTypeTypeTag.lower(type_params)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_structtag, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_structtag, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + @classmethod + def coin(cls, type_tag: "TypeTag"): + _UniffiConverterTypeTypeTag.check_lower(type_tag) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin, + _UniffiConverterTypeTypeTag.lower(type_tag)) + return cls._make_instance_(pointer) + + @classmethod + def gas_coin(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin,) + return cls._make_instance_(pointer) + + @classmethod + def staked_iota(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota,) + return cls._make_instance_(pointer) + + + + def address(self, ) -> "Address": + return _UniffiConverterTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_address,self._uniffi_clone_pointer(),) + ) + + + + + + def coin_type(self, ) -> "TypeTag": + """ + Checks if this is a Coin type + """ + + return _UniffiConverterTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type,self._uniffi_clone_pointer(),) + ) + + + + + + def coin_type_opt(self, ) -> "typing.Optional[TypeTag]": + """ + Checks if this is a Coin type + """ + + return _UniffiConverterOptionalTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeStructTag: + + @staticmethod + def lift(value: int): + return StructTag._make_instance_(value) + + @staticmethod + def check_lower(value: StructTag): + if not isinstance(value, StructTag): + raise TypeError("Expected StructTag instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: StructTagProtocol): + if not isinstance(value, StructTag): + raise TypeError("Expected StructTag instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: StructTagProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class TransactionProtocol(typing.Protocol): + """ + A transaction + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + transaction = %x00 transaction-v1 + + transaction-v1 = transaction-kind address gas-payment transaction-expiration + ``` + """ + + def expiration(self, ): + raise NotImplementedError + def gas_payment(self, ): + raise NotImplementedError + def kind(self, ): + raise NotImplementedError + def sender(self, ): + raise NotImplementedError +# Transaction is a Rust-only trait - it's a wrapper around a Rust implementation. +class Transaction(): + """ + A transaction + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + transaction = %x00 transaction-v1 + + transaction-v1 = transaction-kind address gas-payment transaction-expiration + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, kind: "TransactionKind",sender: "Address",gas_payment: "GasPayment",expiration: "TransactionExpiration"): + _UniffiConverterTypeTransactionKind.check_lower(kind) + + _UniffiConverterTypeAddress.check_lower(sender) + + _UniffiConverterTypeGasPayment.check_lower(gas_payment) + + _UniffiConverterTypeTransactionExpiration.check_lower(expiration) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transaction_new, + _UniffiConverterTypeTransactionKind.lower(kind), + _UniffiConverterTypeAddress.lower(sender), + _UniffiConverterTypeGasPayment.lower(gas_payment), + _UniffiConverterTypeTransactionExpiration.lower(expiration)) def __del__(self): # In case of partial initialization of instances. pointer = getattr(self, "_pointer", None) if pointer is not None: - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_serviceconfig, pointer) + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transaction, pointer) def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_serviceconfig, self._pointer) + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transaction, self._pointer) # Used by alternative constructors or any methods which return this type. @classmethod @@ -15148,22 +16371,58 @@ def _make_instance_(cls, pointer): return inst + def expiration(self, ) -> "TransactionExpiration": + return _UniffiConverterTypeTransactionExpiration.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_expiration,self._uniffi_clone_pointer(),) + ) + + + + + + def gas_payment(self, ) -> "GasPayment": + return _UniffiConverterTypeGasPayment.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment,self._uniffi_clone_pointer(),) + ) + -class _UniffiConverterTypeServiceConfig: + + + + def kind(self, ) -> "TransactionKind": + return _UniffiConverterTypeTransactionKind.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_kind,self._uniffi_clone_pointer(),) + ) + + + + + + def sender(self, ) -> "Address": + return _UniffiConverterTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_sender,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeTransaction: @staticmethod def lift(value: int): - return ServiceConfig._make_instance_(value) + return Transaction._make_instance_(value) @staticmethod - def check_lower(value: ServiceConfig): - if not isinstance(value, ServiceConfig): - raise TypeError("Expected ServiceConfig instance, {} found".format(type(value).__name__)) + def check_lower(value: Transaction): + if not isinstance(value, Transaction): + raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) @staticmethod - def lower(value: ServiceConfigProtocol): - if not isinstance(value, ServiceConfig): - raise TypeError("Expected ServiceConfig instance, {} found".format(type(value).__name__)) + def lower(value: TransactionProtocol): + if not isinstance(value, Transaction): + raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -15174,7 +16433,7 @@ def read(cls, buf: _UniffiRustBuffer): return cls.lift(ptr) @classmethod - def write(cls, value: ServiceConfigProtocol, buf: _UniffiRustBuffer): + def write(cls, value: TransactionProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class TransactionDigestProtocol(typing.Protocol): pass @@ -15581,9 +16840,106 @@ def read(cls, buf: _UniffiRustBuffer): def write(cls, value: TransactionKindProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class TypeTagProtocol(typing.Protocol): - pass + """ + Type of a move value + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + type-tag = type-tag-u8 \ + type-tag-u16 \ + type-tag-u32 \ + type-tag-u64 \ + type-tag-u128 \ + type-tag-u256 \ + type-tag-bool \ + type-tag-address \ + type-tag-signer \ + type-tag-vector \ + type-tag-struct + + type-tag-u8 = %x01 + type-tag-u16 = %x08 + type-tag-u32 = %x09 + type-tag-u64 = %x02 + type-tag-u128 = %x03 + type-tag-u256 = %x0a + type-tag-bool = %x00 + type-tag-address = %x04 + type-tag-signer = %x05 + type-tag-vector = %x06 type-tag + type-tag-struct = %x07 struct-tag + ``` + """ + + def as_struct_tag(self, ): + raise NotImplementedError + def as_struct_tag_opt(self, ): + raise NotImplementedError + def as_vector_type_tag(self, ): + raise NotImplementedError + def as_vector_type_tag_opt(self, ): + raise NotImplementedError + def is_address(self, ): + raise NotImplementedError + def is_bool(self, ): + raise NotImplementedError + def is_signer(self, ): + raise NotImplementedError + def is_struct(self, ): + raise NotImplementedError + def is_u128(self, ): + raise NotImplementedError + def is_u16(self, ): + raise NotImplementedError + def is_u256(self, ): + raise NotImplementedError + def is_u32(self, ): + raise NotImplementedError + def is_u64(self, ): + raise NotImplementedError + def is_u8(self, ): + raise NotImplementedError + def is_vector(self, ): + raise NotImplementedError # TypeTag is a Rust-only trait - it's a wrapper around a Rust implementation. class TypeTag(): + """ + Type of a move value + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + type-tag = type-tag-u8 \ + type-tag-u16 \ + type-tag-u32 \ + type-tag-u64 \ + type-tag-u128 \ + type-tag-u256 \ + type-tag-bool \ + type-tag-address \ + type-tag-signer \ + type-tag-vector \ + type-tag-struct + + type-tag-u8 = %x01 + type-tag-u16 = %x08 + type-tag-u32 = %x09 + type-tag-u64 = %x02 + type-tag-u128 = %x03 + type-tag-u256 = %x0a + type-tag-bool = %x00 + type-tag-address = %x04 + type-tag-signer = %x05 + type-tag-vector = %x06 type-tag + type-tag-struct = %x07 struct-tag + ``` + """ + _pointer: ctypes.c_void_p def __init__(self, *args, **kwargs): @@ -15606,6 +16962,213 @@ def _make_instance_(cls, pointer): inst = cls.__new__(cls) inst._pointer = pointer return inst + @classmethod + def address(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_address,) + return cls._make_instance_(pointer) + + @classmethod + def bool(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool,) + return cls._make_instance_(pointer) + + @classmethod + def signer(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer,) + return cls._make_instance_(pointer) + + @classmethod + def struct_tag(cls, struct_tag: "StructTag"): + _UniffiConverterTypeStructTag.check_lower(struct_tag) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag, + _UniffiConverterTypeStructTag.lower(struct_tag)) + return cls._make_instance_(pointer) + + @classmethod + def u128(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128,) + return cls._make_instance_(pointer) + + @classmethod + def u16(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16,) + return cls._make_instance_(pointer) + + @classmethod + def u256(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256,) + return cls._make_instance_(pointer) + + @classmethod + def u32(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32,) + return cls._make_instance_(pointer) + + @classmethod + def u64(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64,) + return cls._make_instance_(pointer) + + @classmethod + def u8(cls, ): + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8,) + return cls._make_instance_(pointer) + + @classmethod + def vector(cls, type_tag: "TypeTag"): + _UniffiConverterTypeTypeTag.check_lower(type_tag) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector, + _UniffiConverterTypeTypeTag.lower(type_tag)) + return cls._make_instance_(pointer) + + + + def as_struct_tag(self, ) -> "StructTag": + return _UniffiConverterTypeStructTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag,self._uniffi_clone_pointer(),) + ) + + + + + + def as_struct_tag_opt(self, ) -> "typing.Optional[StructTag]": + return _UniffiConverterOptionalTypeStructTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt,self._uniffi_clone_pointer(),) + ) + + + + + + def as_vector_type_tag(self, ) -> "TypeTag": + return _UniffiConverterTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag,self._uniffi_clone_pointer(),) + ) + + + + + + def as_vector_type_tag_opt(self, ) -> "typing.Optional[TypeTag]": + return _UniffiConverterOptionalTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt,self._uniffi_clone_pointer(),) + ) + + + + + + def is_address(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_address,self._uniffi_clone_pointer(),) + ) + + + + + + def is_bool(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool,self._uniffi_clone_pointer(),) + ) + + + + + + def is_signer(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer,self._uniffi_clone_pointer(),) + ) + + + + + + def is_struct(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct,self._uniffi_clone_pointer(),) + ) + + + + + + def is_u128(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128,self._uniffi_clone_pointer(),) + ) + + + + + + def is_u16(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16,self._uniffi_clone_pointer(),) + ) + + + + + + def is_u256(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256,self._uniffi_clone_pointer(),) + ) + + + + + + def is_u32(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32,self._uniffi_clone_pointer(),) + ) + + + + + + def is_u64(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64,self._uniffi_clone_pointer(),) + ) + + + + + + def is_u8(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8,self._uniffi_clone_pointer(),) + ) + + + + + + def is_vector(self, ) -> "bool": + return _UniffiConverterBool.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector,self._uniffi_clone_pointer(),) + ) + + + @@ -15765,6 +17328,7 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "Direction", "ExecutionError", "ExecutionStatus", + "Feature", "IdOperation", "ObjectIn", "ObjectOut", @@ -15777,38 +17341,48 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ChangedObject", "CheckpointSummary", "CheckpointSummaryPage", + "CoinMetadata", "CoinPage", + "DateTime", + "DryRunResult", "DynamicFieldName", "DynamicFieldOutput", "DynamicFieldOutputPage", "DynamicFieldValue", "EndOfEpochData", "EpochPage", + "Event", "EventFilter", "EventPage", "GasCostSummary", "GasPayment", + "GqlAddress", "MoveLocation", + "MoveObject", "MovePackagePage", "ObjectFilter", "ObjectPage", + "ObjectRef", "ObjectReference", "PageInfo", "PaginationFilter", + "ServiceConfig", "SignedTransaction", "SignedTransactionPage", - "Transaction", "TransactionDataEffects", "TransactionDataEffectsPage", "TransactionEffectsPage", "TransactionEffectsV1", "TransactionMetadata", "TransactionsFilter", + "TypeParseError", "UnchangedSharedObject", "Validator", "ValidatorCommitteeMember", + "ValidatorConnection", "ValidatorCredentials", "ValidatorPage", + "ValidatorSet", "Address", "AuthenticatorStateExpire", "AuthenticatorStateUpdateV1", @@ -15820,21 +17394,19 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "CheckpointContentsDigest", "CheckpointDigest", "Coin", - "CoinMetadata", "ConsensusCommitDigest", "ConsensusCommitPrologueV1", "Digest", - "DryRunResult", "Ed25519PublicKey", "EffectsAuxiliaryDataDigest", "EndOfEpochTransactionKind", "Epoch", - "Event", "ExecutionTimeObservations", "FaucetClient", "FaucetReceipt", "GenesisTransaction", "GraphQlClient", + "Identifier", "MoveFunction", "MoveModule", "MovePackage", @@ -15843,7 +17415,6 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ObjectData", "ObjectDigest", "ObjectId", - "ObjectRef", "ObjectType", "Owner", "ProgrammableTransaction", @@ -15851,7 +17422,8 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "RandomnessStateUpdate", "Secp256k1PublicKey", "Secp256r1PublicKey", - "ServiceConfig", + "StructTag", + "Transaction", "TransactionDigest", "TransactionEffects", "TransactionEffectsDigest", diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index ce7e6073c..557de28f8 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -6,12 +6,10 @@ use std::{str::FromStr, sync::Arc}; use base64ct::Encoding; use iota_graphql_client::{ pagination::{Direction, PaginationFilter}, - query_types::{Base64, PageInfo, TransactionBlockKindInput, ValidatorCredentials}, + query_types::{Base64, BigInt, PageInfo, TransactionBlockKindInput, ValidatorCredentials}, }; use iota_types::{Identifier, StructTag, TransactionDigest}; -use iota_graphql_client::query_types::BigInt; - use crate::types::{ address::Address, object::ObjectId, @@ -577,23 +575,6 @@ pub enum TransactionBlockKindInput { EndOfEpochTx, } -#[derive(Clone, Debug, uniffi::Record)] -pub struct BigInt { - pub value: String, -} - -impl From for BigInt { - fn from(value: iota_graphql_client::query_types::BigInt) -> Self { - BigInt { value: value.0 } - } -} - -impl From for iota_graphql_client::query_types::BigInt { - fn from(value: BigInt) -> Self { - iota_graphql_client::query_types::BigInt(value.value) - } -} - #[derive(Clone, Debug, uniffi::Record)] pub struct DateTime { pub value: String, @@ -888,43 +869,35 @@ impl From for CoreServiceConfig { } } -type CoreFeature = iota_graphql_client::query_types::Feature; - #[derive(Clone, Debug, uniffi::Enum)] pub enum Feature { Analytics, Coins, DynamicFields, - NameService, Subscriptions, SystemState, - MoveRegistry, } -impl From for Feature { - fn from(value: CoreFeature) -> Self { +impl From for Feature { + fn from(value: iota_graphql_client::query_types::Feature) -> Self { match value { - CoreFeature::Analytics => Self::Analytics, - CoreFeature::Coins => Self::Coins, - CoreFeature::DynamicFields => Self::DynamicFields, - CoreFeature::NameService => Self::NameService, - CoreFeature::Subscriptions => Self::Subscriptions, - CoreFeature::SystemState => Self::SystemState, - CoreFeature::MoveRegistry => Self::MoveRegistry, + iota_graphql_client::query_types::Feature::Analytics => Self::Analytics, + iota_graphql_client::query_types::Feature::Coins => Self::Coins, + iota_graphql_client::query_types::Feature::DynamicFields => Self::DynamicFields, + iota_graphql_client::query_types::Feature::Subscriptions => Self::Subscriptions, + iota_graphql_client::query_types::Feature::SystemState => Self::SystemState, } } } -impl From for CoreFeature { +impl From for iota_graphql_client::query_types::Feature { fn from(value: Feature) -> Self { match value { Feature::Analytics => Self::Analytics, Feature::Coins => Self::Coins, Feature::DynamicFields => Self::DynamicFields, - Feature::NameService => Self::NameService, Feature::Subscriptions => Self::Subscriptions, Feature::SystemState => Self::SystemState, - Feature::MoveRegistry => Self::MoveRegistry, } } } From 1f1bbdee7b8047f5a3883a77833ff175f4e534a4 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 14:50:52 +0200 Subject: [PATCH 05/12] nit --- crates/iota-sdk-ffi/src/types/graphql.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index 557de28f8..9144206ec 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -772,8 +772,6 @@ pub struct MoveFunction(pub iota_graphql_client::query_types::MoveFunction); #[derive(Debug, derive_more::From, uniffi::Object)] pub struct MoveModule(pub iota_graphql_client::query_types::MoveModule); -type CoreServiceConfig = iota_graphql_client::query_types::ServiceConfig; - /// Information about the configuration of the GraphQL service. #[derive(Clone, Debug, uniffi::Record)] pub struct ServiceConfig { @@ -829,8 +827,8 @@ pub struct ServiceConfig { pub request_timeout_ms: i32, } -impl From for ServiceConfig { - fn from(value: CoreServiceConfig) -> Self { +impl From for ServiceConfig { + fn from(value: iota_graphql_client::query_types::ServiceConfig) -> Self { Self { default_page_size: value.default_page_size, enabled_features: value.enabled_features.into_iter().map(Into::into).collect(), @@ -849,7 +847,7 @@ impl From for ServiceConfig { } } -impl From for CoreServiceConfig { +impl From for iota_graphql_client::query_types::ServiceConfig { fn from(value: ServiceConfig) -> Self { Self { default_page_size: value.default_page_size, From ca3f9199a164fc937625bb4a2cc9247cd4e56e9a Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 14:52:25 +0200 Subject: [PATCH 06/12] use remote derives --- crates/iota-sdk-ffi/src/types/graphql.rs | 111 ++--------------------- 1 file changed, 6 insertions(+), 105 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index 9144206ec..f21614bc0 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -6,7 +6,10 @@ use std::{str::FromStr, sync::Arc}; use base64ct::Encoding; use iota_graphql_client::{ pagination::{Direction, PaginationFilter}, - query_types::{Base64, BigInt, PageInfo, TransactionBlockKindInput, ValidatorCredentials}, + query_types::{ + Base64, BigInt, Feature, PageInfo, ServiceConfig, TransactionBlockKindInput, + ValidatorCredentials, + }, }; use iota_types::{Identifier, StructTag, TransactionDigest}; @@ -772,102 +775,24 @@ pub struct MoveFunction(pub iota_graphql_client::query_types::MoveFunction); #[derive(Debug, derive_more::From, uniffi::Object)] pub struct MoveModule(pub iota_graphql_client::query_types::MoveModule); -/// Information about the configuration of the GraphQL service. -#[derive(Clone, Debug, uniffi::Record)] +#[uniffi::remote(Record)] pub struct ServiceConfig { - /// Default number of elements allowed on a single page of a connection. pub default_page_size: i32, - /// List of all features that are enabled on this RPC service. pub enabled_features: Vec, - // TODO This field is retrieved as a string, instead of i32 - /// Maximum estimated cost of a database query used to serve a GraphQL - /// request. This is measured in the same units that the database uses - /// in EXPLAIN queries. - // pub max_db_query_cost: i32, - /// Maximum nesting allowed in struct fields when calculating the layout of - /// a single Move Type. pub max_move_value_depth: i32, - /// The maximum number of output nodes in a GraphQL response. - /// Non-connection nodes have a count of 1, while connection nodes are - /// counted as the specified 'first' or 'last' number of items, or the - /// default_page_size as set by the server if those arguments are not - /// set. Counts accumulate multiplicatively down the query tree. For - /// example, if a query starts with a connection of first: 10 and has a - /// field to a connection with last: 20, the count at the second level - /// would be 200 nodes. This is then summed to the count of 10 nodes - /// at the first level, for a total of 210 nodes. pub max_output_nodes: i32, - /// Maximum number of elements allowed on a single page of a connection. pub max_page_size: i32, - /// The maximum depth a GraphQL query can be to be accepted by this service. pub max_query_depth: i32, - /// The maximum number of nodes (field names) the service will accept in a - /// single query. pub max_query_nodes: i32, - /// Maximum length of a query payload string. pub max_query_payload_size: i32, - /// Maximum nesting allowed in type arguments in Move Types resolved by this - /// service. pub max_type_argument_depth: i32, - /// Maximum number of type arguments passed into a generic instantiation of - /// a Move Type resolved by this service. pub max_type_argument_width: i32, - /// Maximum number of structs that need to be processed when calculating the - /// layout of a single Move Type. pub max_type_nodes: i32, - /// Maximum time in milliseconds spent waiting for a response from fullnode - /// after issuing a a transaction to execute. Note that the transaction - /// may still succeed even in the case of a timeout. Transactions are - /// idempotent, so a transaction that times out should be resubmitted - /// until the network returns a definite response (success or failure, not - /// timeout). pub mutation_timeout_ms: i32, - /// Maximum time in milliseconds that will be spent to serve one query - /// request. pub request_timeout_ms: i32, } -impl From for ServiceConfig { - fn from(value: iota_graphql_client::query_types::ServiceConfig) -> Self { - Self { - default_page_size: value.default_page_size, - enabled_features: value.enabled_features.into_iter().map(Into::into).collect(), - max_move_value_depth: value.max_move_value_depth, - max_output_nodes: value.max_output_nodes, - max_page_size: value.max_page_size, - max_query_depth: value.max_query_depth, - max_query_nodes: value.max_query_nodes, - max_query_payload_size: value.max_query_payload_size, - max_type_argument_depth: value.max_type_argument_depth, - max_type_argument_width: value.max_type_argument_width, - max_type_nodes: value.max_type_nodes, - mutation_timeout_ms: value.mutation_timeout_ms, - request_timeout_ms: value.request_timeout_ms, - } - } -} - -impl From for iota_graphql_client::query_types::ServiceConfig { - fn from(value: ServiceConfig) -> Self { - Self { - default_page_size: value.default_page_size, - enabled_features: value.enabled_features.into_iter().map(Into::into).collect(), - max_move_value_depth: value.max_move_value_depth, - max_output_nodes: value.max_output_nodes, - max_page_size: value.max_page_size, - max_query_depth: value.max_query_depth, - max_query_nodes: value.max_query_nodes, - max_query_payload_size: value.max_query_payload_size, - max_type_argument_depth: value.max_type_argument_depth, - max_type_argument_width: value.max_type_argument_width, - max_type_nodes: value.max_type_nodes, - mutation_timeout_ms: value.mutation_timeout_ms, - request_timeout_ms: value.request_timeout_ms, - } - } -} - -#[derive(Clone, Debug, uniffi::Enum)] +#[uniffi::remote(Enum)] pub enum Feature { Analytics, Coins, @@ -875,27 +800,3 @@ pub enum Feature { Subscriptions, SystemState, } - -impl From for Feature { - fn from(value: iota_graphql_client::query_types::Feature) -> Self { - match value { - iota_graphql_client::query_types::Feature::Analytics => Self::Analytics, - iota_graphql_client::query_types::Feature::Coins => Self::Coins, - iota_graphql_client::query_types::Feature::DynamicFields => Self::DynamicFields, - iota_graphql_client::query_types::Feature::Subscriptions => Self::Subscriptions, - iota_graphql_client::query_types::Feature::SystemState => Self::SystemState, - } - } -} - -impl From for iota_graphql_client::query_types::Feature { - fn from(value: Feature) -> Self { - match value { - Feature::Analytics => Self::Analytics, - Feature::Coins => Self::Coins, - Feature::DynamicFields => Self::DynamicFields, - Feature::Subscriptions => Self::Subscriptions, - Feature::SystemState => Self::SystemState, - } - } -} From a984ff8de81700f29c18fe6a6f2c66588036da64 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 14:59:30 +0200 Subject: [PATCH 07/12] more issues --- crates/iota-sdk-ffi/src/graphql.rs | 21 +++-- crates/iota-sdk-ffi/src/types/graphql.rs | 97 ++--------------------- crates/iota-sdk-ffi/src/uniffi_helpers.rs | 8 +- 3 files changed, 24 insertions(+), 102 deletions(-) diff --git a/crates/iota-sdk-ffi/src/graphql.rs b/crates/iota-sdk-ffi/src/graphql.rs index 8a1df3e65..a7096064f 100644 --- a/crates/iota-sdk-ffi/src/graphql.rs +++ b/crates/iota-sdk-ffi/src/graphql.rs @@ -3,7 +3,10 @@ use std::sync::Arc; -use iota_graphql_client::pagination::PaginationFilter; +use iota_graphql_client::{ + pagination::PaginationFilter, + query_types::{CoinMetadata, ServiceConfig}, +}; use iota_types::CheckpointSequenceNumber; use tokio::sync::RwLock; @@ -14,9 +17,9 @@ use crate::{ checkpoint::CheckpointSummary, digest::{CheckpointContentsDigest, CheckpointDigest, TransactionDigest}, graphql::{ - CoinMetadata, DryRunResult, DynamicFieldOutput, Epoch, EventFilter, MoveFunction, - MoveModule, ObjectFilter, ProtocolConfigs, ServiceConfig, TransactionDataEffects, - TransactionMetadata, TransactionsFilter, + DryRunResult, DynamicFieldOutput, Epoch, EventFilter, MoveFunction, MoveModule, + ObjectFilter, ProtocolConfigs, TransactionDataEffects, TransactionMetadata, + TransactionsFilter, }, object::{MovePackage, Object, ObjectId}, signature::UserSignature, @@ -193,13 +196,7 @@ impl GraphQLClient { /// Get the coin metadata for the coin type. pub async fn coin_metadata(&self, coin_type: &str) -> Result> { - Ok(self - .0 - .read() - .await - .coin_metadata(coin_type) - .await? - .map(Into::into)) + Ok(self.0.read().await.coin_metadata(coin_type).await?) } /// Get total supply for the coin type. @@ -776,7 +773,7 @@ impl GraphQLClient { /// Get the GraphQL service configuration, including complexity limits, read /// and mutation limits, supported versions, and others. pub async fn service_config(&self) -> Result { - Ok(self.0.read().await.service_config().await?.clone().into()) + Ok(self.0.read().await.service_config().await?.clone()) } // =========================================================================== diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index f21614bc0..b911a5214 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -7,8 +7,8 @@ use base64ct::Encoding; use iota_graphql_client::{ pagination::{Direction, PaginationFilter}, query_types::{ - Base64, BigInt, Feature, PageInfo, ServiceConfig, TransactionBlockKindInput, - ValidatorCredentials, + Base64, BigInt, CoinMetadata, Feature, MoveObject, PageInfo, ServiceConfig, + TransactionBlockKindInput, ValidatorCredentials, }, }; use iota_types::{Identifier, StructTag, TransactionDigest}; @@ -530,11 +530,8 @@ impl From for iota_graphql_client::query_types::Validator { next_epoch_credentials: value.next_epoch_credentials, next_epoch_gas_price: value.next_epoch_gas_price.map(|v| v.to_string().into()), next_epoch_stake: value.next_epoch_stake.map(|v| v.to_string().into()), - operation_cap: value.operation_cap.map(|o| { - MoveObject { - bcs: Some(base64ct::Base64::encode_string(&o)), - } - .into() + operation_cap: value.operation_cap.map(|o| MoveObject { + bcs: Some(Base64(base64ct::Base64::encode_string(&o))), }), pending_pool_token_withdraw: value .pending_pool_token_withdraw @@ -578,47 +575,21 @@ pub enum TransactionBlockKindInput { EndOfEpochTx, } -#[derive(Clone, Debug, uniffi::Record)] -pub struct DateTime { - pub value: String, -} - -impl From for DateTime { - fn from(value: iota_graphql_client::query_types::DateTime) -> Self { - DateTime { value: value.0 } - } -} - -impl From for iota_graphql_client::query_types::DateTime { - fn from(value: DateTime) -> Self { - iota_graphql_client::query_types::DateTime(value.value) - } -} - -/// Information about pagination in a connection. #[uniffi::remote(Record)] pub struct PageInfo { - /// When paginating backwards, are there more items? pub has_previous_page: bool, - /// Are there more items when paginating forwards? pub has_next_page: bool, - /// When paginating backwards, the cursor to continue. #[uniffi(default = None)] pub start_cursor: Option, - /// When paginating forwards, the cursor to continue. #[uniffi(default = None)] pub end_cursor: Option, } -/// Pagination options for querying the GraphQL server. It defaults to forward -/// pagination with the GraphQL server's max page size. #[uniffi::remote(Record)] pub struct PaginationFilter { pub direction: Direction, #[uniffi(default = None)] pub cursor: Option, - /// The maximum number of items to return. If this is omitted, it will - /// lazily query the service configuration for the max page size. #[uniffi(default = None)] pub limit: Option, } @@ -697,78 +668,26 @@ impl From for iota_graphql_client::query_types::GQLAddress { } } -#[derive(Clone, Debug, uniffi::Record)] +#[uniffi::remote(Record)] pub struct MoveObject { #[uniffi(default = None)] - pub bcs: Option, -} - -impl From for MoveObject { - fn from(value: iota_graphql_client::query_types::MoveObject) -> Self { - MoveObject { - bcs: value.bcs.map(|v| v.0), - } - } -} - -impl From for iota_graphql_client::query_types::MoveObject { - fn from(value: MoveObject) -> Self { - iota_graphql_client::query_types::MoveObject { - bcs: value.bcs.map(iota_graphql_client::query_types::Base64), - } - } + pub bcs: Option, } #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ProtocolConfigs(pub iota_graphql_client::query_types::ProtocolConfigs); -/// The coin metadata associated with the given coin type. -#[derive(Clone, Debug, uniffi::Record)] +#[uniffi::remote(Record)] pub struct CoinMetadata { - /// The number of decimal places used to represent the token. pub decimals: Option, - /// Optional description of the token, provided by the creator of the token. pub description: Option, - /// Icon URL of the coin. pub icon_url: Option, - /// Full, official name of the token. pub name: Option, - /// The token's identifying abbreviation. pub symbol: Option, - /// The overall quantity of tokens that will be issued. - pub supply: Option, - /// Version of the token. + pub supply: Option, pub version: u64, } -impl From for CoinMetadata { - fn from(value: iota_graphql_client::query_types::CoinMetadata) -> Self { - Self { - decimals: value.decimals, - description: value.description, - icon_url: value.icon_url, - name: value.name, - symbol: value.symbol, - supply: value.supply.map(|s| s.0), - version: value.version, - } - } -} - -impl From for iota_graphql_client::query_types::CoinMetadata { - fn from(value: CoinMetadata) -> Self { - Self { - decimals: value.decimals, - description: value.description, - icon_url: value.icon_url, - name: value.name, - symbol: value.symbol, - supply: value.supply.map(BigInt), - version: value.version, - } - } -} - #[derive(Debug, derive_more::From, uniffi::Object)] pub struct MoveFunction(pub iota_graphql_client::query_types::MoveFunction); diff --git a/crates/iota-sdk-ffi/src/uniffi_helpers.rs b/crates/iota-sdk-ffi/src/uniffi_helpers.rs index 9029ea835..9af0ca464 100644 --- a/crates/iota-sdk-ffi/src/uniffi_helpers.rs +++ b/crates/iota-sdk-ffi/src/uniffi_helpers.rs @@ -1,7 +1,7 @@ // Copyright (c) 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_graphql_client::query_types::{Base64, PageInfo}; +use iota_graphql_client::query_types::{Base64, BigInt, PageInfo}; use serde_json::Value; use crate::types::{ @@ -87,3 +87,9 @@ uniffi::custom_type!(Base64, String, { lower: |val| val.0, try_lift: |s| Ok(Base64(s)), }); + +uniffi::custom_type!(BigInt, String, { + remote, + lower: |val| val.0, + try_lift: |s| Ok(BigInt(s)), +}); From ec7c1292b19f01f3999193fd6b57792f627a9278 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 10:19:34 +0200 Subject: [PATCH 08/12] fix test --- bindings/python/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index 6198bbac1..40cf6334c 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -47,9 +47,9 @@ async def main(): ) if txn is not None: - for sig in txn.signatures(): + for sig in txn.signatures: print("Scheme: ", sig.scheme(), sig.scheme().value) - print("Sender: ", txn.transaction().sender().to_hex()) + print("Sender: ", txn.transaction.sender().to_hex()) service_config = ServiceConfig( default_page_size=2, From a8c62142c34a57ba5842459bdf31a84770bd0554 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 10:23:31 +0200 Subject: [PATCH 09/12] add default tags --- crates/iota-sdk-ffi/src/types/graphql.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index b911a5214..21c07668f 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -679,11 +679,17 @@ pub struct ProtocolConfigs(pub iota_graphql_client::query_types::ProtocolConfigs #[uniffi::remote(Record)] pub struct CoinMetadata { + #[uniffi(default = None)] pub decimals: Option, + #[uniffi(default = None)] pub description: Option, + #[uniffi(default = None)] pub icon_url: Option, + #[uniffi(default = None)] pub name: Option, + #[uniffi(default = None)] pub symbol: Option, + #[uniffi(default = None)] pub supply: Option, pub version: u64, } From ae860ac3f33ee2f4e4fefb5a00983b7e018b2469 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 15:16:25 +0200 Subject: [PATCH 10/12] generate bindings --- bindings/go/iota_sdk_ffi/iota_sdk_ffi.go | 576 ++++++------ bindings/go/iota_sdk_ffi/iota_sdk_ffi.h | 20 - bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt | 898 ++++++------------- 3 files changed, 620 insertions(+), 874 deletions(-) diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index 9f8546d4b..7816b6f7c 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -640,7 +640,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() }) - if checksum != 34454 { + if checksum != 10872 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata: UniFFI API checksum mismatch") } @@ -883,7 +883,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() }) - if checksum != 24210 { + if checksum != 11931 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config: UniFFI API checksum mismatch") } @@ -4988,66 +4988,6 @@ func (_ FfiDestroyerCoin) Destroy(value *Coin) { -type CoinMetadataInterface interface { -} -type CoinMetadata struct { - ffiObject FfiObject -} - - - -func (object *CoinMetadata) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterCoinMetadata struct {} - -var FfiConverterCoinMetadataINSTANCE = FfiConverterCoinMetadata{} - - -func (c FfiConverterCoinMetadata) Lift(pointer unsafe.Pointer) *CoinMetadata { - result := &CoinMetadata { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_coinmetadata(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_coinmetadata(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*CoinMetadata).Destroy) - return result -} - -func (c FfiConverterCoinMetadata) Read(reader io.Reader) *CoinMetadata { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterCoinMetadata) Lower(value *CoinMetadata) unsafe.Pointer { - // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, - // because the pointer will be decremented immediately after this function returns, - // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*CoinMetadata") - defer value.ffiObject.decrementPointer() - return pointer - -} - -func (c FfiConverterCoinMetadata) Write(writer io.Writer, value *CoinMetadata) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) -} - -type FfiDestroyerCoinMetadata struct {} - -func (_ FfiDestroyerCoinMetadata) Destroy(value *CoinMetadata) { - value.Destroy() -} - - - type ConsensusCommitDigestInterface interface { ToBase58() string ToBytes() []byte @@ -6325,7 +6265,7 @@ type GraphQlClientInterface interface { // Get a page of [`CheckpointSummary`] for the provided parameters. Checkpoints(paginationFilter PaginationFilter) (CheckpointSummaryPage, error) // Get the coin metadata for the coin type. - CoinMetadata(coinType string) (**CoinMetadata, error) + CoinMetadata(coinType string) (*CoinMetadata, error) // Get the list of coins for the specified address. // // If `coin_type` is not provided, it will default to `0x2::coin::Coin`, @@ -6487,7 +6427,7 @@ type GraphQlClientInterface interface { ReferenceGasPrice(epoch *uint64) (*uint64, error) // Get the GraphQL service configuration, including complexity limits, read // and mutation limits, supported versions, and others. - ServiceConfig() (*ServiceConfig, error) + ServiceConfig() (ServiceConfig, error) // Set the server address for the GraphQL GraphQL client. It should be a // valid URL with a host and optionally a port number. SetRpcServer(server string) error @@ -6734,7 +6674,7 @@ func (_self *GraphQlClient) Checkpoints(paginationFilter PaginationFilter) (Chec } // Get the coin metadata for the coin type. -func (_self *GraphQlClient) CoinMetadata(coinType string) (**CoinMetadata, error) { +func (_self *GraphQlClient) CoinMetadata(coinType string) (*CoinMetadata, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() res, err :=uniffiRustCallAsync[SdkFfiError]( @@ -6747,7 +6687,7 @@ func (_self *GraphQlClient) CoinMetadata(coinType string) (**CoinMetadata, error } }, // liftFn - func(ffi RustBufferI) **CoinMetadata { + func(ffi RustBufferI) *CoinMetadata { return FfiConverterOptionalCoinMetadataINSTANCE.Lift(ffi) }, C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata( @@ -7704,29 +7644,31 @@ func (_self *GraphQlClient) ReferenceGasPrice(epoch *uint64) (*uint64, error) { // Get the GraphQL service configuration, including complexity limits, read // and mutation limits, supported versions, and others. -func (_self *GraphQlClient) ServiceConfig() (*ServiceConfig, error) { +func (_self *GraphQlClient) ServiceConfig() (ServiceConfig, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() res, err :=uniffiRustCallAsync[SdkFfiError]( FfiConverterSdkFfiErrorINSTANCE, // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer { - res := C.ffi_iota_sdk_ffi_rust_future_complete_pointer(handle, status) - return res + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } }, // liftFn - func(ffi unsafe.Pointer) *ServiceConfig { + func(ffi RustBufferI) ServiceConfig { return FfiConverterServiceConfigINSTANCE.Lift(ffi) }, C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_service_config( _pointer,), // pollFn func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_pointer(handle, continuation, data) + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) }, // freeFn func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_pointer(handle) + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) }, ) @@ -10824,66 +10766,6 @@ func (_ FfiDestroyerSecp256r1Signature) Destroy(value *Secp256r1Signature) { -type ServiceConfigInterface interface { -} -type ServiceConfig struct { - ffiObject FfiObject -} - - - -func (object *ServiceConfig) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterServiceConfig struct {} - -var FfiConverterServiceConfigINSTANCE = FfiConverterServiceConfig{} - - -func (c FfiConverterServiceConfig) Lift(pointer unsafe.Pointer) *ServiceConfig { - result := &ServiceConfig { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_serviceconfig(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_serviceconfig(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*ServiceConfig).Destroy) - return result -} - -func (c FfiConverterServiceConfig) Read(reader io.Reader) *ServiceConfig { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterServiceConfig) Lower(value *ServiceConfig) unsafe.Pointer { - // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, - // because the pointer will be decremented immediately after this function returns, - // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*ServiceConfig") - defer value.ffiObject.decrementPointer() - return pointer - -} - -func (c FfiConverterServiceConfig) Write(writer io.Writer, value *ServiceConfig) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) -} - -type FfiDestroyerServiceConfig struct {} - -func (_ FfiDestroyerServiceConfig) Destroy(value *ServiceConfig) { - value.Destroy() -} - - - // A basic signature // // This enumeration defines the set of simple or basic signature schemes @@ -13216,41 +13098,6 @@ func (_ FfiDestroyerZkLoginPublicIdentifier) Destroy(value *ZkLoginPublicIdentif -type BigInt struct { - Value string -} - -func (r *BigInt) Destroy() { - FfiDestroyerString{}.Destroy(r.Value); -} - -type FfiConverterBigInt struct {} - -var FfiConverterBigIntINSTANCE = FfiConverterBigInt{} - -func (c FfiConverterBigInt) Lift(rb RustBufferI) BigInt { - return LiftFromRustBuffer[BigInt](c, rb) -} - -func (c FfiConverterBigInt) Read(reader io.Reader) BigInt { - return BigInt { - FfiConverterStringINSTANCE.Read(reader), - } -} - -func (c FfiConverterBigInt) Lower(value BigInt) C.RustBuffer { - return LowerIntoRustBuffer[BigInt](c, value) -} - -func (c FfiConverterBigInt) Write(writer io.Writer, value BigInt) { - FfiConverterStringINSTANCE.Write(writer, value.Value); -} - -type FfiDestroyerBigInt struct {} - -func (_ FfiDestroyerBigInt) Destroy(value BigInt) { - value.Destroy() -} // Input/output state of an object that was changed during execution // // # BCS @@ -13487,6 +13334,65 @@ type FfiDestroyerCheckpointSummaryPage struct {} func (_ FfiDestroyerCheckpointSummaryPage) Destroy(value CheckpointSummaryPage) { value.Destroy() } +type CoinMetadata struct { + Decimals *int32 + Description *string + IconUrl *string + Name *string + Symbol *string + Supply *BigInt + Version uint64 +} + +func (r *CoinMetadata) Destroy() { + FfiDestroyerOptionalInt32{}.Destroy(r.Decimals); + FfiDestroyerOptionalString{}.Destroy(r.Description); + FfiDestroyerOptionalString{}.Destroy(r.IconUrl); + FfiDestroyerOptionalString{}.Destroy(r.Name); + FfiDestroyerOptionalString{}.Destroy(r.Symbol); + FfiDestroyerOptionalTypeBigInt{}.Destroy(r.Supply); + FfiDestroyerUint64{}.Destroy(r.Version); +} + +type FfiConverterCoinMetadata struct {} + +var FfiConverterCoinMetadataINSTANCE = FfiConverterCoinMetadata{} + +func (c FfiConverterCoinMetadata) Lift(rb RustBufferI) CoinMetadata { + return LiftFromRustBuffer[CoinMetadata](c, rb) +} + +func (c FfiConverterCoinMetadata) Read(reader io.Reader) CoinMetadata { + return CoinMetadata { + FfiConverterOptionalInt32INSTANCE.Read(reader), + FfiConverterOptionalStringINSTANCE.Read(reader), + FfiConverterOptionalStringINSTANCE.Read(reader), + FfiConverterOptionalStringINSTANCE.Read(reader), + FfiConverterOptionalStringINSTANCE.Read(reader), + FfiConverterOptionalTypeBigIntINSTANCE.Read(reader), + FfiConverterUint64INSTANCE.Read(reader), + } +} + +func (c FfiConverterCoinMetadata) Lower(value CoinMetadata) C.RustBuffer { + return LowerIntoRustBuffer[CoinMetadata](c, value) +} + +func (c FfiConverterCoinMetadata) Write(writer io.Writer, value CoinMetadata) { + FfiConverterOptionalInt32INSTANCE.Write(writer, value.Decimals); + FfiConverterOptionalStringINSTANCE.Write(writer, value.Description); + FfiConverterOptionalStringINSTANCE.Write(writer, value.IconUrl); + FfiConverterOptionalStringINSTANCE.Write(writer, value.Name); + FfiConverterOptionalStringINSTANCE.Write(writer, value.Symbol); + FfiConverterOptionalTypeBigIntINSTANCE.Write(writer, value.Supply); + FfiConverterUint64INSTANCE.Write(writer, value.Version); +} + +type FfiDestroyerCoinMetadata struct {} + +func (_ FfiDestroyerCoinMetadata) Destroy(value CoinMetadata) { + value.Destroy() +} // A page of items returned by the GraphQL server. type CoinPage struct { // Information about the page, such as the cursor and whether there are @@ -13530,41 +13436,6 @@ type FfiDestroyerCoinPage struct {} func (_ FfiDestroyerCoinPage) Destroy(value CoinPage) { value.Destroy() } -type DateTime struct { - Value string -} - -func (r *DateTime) Destroy() { - FfiDestroyerString{}.Destroy(r.Value); -} - -type FfiConverterDateTime struct {} - -var FfiConverterDateTimeINSTANCE = FfiConverterDateTime{} - -func (c FfiConverterDateTime) Lift(rb RustBufferI) DateTime { - return LiftFromRustBuffer[DateTime](c, rb) -} - -func (c FfiConverterDateTime) Read(reader io.Reader) DateTime { - return DateTime { - FfiConverterStringINSTANCE.Read(reader), - } -} - -func (c FfiConverterDateTime) Lower(value DateTime) C.RustBuffer { - return LowerIntoRustBuffer[DateTime](c, value) -} - -func (c FfiConverterDateTime) Write(writer io.Writer, value DateTime) { - FfiConverterStringINSTANCE.Write(writer, value.Value); -} - -type FfiDestroyerDateTime struct {} - -func (_ FfiDestroyerDateTime) Destroy(value DateTime) { - value.Destroy() -} // The result of a dry run, which includes the effects of the transaction and // any errors that may have occurred. type DryRunResult struct { @@ -14245,11 +14116,11 @@ func (_ FfiDestroyerMoveLocation) Destroy(value MoveLocation) { value.Destroy() } type MoveObject struct { - Bcs *string + Bcs *Base64 } func (r *MoveObject) Destroy() { - FfiDestroyerOptionalString{}.Destroy(r.Bcs); + FfiDestroyerOptionalTypeBase64{}.Destroy(r.Bcs); } type FfiConverterMoveObject struct {} @@ -14262,7 +14133,7 @@ func (c FfiConverterMoveObject) Lift(rb RustBufferI) MoveObject { func (c FfiConverterMoveObject) Read(reader io.Reader) MoveObject { return MoveObject { - FfiConverterOptionalStringINSTANCE.Read(reader), + FfiConverterOptionalTypeBase64INSTANCE.Read(reader), } } @@ -14271,7 +14142,7 @@ func (c FfiConverterMoveObject) Lower(value MoveObject) C.RustBuffer { } func (c FfiConverterMoveObject) Write(writer io.Writer, value MoveObject) { - FfiConverterOptionalStringINSTANCE.Write(writer, value.Bcs); + FfiConverterOptionalTypeBase64INSTANCE.Write(writer, value.Bcs); } type FfiDestroyerMoveObject struct {} @@ -14571,15 +14442,10 @@ type FfiDestroyerObjectReference struct {} func (_ FfiDestroyerObjectReference) Destroy(value ObjectReference) { value.Destroy() } -// Information about pagination in a connection. type PageInfo struct { - // When paginating backwards, are there more items? HasPreviousPage bool - // Are there more items when paginating forwards? HasNextPage bool - // When paginating backwards, the cursor to continue. StartCursor *string - // When paginating forwards, the cursor to continue. EndCursor *string } @@ -14623,13 +14489,9 @@ type FfiDestroyerPageInfo struct {} func (_ FfiDestroyerPageInfo) Destroy(value PageInfo) { value.Destroy() } -// Pagination options for querying the GraphQL server. It defaults to forward -// pagination with the GraphQL server's max page size. type PaginationFilter struct { Direction Direction Cursor *string - // The maximum number of items to return. If this is omitted, it will - // lazily query the service configuration for the max page size. Limit *int32 } @@ -14670,6 +14532,89 @@ type FfiDestroyerPaginationFilter struct {} func (_ FfiDestroyerPaginationFilter) Destroy(value PaginationFilter) { value.Destroy() } +type ServiceConfig struct { + DefaultPageSize int32 + EnabledFeatures []Feature + MaxMoveValueDepth int32 + MaxOutputNodes int32 + MaxPageSize int32 + MaxQueryDepth int32 + MaxQueryNodes int32 + MaxQueryPayloadSize int32 + MaxTypeArgumentDepth int32 + MaxTypeArgumentWidth int32 + MaxTypeNodes int32 + MutationTimeoutMs int32 + RequestTimeoutMs int32 +} + +func (r *ServiceConfig) Destroy() { + FfiDestroyerInt32{}.Destroy(r.DefaultPageSize); + FfiDestroyerSequenceFeature{}.Destroy(r.EnabledFeatures); + FfiDestroyerInt32{}.Destroy(r.MaxMoveValueDepth); + FfiDestroyerInt32{}.Destroy(r.MaxOutputNodes); + FfiDestroyerInt32{}.Destroy(r.MaxPageSize); + FfiDestroyerInt32{}.Destroy(r.MaxQueryDepth); + FfiDestroyerInt32{}.Destroy(r.MaxQueryNodes); + FfiDestroyerInt32{}.Destroy(r.MaxQueryPayloadSize); + FfiDestroyerInt32{}.Destroy(r.MaxTypeArgumentDepth); + FfiDestroyerInt32{}.Destroy(r.MaxTypeArgumentWidth); + FfiDestroyerInt32{}.Destroy(r.MaxTypeNodes); + FfiDestroyerInt32{}.Destroy(r.MutationTimeoutMs); + FfiDestroyerInt32{}.Destroy(r.RequestTimeoutMs); +} + +type FfiConverterServiceConfig struct {} + +var FfiConverterServiceConfigINSTANCE = FfiConverterServiceConfig{} + +func (c FfiConverterServiceConfig) Lift(rb RustBufferI) ServiceConfig { + return LiftFromRustBuffer[ServiceConfig](c, rb) +} + +func (c FfiConverterServiceConfig) Read(reader io.Reader) ServiceConfig { + return ServiceConfig { + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterSequenceFeatureINSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + FfiConverterInt32INSTANCE.Read(reader), + } +} + +func (c FfiConverterServiceConfig) Lower(value ServiceConfig) C.RustBuffer { + return LowerIntoRustBuffer[ServiceConfig](c, value) +} + +func (c FfiConverterServiceConfig) Write(writer io.Writer, value ServiceConfig) { + FfiConverterInt32INSTANCE.Write(writer, value.DefaultPageSize); + FfiConverterSequenceFeatureINSTANCE.Write(writer, value.EnabledFeatures); + FfiConverterInt32INSTANCE.Write(writer, value.MaxMoveValueDepth); + FfiConverterInt32INSTANCE.Write(writer, value.MaxOutputNodes); + FfiConverterInt32INSTANCE.Write(writer, value.MaxPageSize); + FfiConverterInt32INSTANCE.Write(writer, value.MaxQueryDepth); + FfiConverterInt32INSTANCE.Write(writer, value.MaxQueryNodes); + FfiConverterInt32INSTANCE.Write(writer, value.MaxQueryPayloadSize); + FfiConverterInt32INSTANCE.Write(writer, value.MaxTypeArgumentDepth); + FfiConverterInt32INSTANCE.Write(writer, value.MaxTypeArgumentWidth); + FfiConverterInt32INSTANCE.Write(writer, value.MaxTypeNodes); + FfiConverterInt32INSTANCE.Write(writer, value.MutationTimeoutMs); + FfiConverterInt32INSTANCE.Write(writer, value.RequestTimeoutMs); +} + +type FfiDestroyerServiceConfig struct {} + +func (_ FfiDestroyerServiceConfig) Destroy(value ServiceConfig) { + value.Destroy() +} type SignedTransaction struct { Transaction *Transaction Signatures []*UserSignature @@ -16654,6 +16599,42 @@ func (_ FfiDestroyerExecutionStatus) Destroy(value ExecutionStatus) { } +type Feature uint + +const ( + FeatureAnalytics Feature = 1 + FeatureCoins Feature = 2 + FeatureDynamicFields Feature = 3 + FeatureSubscriptions Feature = 4 + FeatureSystemState Feature = 5 +) + +type FfiConverterFeature struct {} + +var FfiConverterFeatureINSTANCE = FfiConverterFeature{} + +func (c FfiConverterFeature) Lift(rb RustBufferI) Feature { + return LiftFromRustBuffer[Feature](c, rb) +} + +func (c FfiConverterFeature) Lower(value Feature) C.RustBuffer { + return LowerIntoRustBuffer[Feature](c, value) +} +func (FfiConverterFeature) Read(reader io.Reader) Feature { + id := readInt32(reader) + return Feature(id) +} + +func (FfiConverterFeature) Write(writer io.Writer, value Feature) { + writeInt32(writer, int32(value)) +} + +type FfiDestroyerFeature struct {} + +func (_ FfiDestroyerFeature) Destroy(value Feature) { +} + + type IdOperation uint const ( @@ -17798,43 +17779,6 @@ func (_ FfiDestroyerOptionalCheckpointDigest) Destroy(value **CheckpointDigest) } } -type FfiConverterOptionalCoinMetadata struct{} - -var FfiConverterOptionalCoinMetadataINSTANCE = FfiConverterOptionalCoinMetadata{} - -func (c FfiConverterOptionalCoinMetadata) Lift(rb RustBufferI) **CoinMetadata { - return LiftFromRustBuffer[**CoinMetadata](c, rb) -} - -func (_ FfiConverterOptionalCoinMetadata) Read(reader io.Reader) **CoinMetadata { - if readInt8(reader) == 0 { - return nil - } - temp := FfiConverterCoinMetadataINSTANCE.Read(reader) - return &temp -} - -func (c FfiConverterOptionalCoinMetadata) Lower(value **CoinMetadata) C.RustBuffer { - return LowerIntoRustBuffer[**CoinMetadata](c, value) -} - -func (_ FfiConverterOptionalCoinMetadata) Write(writer io.Writer, value **CoinMetadata) { - if value == nil { - writeInt8(writer, 0) - } else { - writeInt8(writer, 1) - FfiConverterCoinMetadataINSTANCE.Write(writer, *value) - } -} - -type FfiDestroyerOptionalCoinMetadata struct {} - -func (_ FfiDestroyerOptionalCoinMetadata) Destroy(value **CoinMetadata) { - if value != nil { - FfiDestroyerCoinMetadata{}.Destroy(*value) - } -} - type FfiConverterOptionalEd25519PublicKey struct{} var FfiConverterOptionalEd25519PublicKeyINSTANCE = FfiConverterOptionalEd25519PublicKey{} @@ -18760,6 +18704,43 @@ func (_ FfiDestroyerOptionalCheckpointSummary) Destroy(value *CheckpointSummary) } } +type FfiConverterOptionalCoinMetadata struct{} + +var FfiConverterOptionalCoinMetadataINSTANCE = FfiConverterOptionalCoinMetadata{} + +func (c FfiConverterOptionalCoinMetadata) Lift(rb RustBufferI) *CoinMetadata { + return LiftFromRustBuffer[*CoinMetadata](c, rb) +} + +func (_ FfiConverterOptionalCoinMetadata) Read(reader io.Reader) *CoinMetadata { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterCoinMetadataINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalCoinMetadata) Lower(value *CoinMetadata) C.RustBuffer { + return LowerIntoRustBuffer[*CoinMetadata](c, value) +} + +func (_ FfiConverterOptionalCoinMetadata) Write(writer io.Writer, value *CoinMetadata) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterCoinMetadataINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalCoinMetadata struct {} + +func (_ FfiDestroyerOptionalCoinMetadata) Destroy(value *CoinMetadata) { + if value != nil { + FfiDestroyerCoinMetadata{}.Destroy(*value) + } +} + type FfiConverterOptionalDynamicFieldOutput struct{} var FfiConverterOptionalDynamicFieldOutputINSTANCE = FfiConverterOptionalDynamicFieldOutput{} @@ -19352,6 +19333,43 @@ func (_ FfiDestroyerOptionalTypeBase64) Destroy(value *Base64) { } } +type FfiConverterOptionalTypeBigInt struct{} + +var FfiConverterOptionalTypeBigIntINSTANCE = FfiConverterOptionalTypeBigInt{} + +func (c FfiConverterOptionalTypeBigInt) Lift(rb RustBufferI) *BigInt { + return LiftFromRustBuffer[*BigInt](c, rb) +} + +func (_ FfiConverterOptionalTypeBigInt) Read(reader io.Reader) *BigInt { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterTypeBigIntINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalTypeBigInt) Lower(value *BigInt) C.RustBuffer { + return LowerIntoRustBuffer[*BigInt](c, value) +} + +func (_ FfiConverterOptionalTypeBigInt) Write(writer io.Writer, value *BigInt) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterTypeBigIntINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalTypeBigInt struct {} + +func (_ FfiDestroyerOptionalTypeBigInt) Destroy(value *BigInt) { + if value != nil { + FfiDestroyerTypeBigInt{}.Destroy(*value) + } +} + type FfiConverterOptionalTypeValue struct{} var FfiConverterOptionalTypeValueINSTANCE = FfiConverterOptionalTypeValue{} @@ -20507,6 +20525,49 @@ func (FfiDestroyerSequenceValidatorCommitteeMember) Destroy(sequence []Validator } } +type FfiConverterSequenceFeature struct{} + +var FfiConverterSequenceFeatureINSTANCE = FfiConverterSequenceFeature{} + +func (c FfiConverterSequenceFeature) Lift(rb RustBufferI) []Feature { + return LiftFromRustBuffer[[]Feature](c, rb) +} + +func (c FfiConverterSequenceFeature) Read(reader io.Reader) []Feature { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]Feature, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterFeatureINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceFeature) Lower(value []Feature) C.RustBuffer { + return LowerIntoRustBuffer[[]Feature](c, value) +} + +func (c FfiConverterSequenceFeature) Write(writer io.Writer, value []Feature) { + if len(value) > math.MaxInt32 { + panic("[]Feature is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterFeatureINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceFeature struct {} + +func (FfiDestroyerSequenceFeature) Destroy(sequence []Feature) { + for _, value := range sequence { + FfiDestroyerFeature{}.Destroy(value) + } +} + type FfiConverterMapIdentifierBytes struct {} var FfiConverterMapIdentifierBytesINSTANCE = FfiConverterMapIdentifierBytes{} @@ -20603,6 +20664,15 @@ type Base64 = string type FfiConverterTypeBase64 = FfiConverterString type FfiDestroyerTypeBase64 = FfiDestroyerString var FfiConverterTypeBase64INSTANCE = FfiConverterString{} +/** + * Typealias from the type name used in the UDL file to the builtin type. This + * is needed because the UDL type name is used in function/method signatures. + * It's also what we have an external type that references a custom type. + */ +type BigInt = string +type FfiConverterTypeBigInt = FfiConverterString +type FfiDestroyerTypeBigInt = FfiDestroyerString +var FfiConverterTypeBigIntINSTANCE = FfiConverterString{} /** * Typealias from the type name used in the UDL file to the builtin type. This * is needed because the UDL type name is used in function/method signatures. diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index 8ea984b69..03da7bf2c 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -713,16 +713,6 @@ void* uniffi_iota_sdk_ffi_fn_method_coin_coin_type(void* ptr, RustCallStatus *ou void* uniffi_iota_sdk_ffi_fn_method_coin_id(void* ptr, RustCallStatus *out_status ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_COINMETADATA -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_COINMETADATA -void* uniffi_iota_sdk_ffi_fn_clone_coinmetadata(void* ptr, RustCallStatus *out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_COINMETADATA -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_COINMETADATA -void uniffi_iota_sdk_ffi_fn_free_coinmetadata(void* ptr, RustCallStatus *out_status -); -#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CONSENSUSCOMMITDIGEST #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CONSENSUSCOMMITDIGEST void* uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(void* ptr, RustCallStatus *out_status @@ -1906,16 +1896,6 @@ void* uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate(RustCallSta RustBuffer uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes(void* ptr, RustCallStatus *out_status ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SERVICECONFIG -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SERVICECONFIG -void* uniffi_iota_sdk_ffi_fn_clone_serviceconfig(void* ptr, RustCallStatus *out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SERVICECONFIG -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SERVICECONFIG -void uniffi_iota_sdk_ffi_fn_free_serviceconfig(void* ptr, RustCallStatus *out_status -); -#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SIMPLESIGNATURE #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SIMPLESIGNATURE void* uniffi_iota_sdk_ffi_fn_clone_simplesignature(void* ptr, RustCallStatus *out_status diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index 6f5880155..972cdff52 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -1462,10 +1462,6 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { - - - - @@ -2285,10 +2281,6 @@ fun uniffi_iota_sdk_ffi_fn_method_coin_coin_type(`ptr`: Pointer,uniffi_out_err: ): Pointer fun uniffi_iota_sdk_ffi_fn_method_coin_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_clone_coinmetadata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_coinmetadata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit fun uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -2755,10 +2747,6 @@ fun uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate(uniffi_out_er ): Pointer fun uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_clone_serviceconfig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_serviceconfig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit fun uniffi_iota_sdk_ffi_fn_clone_simplesignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_simplesignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3258,7 +3246,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 8422.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 34454.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 10872.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 48442.toShort()) { @@ -3339,7 +3327,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_reference_gas_price() != 39065.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() != 24210.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() != 11931.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_set_rpc_server() != 31958.toShort()) { @@ -8636,228 +8624,6 @@ public object FfiConverterTypeCoin: FfiConverter { // -public interface CoinMetadataInterface { - - companion object -} - -open class CoinMetadata: Disposable, AutoCloseable, CoinMetadataInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) - - override fun destroy() { - // Only allow a single call to this method. - // TODO: maybe we should log a warning if called more than once? - if (this.wasDestroyed.compareAndSet(false, true)) { - // This decrement always matches the initial count of 1 given at creation time. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - @Synchronized - override fun close() { - this.destroy() - } - - internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.get() - if (c == 0L) { - throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_coinmetadata(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_coinmetadata(pointer!!, status) - } - } - - - - - - companion object - -} - -/** - * @suppress - */ -public object FfiConverterTypeCoinMetadata: FfiConverter { - - override fun lower(value: CoinMetadata): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): CoinMetadata { - return CoinMetadata(value) - } - - override fun read(buf: ByteBuffer): CoinMetadata { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) - } - - override fun allocationSize(value: CoinMetadata) = 8UL - - override fun write(value: CoinMetadata, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) - } -} - - -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - - public interface ConsensusCommitDigestInterface { fun `toBase58`(): kotlin.String @@ -13465,9 +13231,9 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface ) }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeServiceConfig.lift(it) }, // Error FFI converter @@ -20674,253 +20440,31 @@ public object FfiConverterTypeSecp256r1Signature: FfiConverter callWithPointer(block: (ptr: Pointer) -> R): R { - // Check and increment the call counter, to keep the object alive. - // This needs a compare-and-set retry loop in case of concurrent updates. - do { - val c = this.callCounter.get() - if (c == 0L) { - throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") - } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") - } - } while (! this.callCounter.compareAndSet(c, c + 1L)) - // Now we can safely do the method call without the pointer being freed concurrently. - try { - return block(this.uniffiClonePointer()) - } finally { - // This decrement always matches the increment we performed above. - if (this.callCounter.decrementAndGet() == 0L) { - cleanable.clean() - } - } - } - - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_serviceconfig(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_serviceconfig(pointer!!, status) - } - } - - - - - - companion object - -} - -/** - * @suppress - */ -public object FfiConverterTypeServiceConfig: FfiConverter { - - override fun lower(value: ServiceConfig): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): ServiceConfig { - return ServiceConfig(value) - } - - override fun read(buf: ByteBuffer): ServiceConfig { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) - } - - override fun allocationSize(value: ServiceConfig) = 8UL - - override fun write(value: ServiceConfig, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) - } -} - - -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - - -/** - * A basic signature - * - * This enumeration defines the set of simple or basic signature schemes - * supported by IOTA. Most signature schemes supported by IOTA end up - * comprising of a at least one simple signature scheme. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * simple-signature-bcs = bytes ; where the contents of the bytes are defined by - * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / - * (secp256k1-flag secp256k1-signature secp256k1-public-key) / - * (secp256r1-flag secp256r1-signature secp256r1-public-key) - * ``` - * - * Note: Due to historical reasons, signatures are serialized slightly - * different from the majority of the types in IOTA. In particular if a - * signature is ever embedded in another structure it generally is serialized - * as `bytes` meaning it has a length prefix that defines the length of - * the completely serialized signature. - */ -public interface SimpleSignatureInterface { +/** + * A basic signature + * + * This enumeration defines the set of simple or basic signature schemes + * supported by IOTA. Most signature schemes supported by IOTA end up + * comprising of a at least one simple signature scheme. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * simple-signature-bcs = bytes ; where the contents of the bytes are defined by + * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / + * (secp256k1-flag secp256k1-signature secp256k1-public-key) / + * (secp256r1-flag secp256r1-signature secp256r1-public-key) + * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +public interface SimpleSignatureInterface { fun `ed25519PubKey`(): Ed25519PublicKey @@ -25789,34 +25333,6 @@ public object FfiConverterTypeZkLoginPublicIdentifier: FfiConverter { - override fun read(buf: ByteBuffer): BigInt { - return BigInt( - FfiConverterString.read(buf), - ) - } - - override fun allocationSize(value: BigInt) = ( - FfiConverterString.allocationSize(value.`value`) - ) - - override fun write(value: BigInt, buf: ByteBuffer) { - FfiConverterString.write(value.`value`, buf) - } -} - - - /** * Input/output state of an object that was changed during execution * @@ -26107,6 +25623,58 @@ public object FfiConverterTypeCheckpointSummaryPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CoinMetadata { + return CoinMetadata( + FfiConverterOptionalInt.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalTypeBigInt.read(buf), + FfiConverterULong.read(buf), + ) + } + + override fun allocationSize(value: CoinMetadata) = ( + FfiConverterOptionalInt.allocationSize(value.`decimals`) + + FfiConverterOptionalString.allocationSize(value.`description`) + + FfiConverterOptionalString.allocationSize(value.`iconUrl`) + + FfiConverterOptionalString.allocationSize(value.`name`) + + FfiConverterOptionalString.allocationSize(value.`symbol`) + + FfiConverterOptionalTypeBigInt.allocationSize(value.`supply`) + + FfiConverterULong.allocationSize(value.`version`) + ) + + override fun write(value: CoinMetadata, buf: ByteBuffer) { + FfiConverterOptionalInt.write(value.`decimals`, buf) + FfiConverterOptionalString.write(value.`description`, buf) + FfiConverterOptionalString.write(value.`iconUrl`, buf) + FfiConverterOptionalString.write(value.`name`, buf) + FfiConverterOptionalString.write(value.`symbol`, buf) + FfiConverterOptionalTypeBigInt.write(value.`supply`, buf) + FfiConverterULong.write(value.`version`, buf) + } +} + + + /** * A page of items returned by the GraphQL server. */ @@ -26158,34 +25726,6 @@ public object FfiConverterTypeCoinPage: FfiConverterRustBuffer { -data class DateTime ( - var `value`: kotlin.String -) { - - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeDateTime: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DateTime { - return DateTime( - FfiConverterString.read(buf), - ) - } - - override fun allocationSize(value: DateTime) = ( - FfiConverterString.allocationSize(value.`value`) - ) - - override fun write(value: DateTime, buf: ByteBuffer) { - FfiConverterString.write(value.`value`, buf) - } -} - - - /** * The result of a dry run, which includes the effects of the transaction and * any errors that may have occurred. @@ -26962,7 +26502,7 @@ public object FfiConverterTypeMoveLocation: FfiConverterRustBuffer data class MoveObject ( - var `bcs`: kotlin.String? = null + var `bcs`: Base64? = null ) { companion object @@ -26974,16 +26514,16 @@ data class MoveObject ( public object FfiConverterTypeMoveObject: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): MoveObject { return MoveObject( - FfiConverterOptionalString.read(buf), + FfiConverterOptionalTypeBase64.read(buf), ) } override fun allocationSize(value: MoveObject) = ( - FfiConverterOptionalString.allocationSize(value.`bcs`) + FfiConverterOptionalTypeBase64.allocationSize(value.`bcs`) ) override fun write(value: MoveObject, buf: ByteBuffer) { - FfiConverterOptionalString.write(value.`bcs`, buf) + FfiConverterOptionalTypeBase64.write(value.`bcs`, buf) } } @@ -27319,25 +26859,10 @@ public object FfiConverterTypeObjectReference: FfiConverterRustBuffer { -/** - * Pagination options for querying the GraphQL server. It defaults to forward - * pagination with the GraphQL server's max page size. - */ data class PaginationFilter ( var `direction`: Direction, var `cursor`: kotlin.String? = null, - /** - * The maximum number of items to return. If this is omitted, it will - * lazily query the service configuration for the max page size. - */ var `limit`: kotlin.Int? = null ) { @@ -27418,6 +26935,82 @@ public object FfiConverterTypePaginationFilter: FfiConverterRustBuffer, + var `maxMoveValueDepth`: kotlin.Int, + var `maxOutputNodes`: kotlin.Int, + var `maxPageSize`: kotlin.Int, + var `maxQueryDepth`: kotlin.Int, + var `maxQueryNodes`: kotlin.Int, + var `maxQueryPayloadSize`: kotlin.Int, + var `maxTypeArgumentDepth`: kotlin.Int, + var `maxTypeArgumentWidth`: kotlin.Int, + var `maxTypeNodes`: kotlin.Int, + var `mutationTimeoutMs`: kotlin.Int, + var `requestTimeoutMs`: kotlin.Int +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeServiceConfig: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ServiceConfig { + return ServiceConfig( + FfiConverterInt.read(buf), + FfiConverterSequenceTypeFeature.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + FfiConverterInt.read(buf), + ) + } + + override fun allocationSize(value: ServiceConfig) = ( + FfiConverterInt.allocationSize(value.`defaultPageSize`) + + FfiConverterSequenceTypeFeature.allocationSize(value.`enabledFeatures`) + + FfiConverterInt.allocationSize(value.`maxMoveValueDepth`) + + FfiConverterInt.allocationSize(value.`maxOutputNodes`) + + FfiConverterInt.allocationSize(value.`maxPageSize`) + + FfiConverterInt.allocationSize(value.`maxQueryDepth`) + + FfiConverterInt.allocationSize(value.`maxQueryNodes`) + + FfiConverterInt.allocationSize(value.`maxQueryPayloadSize`) + + FfiConverterInt.allocationSize(value.`maxTypeArgumentDepth`) + + FfiConverterInt.allocationSize(value.`maxTypeArgumentWidth`) + + FfiConverterInt.allocationSize(value.`maxTypeNodes`) + + FfiConverterInt.allocationSize(value.`mutationTimeoutMs`) + + FfiConverterInt.allocationSize(value.`requestTimeoutMs`) + ) + + override fun write(value: ServiceConfig, buf: ByteBuffer) { + FfiConverterInt.write(value.`defaultPageSize`, buf) + FfiConverterSequenceTypeFeature.write(value.`enabledFeatures`, buf) + FfiConverterInt.write(value.`maxMoveValueDepth`, buf) + FfiConverterInt.write(value.`maxOutputNodes`, buf) + FfiConverterInt.write(value.`maxPageSize`, buf) + FfiConverterInt.write(value.`maxQueryDepth`, buf) + FfiConverterInt.write(value.`maxQueryNodes`, buf) + FfiConverterInt.write(value.`maxQueryPayloadSize`, buf) + FfiConverterInt.write(value.`maxTypeArgumentDepth`, buf) + FfiConverterInt.write(value.`maxTypeArgumentWidth`, buf) + FfiConverterInt.write(value.`maxTypeNodes`, buf) + FfiConverterInt.write(value.`mutationTimeoutMs`, buf) + FfiConverterInt.write(value.`requestTimeoutMs`, buf) + } +} + + + data class SignedTransaction ( var `transaction`: Transaction, var `signatures`: List @@ -30084,6 +29677,39 @@ public object FfiConverterTypeExecutionStatus : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + Feature.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } + + override fun allocationSize(value: Feature) = 4UL + + override fun write(value: Feature, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) + } +} + + + + + + enum class IdOperation { NONE, @@ -31333,38 +30959,6 @@ public object FfiConverterOptionalTypeCheckpointDigest: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CoinMetadata? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeCoinMetadata.read(buf) - } - - override fun allocationSize(value: CoinMetadata?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeCoinMetadata.allocationSize(value) - } - } - - override fun write(value: CoinMetadata?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeCoinMetadata.write(value, buf) - } - } -} - - - - /** * @suppress */ @@ -32165,6 +31759,38 @@ public object FfiConverterOptionalTypeCheckpointSummary: FfiConverterRustBuffer< +/** + * @suppress + */ +public object FfiConverterOptionalTypeCoinMetadata: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CoinMetadata? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeCoinMetadata.read(buf) + } + + override fun allocationSize(value: CoinMetadata?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeCoinMetadata.allocationSize(value) + } + } + + override fun write(value: CoinMetadata?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeCoinMetadata.write(value, buf) + } + } +} + + + + /** * @suppress */ @@ -32677,6 +32303,38 @@ public object FfiConverterOptionalTypeBase64: FfiConverterRustBuffer { +/** + * @suppress + */ +public object FfiConverterOptionalTypeBigInt: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): BigInt? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeBigInt.read(buf) + } + + override fun allocationSize(value: BigInt?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeBigInt.allocationSize(value) + } + } + + override fun write(value: BigInt?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeBigInt.write(value, buf) + } + } +} + + + + /** * @suppress */ @@ -33437,6 +33095,34 @@ public object FfiConverterSequenceTypeValidatorCommitteeMember: FfiConverterRust +/** + * @suppress + */ +public object FfiConverterSequenceTypeFeature: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeFeature.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeFeature.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeFeature.write(it, buf) + } + } +} + + + + /** * @suppress */ @@ -33524,6 +33210,16 @@ public typealias FfiConverterTypeBase64 = FfiConverterString +/** + * Typealias from the type name used in the UDL file to the builtin type. This + * is needed because the UDL type name is used in function/method signatures. + * It's also what we have an external type that references a custom type. + */ +public typealias BigInt = kotlin.String +public typealias FfiConverterTypeBigInt = FfiConverterString + + + /** * Typealias from the type name used in the UDL file to the builtin type. This * is needed because the UDL type name is used in function/method signatures. From 4a006790ce69d66a1a38562aa610b4bbc5cea91d Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Wed, 13 Aug 2025 09:06:31 +0200 Subject: [PATCH 11/12] re-add comments --- bindings/go/iota_sdk_ffi/iota_sdk_ffi.go | 54 +++++++ bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt | 114 +++++++++++++++ bindings/python/lib/iota_sdk_ffi.py | 144 +++++++++++++++++++ crates/iota-sdk-ffi/src/types/graphql.rs | 57 ++++++++ 4 files changed, 369 insertions(+) diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index 6488ca76d..16e766b7a 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -13742,13 +13742,21 @@ type FfiDestroyerCheckpointSummaryPage struct {} func (_ FfiDestroyerCheckpointSummaryPage) Destroy(value CheckpointSummaryPage) { value.Destroy() } +// The coin metadata associated with the given coin type. type CoinMetadata struct { + // The number of decimal places used to represent the token. Decimals *int32 + // Optional description of the token, provided by the creator of the token. Description *string + // Icon URL of the coin. IconUrl *string + // Full, official name of the token. Name *string + // The token's identifying abbreviation. Symbol *string + // The overall quantity of tokens that will be issued. Supply *BigInt + // Version of the token. Version uint64 } @@ -14850,10 +14858,15 @@ type FfiDestroyerObjectReference struct {} func (_ FfiDestroyerObjectReference) Destroy(value ObjectReference) { value.Destroy() } +// Information about pagination in a connection. type PageInfo struct { + // When paginating backwards, are there more items? HasPreviousPage bool + // Are there more items when paginating forwards? HasNextPage bool + // When paginating backwards, the cursor to continue. StartCursor *string + // When paginating forwards, the cursor to continue. EndCursor *string } @@ -14897,9 +14910,15 @@ type FfiDestroyerPageInfo struct {} func (_ FfiDestroyerPageInfo) Destroy(value PageInfo) { value.Destroy() } +// Pagination options for querying the GraphQL server. It defaults to forward +// pagination with the GraphQL server's max page size. type PaginationFilter struct { + // The direction of pagination. Direction Direction + // An opaque cursor used for pagination. Cursor *string + // The maximum number of items to return. If this is ommitted, it will + // lazily query the service configuration for the max page size. Limit *int32 } @@ -14941,18 +14960,53 @@ func (_ FfiDestroyerPaginationFilter) Destroy(value PaginationFilter) { value.Destroy() } type ServiceConfig struct { + // Default number of elements allowed on a single page of a connection. DefaultPageSize int32 + // List of all features that are enabled on this RPC service. EnabledFeatures []Feature + // Maximum estimated cost of a database query used to serve a GraphQL + // request. This is measured in the same units that the database uses + // in EXPLAIN queries. + // Maximum nesting allowed in struct fields when calculating the layout of + // a single Move Type. MaxMoveValueDepth int32 + // The maximum number of output nodes in a GraphQL response. + // Non-connection nodes have a count of 1, while connection nodes are + // counted as the specified 'first' or 'last' number of items, or the + // default_page_size as set by the server if those arguments are not + // set. Counts accumulate multiplicatively down the query tree. For + // example, if a query starts with a connection of first: 10 and has a + // field to a connection with last: 20, the count at the second level + // would be 200 nodes. This is then summed to the count of 10 nodes + // at the first level, for a total of 210 nodes. MaxOutputNodes int32 + // Maximum number of elements allowed on a single page of a connection. MaxPageSize int32 + // The maximum depth a GraphQL query can be to be accepted by this service. MaxQueryDepth int32 + // The maximum number of nodes (field names) the service will accept in a + // single query. MaxQueryNodes int32 + // Maximum length of a query payload string. MaxQueryPayloadSize int32 + // Maximum nesting allowed in type arguments in Move Types resolved by this + // service. MaxTypeArgumentDepth int32 + // Maximum number of type arguments passed into a generic instantiation of + // a Move Type resolved by this service. MaxTypeArgumentWidth int32 + // Maximum number of structs that need to be processed when calculating the + // layout of a single Move Type. MaxTypeNodes int32 + // Maximum time in milliseconds spent waiting for a response from fullnode + // after issuing a a transaction to execute. Note that the transaction + // may still succeed even in the case of a timeout. Transactions are + // idempotent, so a transaction that times out should be resubmitted + // until the network returns a definite response (success or failure, not + // timeout). MutationTimeoutMs int32 + // Maximum time in milliseconds that will be spent to serve one query + // request. RequestTimeoutMs int32 } diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index 160af9bec..58c886980 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -26130,13 +26130,37 @@ public object FfiConverterTypeCheckpointSummaryPage: FfiConverterRustBuffer { +/** + * Pagination options for querying the GraphQL server. It defaults to forward + * pagination with the GraphQL server's max page size. + */ data class PaginationFilter ( + /** + * The direction of pagination. + */ var `direction`: Direction, + /** + * An opaque cursor used for pagination. + */ var `cursor`: kotlin.String? = null, + /** + * The maximum number of items to return. If this is ommitted, it will + * lazily query the service configuration for the max page size. + */ var `limit`: kotlin.Int? = null ) { @@ -27443,18 +27496,79 @@ public object FfiConverterTypePaginationFilter: FfiConverterRustBuffer, + /** + * Maximum estimated cost of a database query used to serve a GraphQL + * request. This is measured in the same units that the database uses + * in EXPLAIN queries. + * Maximum nesting allowed in struct fields when calculating the layout of + * a single Move Type. + */ var `maxMoveValueDepth`: kotlin.Int, + /** + * The maximum number of output nodes in a GraphQL response. + * Non-connection nodes have a count of 1, while connection nodes are + * counted as the specified 'first' or 'last' number of items, or the + * default_page_size as set by the server if those arguments are not + * set. Counts accumulate multiplicatively down the query tree. For + * example, if a query starts with a connection of first: 10 and has a + * field to a connection with last: 20, the count at the second level + * would be 200 nodes. This is then summed to the count of 10 nodes + * at the first level, for a total of 210 nodes. + */ var `maxOutputNodes`: kotlin.Int, + /** + * Maximum number of elements allowed on a single page of a connection. + */ var `maxPageSize`: kotlin.Int, + /** + * The maximum depth a GraphQL query can be to be accepted by this service. + */ var `maxQueryDepth`: kotlin.Int, + /** + * The maximum number of nodes (field names) the service will accept in a + * single query. + */ var `maxQueryNodes`: kotlin.Int, + /** + * Maximum length of a query payload string. + */ var `maxQueryPayloadSize`: kotlin.Int, + /** + * Maximum nesting allowed in type arguments in Move Types resolved by this + * service. + */ var `maxTypeArgumentDepth`: kotlin.Int, + /** + * Maximum number of type arguments passed into a generic instantiation of + * a Move Type resolved by this service. + */ var `maxTypeArgumentWidth`: kotlin.Int, + /** + * Maximum number of structs that need to be processed when calculating the + * layout of a single Move Type. + */ var `maxTypeNodes`: kotlin.Int, + /** + * Maximum time in milliseconds spent waiting for a response from fullnode + * after issuing a a transaction to execute. Note that the transaction + * may still succeed even in the case of a timeout. Transactions are + * idempotent, so a transaction that times out should be resubmitted + * until the network returns a definite response (success or failure, not + * timeout). + */ var `mutationTimeoutMs`: kotlin.Int, + /** + * Maximum time in milliseconds that will be spent to serve one query + * request. + */ var `requestTimeoutMs`: kotlin.Int ) { diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index fd0e2d07d..d7bb26dec 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -5427,13 +5427,45 @@ def write(value, buf): class CoinMetadata: + """ + The coin metadata associated with the given coin type. + """ + decimals: "typing.Optional[int]" + """ + The number of decimal places used to represent the token. + """ + description: "typing.Optional[str]" + """ + Optional description of the token, provided by the creator of the token. + """ + icon_url: "typing.Optional[str]" + """ + Icon URL of the coin. + """ + name: "typing.Optional[str]" + """ + Full, official name of the token. + """ + symbol: "typing.Optional[str]" + """ + The token's identifying abbreviation. + """ + supply: "typing.Optional[BigInt]" + """ + The overall quantity of tokens that will be issued. + """ + version: "int" + """ + Version of the token. + """ + def __init__(self, *, decimals: "typing.Optional[int]" = _DEFAULT, description: "typing.Optional[str]" = _DEFAULT, icon_url: "typing.Optional[str]" = _DEFAULT, name: "typing.Optional[str]" = _DEFAULT, symbol: "typing.Optional[str]" = _DEFAULT, supply: "typing.Optional[BigInt]" = _DEFAULT, version: "int"): if decimals is _DEFAULT: self.decimals = None @@ -6709,10 +6741,30 @@ def write(value, buf): class PageInfo: + """ + Information about pagination in a connection. + """ + has_previous_page: "bool" + """ + When paginating backwards, are there more items? + """ + has_next_page: "bool" + """ + Are there more items when paginating forwards? + """ + start_cursor: "typing.Optional[str]" + """ + When paginating backwards, the cursor to continue. + """ + end_cursor: "typing.Optional[str]" + """ + When paginating forwards, the cursor to continue. + """ + def __init__(self, *, has_previous_page: "bool", has_next_page: "bool", start_cursor: "typing.Optional[str]" = _DEFAULT, end_cursor: "typing.Optional[str]" = _DEFAULT): self.has_previous_page = has_previous_page self.has_next_page = has_next_page @@ -6765,9 +6817,27 @@ def write(value, buf): class PaginationFilter: + """ + Pagination options for querying the GraphQL server. It defaults to forward + pagination with the GraphQL server's max page size. + """ + direction: "Direction" + """ + The direction of pagination. + """ + cursor: "typing.Optional[str]" + """ + An opaque cursor used for pagination. + """ + limit: "typing.Optional[int]" + """ + The maximum number of items to return. If this is ommitted, it will + lazily query the service configuration for the max page size. + """ + def __init__(self, *, direction: "Direction", cursor: "typing.Optional[str]" = _DEFAULT, limit: "typing.Optional[int]" = _DEFAULT): self.direction = direction if cursor is _DEFAULT: @@ -6815,18 +6885,92 @@ def write(value, buf): class ServiceConfig: default_page_size: "int" + """ + Default number of elements allowed on a single page of a connection. + """ + enabled_features: "typing.List[Feature]" + """ + List of all features that are enabled on this RPC service. + """ + max_move_value_depth: "int" + """ + Maximum estimated cost of a database query used to serve a GraphQL + request. This is measured in the same units that the database uses + in EXPLAIN queries. + Maximum nesting allowed in struct fields when calculating the layout of + a single Move Type. + """ + max_output_nodes: "int" + """ + The maximum number of output nodes in a GraphQL response. + Non-connection nodes have a count of 1, while connection nodes are + counted as the specified 'first' or 'last' number of items, or the + default_page_size as set by the server if those arguments are not + set. Counts accumulate multiplicatively down the query tree. For + example, if a query starts with a connection of first: 10 and has a + field to a connection with last: 20, the count at the second level + would be 200 nodes. This is then summed to the count of 10 nodes + at the first level, for a total of 210 nodes. + """ + max_page_size: "int" + """ + Maximum number of elements allowed on a single page of a connection. + """ + max_query_depth: "int" + """ + The maximum depth a GraphQL query can be to be accepted by this service. + """ + max_query_nodes: "int" + """ + The maximum number of nodes (field names) the service will accept in a + single query. + """ + max_query_payload_size: "int" + """ + Maximum length of a query payload string. + """ + max_type_argument_depth: "int" + """ + Maximum nesting allowed in type arguments in Move Types resolved by this + service. + """ + max_type_argument_width: "int" + """ + Maximum number of type arguments passed into a generic instantiation of + a Move Type resolved by this service. + """ + max_type_nodes: "int" + """ + Maximum number of structs that need to be processed when calculating the + layout of a single Move Type. + """ + mutation_timeout_ms: "int" + """ + Maximum time in milliseconds spent waiting for a response from fullnode + after issuing a a transaction to execute. Note that the transaction + may still succeed even in the case of a timeout. Transactions are + idempotent, so a transaction that times out should be resubmitted + until the network returns a definite response (success or failure, not + timeout). + """ + request_timeout_ms: "int" + """ + Maximum time in milliseconds that will be spent to serve one query + request. + """ + def __init__(self, *, default_page_size: "int", enabled_features: "typing.List[Feature]", max_move_value_depth: "int", max_output_nodes: "int", max_page_size: "int", max_query_depth: "int", max_query_nodes: "int", max_query_payload_size: "int", max_type_argument_depth: "int", max_type_argument_width: "int", max_type_nodes: "int", mutation_timeout_ms: "int", request_timeout_ms: "int"): self.default_page_size = default_page_size self.enabled_features = enabled_features diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index 21c07668f..765022fc2 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -575,21 +575,32 @@ pub enum TransactionBlockKindInput { EndOfEpochTx, } +/// Information about pagination in a connection. #[uniffi::remote(Record)] pub struct PageInfo { + /// When paginating backwards, are there more items? pub has_previous_page: bool, + /// Are there more items when paginating forwards? pub has_next_page: bool, + /// When paginating backwards, the cursor to continue. #[uniffi(default = None)] pub start_cursor: Option, + /// When paginating forwards, the cursor to continue. #[uniffi(default = None)] pub end_cursor: Option, } +/// Pagination options for querying the GraphQL server. It defaults to forward +/// pagination with the GraphQL server's max page size. #[uniffi::remote(Record)] pub struct PaginationFilter { + /// The direction of pagination. pub direction: Direction, + /// An opaque cursor used for pagination. #[uniffi(default = None)] pub cursor: Option, + /// The maximum number of items to return. If this is ommitted, it will + /// lazily query the service configuration for the max page size. #[uniffi(default = None)] pub limit: Option, } @@ -677,20 +688,28 @@ pub struct MoveObject { #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ProtocolConfigs(pub iota_graphql_client::query_types::ProtocolConfigs); +/// The coin metadata associated with the given coin type. #[uniffi::remote(Record)] pub struct CoinMetadata { + /// The number of decimal places used to represent the token. #[uniffi(default = None)] pub decimals: Option, + /// Optional description of the token, provided by the creator of the token. #[uniffi(default = None)] pub description: Option, + /// Icon URL of the coin. #[uniffi(default = None)] pub icon_url: Option, + /// Full, official name of the token. #[uniffi(default = None)] pub name: Option, + /// The token's identifying abbreviation. #[uniffi(default = None)] pub symbol: Option, + /// The overall quantity of tokens that will be issued. #[uniffi(default = None)] pub supply: Option, + /// Version of the token. pub version: u64, } @@ -700,20 +719,58 @@ pub struct MoveFunction(pub iota_graphql_client::query_types::MoveFunction); #[derive(Debug, derive_more::From, uniffi::Object)] pub struct MoveModule(pub iota_graphql_client::query_types::MoveModule); +// Information about the configuration of the GraphQL service. #[uniffi::remote(Record)] pub struct ServiceConfig { + /// Default number of elements allowed on a single page of a connection. pub default_page_size: i32, + /// List of all features that are enabled on this RPC service. pub enabled_features: Vec, + // TODO This field is retrieved as a string, instead of i32 + /// Maximum estimated cost of a database query used to serve a GraphQL + /// request. This is measured in the same units that the database uses + /// in EXPLAIN queries. + // pub max_db_query_cost: i32, + /// Maximum nesting allowed in struct fields when calculating the layout of + /// a single Move Type. pub max_move_value_depth: i32, + /// The maximum number of output nodes in a GraphQL response. + /// Non-connection nodes have a count of 1, while connection nodes are + /// counted as the specified 'first' or 'last' number of items, or the + /// default_page_size as set by the server if those arguments are not + /// set. Counts accumulate multiplicatively down the query tree. For + /// example, if a query starts with a connection of first: 10 and has a + /// field to a connection with last: 20, the count at the second level + /// would be 200 nodes. This is then summed to the count of 10 nodes + /// at the first level, for a total of 210 nodes. pub max_output_nodes: i32, + /// Maximum number of elements allowed on a single page of a connection. pub max_page_size: i32, + /// The maximum depth a GraphQL query can be to be accepted by this service. pub max_query_depth: i32, + /// The maximum number of nodes (field names) the service will accept in a + /// single query. pub max_query_nodes: i32, + /// Maximum length of a query payload string. pub max_query_payload_size: i32, + /// Maximum nesting allowed in type arguments in Move Types resolved by this + /// service. pub max_type_argument_depth: i32, + /// Maximum number of type arguments passed into a generic instantiation of + /// a Move Type resolved by this service. pub max_type_argument_width: i32, + /// Maximum number of structs that need to be processed when calculating the + /// layout of a single Move Type. pub max_type_nodes: i32, + /// Maximum time in milliseconds spent waiting for a response from fullnode + /// after issuing a a transaction to execute. Note that the transaction + /// may still succeed even in the case of a timeout. Transactions are + /// idempotent, so a transaction that times out should be resubmitted + /// until the network returns a definite response (success or failure, not + /// timeout). pub mutation_timeout_ms: i32, + /// Maximum time in milliseconds that will be spent to serve one query + /// request. pub request_timeout_ms: i32, } From 91f5f169275b46e89cdc4c3db0e56b8469e91ad2 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Wed, 13 Aug 2025 09:08:10 +0200 Subject: [PATCH 12/12] typo --- crates/iota-sdk-ffi/src/types/graphql.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/iota-sdk-ffi/src/types/graphql.rs b/crates/iota-sdk-ffi/src/types/graphql.rs index 765022fc2..82e08b9fd 100644 --- a/crates/iota-sdk-ffi/src/types/graphql.rs +++ b/crates/iota-sdk-ffi/src/types/graphql.rs @@ -599,7 +599,7 @@ pub struct PaginationFilter { /// An opaque cursor used for pagination. #[uniffi(default = None)] pub cursor: Option, - /// The maximum number of items to return. If this is ommitted, it will + /// The maximum number of items to return. If this is omitted, it will /// lazily query the service configuration for the max page size. #[uniffi(default = None)] pub limit: Option,