From 1f0808af70f8470a5705fc7784144b7439771150 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 7 Aug 2025 14:47:52 +0200 Subject: [PATCH 01/17] add MoveStruct as Record --- crates/iota-sdk-ffi/src/types/object.rs | 33 ++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 80b979421..20e2433fc 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -146,8 +146,8 @@ impl Object { } /// Try to interpret this object as a move struct - pub fn as_struct(&self) -> Option> { - self.0.as_struct().cloned().map(Into::into).map(Arc::new) + pub fn as_struct(&self) -> Option { + self.0.as_struct().cloned().map(Into::into) } /// Return this object's owner @@ -181,7 +181,34 @@ pub struct ObjectData(pub iota_types::ObjectData); pub struct MovePackage(pub iota_types::MovePackage); #[derive(Clone, Debug, derive_more::From, uniffi::Object)] -pub struct MoveStruct(pub iota_types::MoveStruct); +pub struct StructTag(pub iota_types::StructTag); + +#[derive(Clone, Debug, uniffi::Record)] +pub struct MoveStruct { + pub type_tag: Arc, + pub version: Version, + pub contents: Vec, +} + +impl From for MoveStruct { + fn from(value: iota_types::MoveStruct) -> Self { + Self { + type_tag: Arc::new(value.type_.into()), + version: value.version, + contents: value.contents, + } + } +} + +impl From for iota_types::MoveStruct { + fn from(value: MoveStruct) -> Self { + Self { + type_: value.type_tag.0.clone(), + version: value.version, + contents: value.contents, + } + } +} #[derive(Copy, Clone, Debug, derive_more::From, derive_more::Deref, uniffi::Object)] pub struct Owner(pub iota_types::Owner); From 05f30c0df09f6a4ba4d1017328baef022b6c6a69 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Thu, 7 Aug 2025 19:33:41 +0200 Subject: [PATCH 02/17] add MovePackage --- crates/iota-sdk-ffi/src/types/object.rs | 131 +++++++++++++++++++++++- 1 file changed, 129 insertions(+), 2 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 20e2433fc..9ba3b4f72 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -1,9 +1,9 @@ // Copyright (c) 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use std::{str::FromStr, sync::Arc}; +use std::{collections::BTreeMap, str::FromStr, sync::Arc}; -use iota_types::Version; +use iota_types::{TypeParseError, Version}; use crate::{ error::Result, @@ -67,6 +67,12 @@ impl From<&iota_types::ObjectId> for ObjectId { } } +impl From<&ObjectId> for iota_types::ObjectId { + fn from(value: &ObjectId) -> Self { + (*value.0.as_address()).into() + } +} + /// Reference to an object /// /// Contains sufficient information to uniquely identify a specific object. @@ -177,9 +183,130 @@ impl Object { #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ObjectData(pub iota_types::ObjectData); +#[derive(Clone, Debug, uniffi::Record)] +pub struct Identifier { + pub inner: String, +} + +impl From for Identifier { + fn from(value: iota_types::Identifier) -> Self { + Self { + inner: value.into_inner().into_string(), + } + } +} + +impl TryFrom for iota_types::Identifier { + type Error = TypeParseError; + + fn try_from(value: Identifier) -> Result { + value.inner.parse() + } +} + +#[derive(Clone, Debug, uniffi::Record)] +pub struct TypeOrigin { + pub module_name: Identifier, + pub struct_name: Identifier, + pub package: Arc, +} + +impl From for TypeOrigin { + fn from(value: iota_types::TypeOrigin) -> Self { + Self { + module_name: value.module_name.into(), + struct_name: value.struct_name.into(), + package: Arc::new(value.package.into()), + } + } +} + +impl TryFrom for iota_types::TypeOrigin { + type Error = TypeParseError; + + fn try_from(value: TypeOrigin) -> Result { + Ok(Self { + module_name: value.module_name.try_into()?, + struct_name: value.struct_name.try_into()?, + package: **value.package, + }) + } +} + +#[derive(Clone, Debug, uniffi::Record)] +pub struct IdentifierModuleMap { + id: Identifier, + module: Vec, +} + +#[derive(Clone, Debug, uniffi::Record)] +pub struct ObjectIdUpgradeInfoMap { + id: Arc, + info: UpgradeInfo, +} + +#[derive(Clone, Debug, uniffi::Record)] +pub struct UpgradeInfo { + /// Id of the upgraded packages + pub upgraded_id: Arc, + /// Version of the upgraded package + pub upgraded_version: Version, +} + +impl From for UpgradeInfo { + fn from(value: iota_types::UpgradeInfo) -> Self { + Self { + upgraded_id: Arc::new(value.upgraded_id.into()), + upgraded_version: value.upgraded_version, + } + } +} + +impl From for iota_types::UpgradeInfo { + fn from(value: UpgradeInfo) -> Self { + Self { + upgraded_id: **value.upgraded_id, + upgraded_version: value.upgraded_version, + } + } +} + #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct MovePackage(pub iota_types::MovePackage); +#[uniffi::export] +impl MovePackage { + #[uniffi::constructor] + pub fn new( + id: &ObjectId, + version: Version, + modules: Vec, + type_origin_table: Vec, + linkage_table: Vec, + ) -> Result { + Ok(Self(iota_types::MovePackage { + id: id.into(), + version, + modules: modules + .into_iter() + .map(|m| (iota_types::Identifier::try_from(m.id), m.module)) + .map(|(r, module)| match r { + Ok(id) => Ok((id, module)), + Err(err) => Err(err), + }) + .collect::, _>>()?, + type_origin_table: type_origin_table + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + linkage_table: linkage_table + .into_iter() + .map(|m| (m.id.0, m.info.into())) + .collect(), + })) + } +} + #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct StructTag(pub iota_types::StructTag); From 1ad773994a0361fb0aa909067f258c551d3a02d1 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 8 Aug 2025 12:46:25 +0200 Subject: [PATCH 03/17] rm Identifier record; add docs --- bindings/python/lib/iota_sdk_ffi.py | 49 +++++++++++++++---- crates/iota-sdk-ffi/src/types/object.rs | 64 +++++++++++++++---------- 2 files changed, 78 insertions(+), 35 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 9dbe713e1..3621d346d 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -8503,7 +8503,7 @@ def dry_run_tx_kind(self, tx_kind: "TransactionKind",tx_meta: "TransactionMetada """ raise NotImplementedError - def dynamic_field(self, address: "Address",type: "TypeTag",name: "Value"): + def dynamic_field(self, address: "Address",type_tag: "TypeTag",name: "Value"): """ Access a dynamic field on an object using its name. Names are arbitrary Move values whose type have copy, drop, and store, and are specified @@ -8537,7 +8537,7 @@ def dynamic_fields(self, address: "Address",pagination_filter: "PaginationFilter """ raise NotImplementedError - def dynamic_object_field(self, address: "Address",type: "TypeTag",name: "Value"): + def dynamic_object_field(self, address: "Address",type_tag: "TypeTag",name: "Value"): """ Access a dynamic object field on an object using its name. Names are arbitrary Move values whose type have copy, drop, and store, and are @@ -9167,7 +9167,7 @@ async def dry_run_tx_kind(self, tx_kind: "TransactionKind",tx_meta: "Transaction - async def dynamic_field(self, address: "Address",type: "TypeTag",name: "Value") -> "typing.Optional[DynamicFieldOutput]": + async def dynamic_field(self, address: "Address",type_tag: "TypeTag",name: "Value") -> "typing.Optional[DynamicFieldOutput]": """ Access a dynamic field on an object using its name. Names are arbitrary Move values whose type have copy, drop, and store, and are specified @@ -9193,7 +9193,7 @@ async def dynamic_field(self, address: "Address",type: "TypeTag",name: "Value") _UniffiConverterTypeAddress.check_lower(address) - _UniffiConverterTypeTypeTag.check_lower(type) + _UniffiConverterTypeTypeTag.check_lower(type_tag) _UniffiConverterTypeValue.check_lower(name) @@ -9201,7 +9201,7 @@ async def dynamic_field(self, address: "Address",type: "TypeTag",name: "Value") _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field( self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(address), - _UniffiConverterTypeTypeTag.lower(type), + _UniffiConverterTypeTypeTag.lower(type_tag), _UniffiConverterTypeValue.lower(name) ), _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer, @@ -9248,7 +9248,7 @@ async def dynamic_fields(self, address: "Address",pagination_filter: "Pagination - async def dynamic_object_field(self, address: "Address",type: "TypeTag",name: "Value") -> "typing.Optional[DynamicFieldOutput]": + async def dynamic_object_field(self, address: "Address",type_tag: "TypeTag",name: "Value") -> "typing.Optional[DynamicFieldOutput]": """ Access a dynamic object field on an object using its name. Names are arbitrary Move values whose type have copy, drop, and store, and are @@ -9262,7 +9262,7 @@ async def dynamic_object_field(self, address: "Address",type: "TypeTag",name: "V _UniffiConverterTypeAddress.check_lower(address) - _UniffiConverterTypeTypeTag.check_lower(type) + _UniffiConverterTypeTypeTag.check_lower(type_tag) _UniffiConverterTypeValue.check_lower(name) @@ -9270,7 +9270,7 @@ async def dynamic_object_field(self, address: "Address",type: "TypeTag",name: "V _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field( self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(address), - _UniffiConverterTypeTypeTag.lower(type), + _UniffiConverterTypeTypeTag.lower(type_tag), _UniffiConverterTypeValue.lower(name) ), _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer, @@ -10396,9 +10396,41 @@ def read(cls, buf: _UniffiRustBuffer): def write(cls, value: MoveModuleProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class MovePackageProtocol(typing.Protocol): + """ + A move package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + object-move-package = object-id u64 move-modules type-origin-table linkage-table + + move-modules = map (identifier bytes) + type-origin-table = vector type-origin + linkage-table = map (object-id upgrade-info) + ``` + """ + pass # MovePackage is a Rust-only trait - it's a wrapper around a Rust implementation. class MovePackage(): + """ + A move package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + object-move-package = object-id u64 move-modules type-origin-table linkage-table + + move-modules = map (identifier bytes) + type-origin-table = vector type-origin + linkage-table = map (object-id upgrade-info) + ``` + """ + _pointer: ctypes.c_void_p def __init__(self, *args, **kwargs): @@ -12634,4 +12666,3 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TypeTag", "UserSignature", ] - diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 9ba3b4f72..e6967e7eb 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -13,6 +13,8 @@ use crate::{ }, }; +pub type Identifier = String; + /// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on /// the IOTA blockchain. /// @@ -183,27 +185,6 @@ impl Object { #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ObjectData(pub iota_types::ObjectData); -#[derive(Clone, Debug, uniffi::Record)] -pub struct Identifier { - pub inner: String, -} - -impl From for Identifier { - fn from(value: iota_types::Identifier) -> Self { - Self { - inner: value.into_inner().into_string(), - } - } -} - -impl TryFrom for iota_types::Identifier { - type Error = TypeParseError; - - fn try_from(value: Identifier) -> Result { - value.inner.parse() - } -} - #[derive(Clone, Debug, uniffi::Record)] pub struct TypeOrigin { pub module_name: Identifier, @@ -214,8 +195,8 @@ pub struct TypeOrigin { impl From for TypeOrigin { fn from(value: iota_types::TypeOrigin) -> Self { Self { - module_name: value.module_name.into(), - struct_name: value.struct_name.into(), + module_name: value.module_name.into_inner().into_string(), + struct_name: value.struct_name.into_inner().into_string(), package: Arc::new(value.package.into()), } } @@ -226,8 +207,8 @@ impl TryFrom for iota_types::TypeOrigin { fn try_from(value: TypeOrigin) -> Result { Ok(Self { - module_name: value.module_name.try_into()?, - struct_name: value.struct_name.try_into()?, + module_name: value.module_name.parse()?, + struct_name: value.struct_name.parse()?, package: **value.package, }) } @@ -271,6 +252,19 @@ impl From for iota_types::UpgradeInfo { } } +/// A move package +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// object-move-package = object-id u64 move-modules type-origin-table linkage-table +/// +/// move-modules = map (identifier bytes) +/// type-origin-table = vector type-origin +/// linkage-table = map (object-id upgrade-info) +/// ``` #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct MovePackage(pub iota_types::MovePackage); @@ -289,7 +283,7 @@ impl MovePackage { version, modules: modules .into_iter() - .map(|m| (iota_types::Identifier::try_from(m.id), m.module)) + .map(|m| (iota_types::Identifier::from_str(&m.id), m.module)) .map(|(r, module)| match r { Ok(id) => Ok((id, module)), Err(err) => Err(err), @@ -310,6 +304,24 @@ impl MovePackage { #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct StructTag(pub iota_types::StructTag); +/// A move struct +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// object-move-struct = compressed-struct-tag bool u64 object-contents +/// +/// compressed-struct-tag = other-struct-type / gas-coin-type / staked-iota-type / coin-type +/// other-struct-type = %x00 struct-tag +/// gas-coin-type = %x01 +/// staked-iota-type = %x02 +/// coin-type = %x03 type-tag +/// +/// ; first 32 bytes of the contents are the object's object-id +/// object-contents = uleb128 (object-id *OCTET) ; length followed by contents +/// ``` #[derive(Clone, Debug, uniffi::Record)] pub struct MoveStruct { pub type_tag: Arc, From a338b0b6d44c0a1cae703fc4c9f61af383787cae Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 8 Aug 2025 12:56:01 +0200 Subject: [PATCH 04/17] construct types in python --- bindings/python/test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index 40536050e..9b5d0325d 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, MoveStruct, MovePackage import asyncio async def main(): @@ -23,6 +23,11 @@ async def main(): filter=EventFilter(sender=my_address) + # TODO depends on StructTag + # move_struct = MoveStruct(struct_tag, version, contents) + + package_id = ObjectId.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f") + move_package = MovePackage(id=package_id, version=42, modules=[], type_origin_table=[], linkage_table=[]) if __name__ == '__main__': asyncio.run(main()) From b4dc951650282c8b2b4d2cbe7db51654d19d1905 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 8 Aug 2025 13:18:30 +0200 Subject: [PATCH 05/17] construct more types in python --- bindings/python/test.py | 11 +++++-- crates/iota-sdk-ffi/src/types/object.rs | 38 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index 9b5d0325d..e489cad36 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -1,4 +1,5 @@ -from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter, MoveStruct, MovePackage +from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter, MoveStruct, MovePackage, TypeOrigin, UpgradeInfo, IdentifierModuleMap, ObjectIdUpgradeInfoMap + import asyncio async def main(): @@ -26,8 +27,12 @@ async def main(): # TODO depends on StructTag # move_struct = MoveStruct(struct_tag, version, contents) - package_id = ObjectId.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f") - move_package = MovePackage(id=package_id, version=42, modules=[], type_origin_table=[], linkage_table=[]) + id = ObjectId.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f") + move_package = MovePackage(id, version=42, modules=[], type_origin_table=[], linkage_table=[]) + type_origin = TypeOrigin(module_name="module_name", struct_name="struct_name", package=id) + upgrade_info = UpgradeInfo(upgraded_id=id, upgraded_version=43) + id_module = IdentifierModuleMap(id="some_id", module=bytes.fromhex("48656c6c6f")) + object_id_upgrade_info = ObjectIdUpgradeInfoMap(id=id, info=upgrade_info) if __name__ == '__main__': asyncio.run(main()) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index e6967e7eb..f1f92f26d 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -13,6 +13,19 @@ use crate::{ }, }; +/// 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 +/// ``` pub type Identifier = String; /// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on @@ -185,6 +198,15 @@ impl Object { #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ObjectData(pub iota_types::ObjectData); +/// Identifies a struct and the module it was defined in +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// type-origin = identifier identifier object-id +/// ``` #[derive(Clone, Debug, uniffi::Record)] pub struct TypeOrigin { pub module_name: Identifier, @@ -214,18 +236,29 @@ impl TryFrom for iota_types::TypeOrigin { } } +/// A mapping between an identifier and a BCS encoded module. #[derive(Clone, Debug, uniffi::Record)] pub struct IdentifierModuleMap { id: Identifier, module: Vec, } +/// A mapping between an Object ID and a package upgrade info. #[derive(Clone, Debug, uniffi::Record)] pub struct ObjectIdUpgradeInfoMap { id: Arc, info: UpgradeInfo, } +/// Upgraded package info for the linkage table +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// upgrade-info = object-id u64 +/// ``` #[derive(Clone, Debug, uniffi::Record)] pub struct UpgradeInfo { /// Id of the upgraded packages @@ -324,8 +357,13 @@ pub struct StructTag(pub iota_types::StructTag); /// ``` #[derive(Clone, Debug, uniffi::Record)] pub struct MoveStruct { + /// The type of this object pub type_tag: Arc, + /// Number that increases each time a tx takes this object as a mutable + /// input This is a lamport timestamp, not a sequentially increasing + /// version pub version: Version, + /// BCS bytes of a Move struct value pub contents: Vec, } From 84df09937e84d4522741cc3f8ecac0a858595aa8 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 8 Aug 2025 13:21:53 +0200 Subject: [PATCH 06/17] use types in python --- bindings/python/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index e489cad36..ecb5d9d1f 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -28,11 +28,11 @@ async def main(): # move_struct = MoveStruct(struct_tag, version, contents) id = ObjectId.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f") - move_package = MovePackage(id, version=42, modules=[], type_origin_table=[], linkage_table=[]) type_origin = TypeOrigin(module_name="module_name", struct_name="struct_name", package=id) upgrade_info = UpgradeInfo(upgraded_id=id, upgraded_version=43) id_module = IdentifierModuleMap(id="some_id", module=bytes.fromhex("48656c6c6f")) object_id_upgrade_info = ObjectIdUpgradeInfoMap(id=id, info=upgrade_info) + move_package = MovePackage(id, version=42, modules=[id_module], type_origin_table=[type_origin], linkage_table=[object_id_upgrade_info]) if __name__ == '__main__': asyncio.run(main()) From 0f91836945555f38c2f48e65edc9487de1e0434e Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 11:15:20 +0200 Subject: [PATCH 07/17] apply python bindings changes --- bindings/python/lib/iota_sdk_ffi.py | 626 ++++++++++++++++++++++------ 1 file changed, 502 insertions(+), 124 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 3621d346d..b3ed5034b 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -503,11 +503,11 @@ 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_dry_run_tx_kind() != 47707: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 27370: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 29988: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 43452: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 61215: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 47284: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch() != 46788: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -535,7 +535,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_object_bcs() != 1970: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 2696: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 37555: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package() != 7913: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -573,7 +573,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_transactions_effects() != 2687: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() != 2473: + if lib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() != 37303: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_object_data() != 4330: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -661,6 +661,8 @@ 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_graphqlclient_new_testnet() != 48529: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 47014: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_object_new() != 56232: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes() != 41789: @@ -1509,16 +1511,15 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_movepackage.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movestruct.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movestruct.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_movestruct.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new.argtypes = ( ctypes.c_void_p, + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_movestruct.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_object.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1786,6 +1787,16 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_signedtransaction_transaction.restype = ctypes.c_void_p +_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_clone_transaction.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -2528,6 +2539,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_object_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_object_new.restype = ctypes.c_uint16 @@ -3102,7 +3116,7 @@ class DynamicFieldName: representation. """ - type: "TypeTag" + type_tag: "TypeTag" """ The type name of this dynamic field name """ @@ -3117,16 +3131,16 @@ class DynamicFieldName: The json representation of the dynamic field name """ - def __init__(self, *, type: "TypeTag", bcs: "bytes", json: "typing.Optional[Value]"): - self.type = type + def __init__(self, *, type_tag: "TypeTag", bcs: "bytes", json: "typing.Optional[Value]"): + self.type_tag = type_tag self.bcs = bcs self.json = json def __str__(self): - return "DynamicFieldName(type={}, bcs={}, json={})".format(self.type, self.bcs, self.json) + return "DynamicFieldName(type_tag={}, bcs={}, json={})".format(self.type_tag, self.bcs, self.json) def __eq__(self, other): - if self.type != other.type: + if self.type_tag != other.type_tag: return False if self.bcs != other.bcs: return False @@ -3138,20 +3152,20 @@ class _UniffiConverterTypeDynamicFieldName(_UniffiConverterRustBuffer): @staticmethod def read(buf): return DynamicFieldName( - type=_UniffiConverterTypeTypeTag.read(buf), + type_tag=_UniffiConverterTypeTypeTag.read(buf), bcs=_UniffiConverterBytes.read(buf), json=_UniffiConverterOptionalTypeValue.read(buf), ) @staticmethod def check_lower(value): - _UniffiConverterTypeTypeTag.check_lower(value.type) + _UniffiConverterTypeTypeTag.check_lower(value.type_tag) _UniffiConverterBytes.check_lower(value.bcs) _UniffiConverterOptionalTypeValue.check_lower(value.json) @staticmethod def write(value, buf): - _UniffiConverterTypeTypeTag.write(value.type, buf) + _UniffiConverterTypeTypeTag.write(value.type_tag, buf) _UniffiConverterBytes.write(value.bcs, buf) _UniffiConverterOptionalTypeValue.write(value.json, buf) @@ -3270,17 +3284,17 @@ class DynamicFieldValue: The value part of a dynamic field. """ - type: "TypeTag" + type_tag: "TypeTag" bcs: "bytes" - def __init__(self, *, type: "TypeTag", bcs: "bytes"): - self.type = type + def __init__(self, *, type_tag: "TypeTag", bcs: "bytes"): + self.type_tag = type_tag self.bcs = bcs def __str__(self): - return "DynamicFieldValue(type={}, bcs={})".format(self.type, self.bcs) + return "DynamicFieldValue(type_tag={}, bcs={})".format(self.type_tag, self.bcs) def __eq__(self, other): - if self.type != other.type: + if self.type_tag != other.type_tag: return False if self.bcs != other.bcs: return False @@ -3290,18 +3304,18 @@ class _UniffiConverterTypeDynamicFieldValue(_UniffiConverterRustBuffer): @staticmethod def read(buf): return DynamicFieldValue( - type=_UniffiConverterTypeTypeTag.read(buf), + type_tag=_UniffiConverterTypeTypeTag.read(buf), bcs=_UniffiConverterBytes.read(buf), ) @staticmethod def check_lower(value): - _UniffiConverterTypeTypeTag.check_lower(value.type) + _UniffiConverterTypeTypeTag.check_lower(value.type_tag) _UniffiConverterBytes.check_lower(value.bcs) @staticmethod def write(value, buf): - _UniffiConverterTypeTypeTag.write(value.type, buf) + _UniffiConverterTypeTypeTag.write(value.type_tag, buf) _UniffiConverterBytes.write(value.bcs, buf) @@ -3637,6 +3651,46 @@ def write(value, buf): _UniffiConverterUInt64.write(value.budget, buf) +class IdentifierModuleMap: + """ + A mapping between an identifier and a BCS encoded module. + """ + + id: "str" + module: "bytes" + def __init__(self, *, id: "str", module: "bytes"): + self.id = id + self.module = module + + def __str__(self): + return "IdentifierModuleMap(id={}, module={})".format(self.id, self.module) + + def __eq__(self, other): + if self.id != other.id: + return False + if self.module != other.module: + return False + return True + +class _UniffiConverterTypeIdentifierModuleMap(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return IdentifierModuleMap( + id=_UniffiConverterString.read(buf), + module=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.id) + _UniffiConverterBytes.check_lower(value.module) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.id, buf) + _UniffiConverterBytes.write(value.module, buf) + + class MovePackagePage: """ A page of items returned by the GraphQL server. @@ -3686,20 +3740,98 @@ def write(value, buf): _UniffiConverterSequenceTypeMovePackage.write(value.data, buf) +class MoveStruct: + """ + A move struct + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + object-move-struct = compressed-struct-tag bool u64 object-contents + + compressed-struct-tag = other-struct-type / gas-coin-type / staked-iota-type / coin-type + other-struct-type = %x00 struct-tag + gas-coin-type = %x01 + staked-iota-type = %x02 + coin-type = %x03 type-tag + + ; first 32 bytes of the contents are the object's object-id + object-contents = uleb128 (object-id *OCTET) ; length followed by contents + ``` + """ + + type_tag: "StructTag" + """ + The type of this object + """ + + version: "int" + """ + Number that increases each time a tx takes this object as a mutable + input This is a lamport timestamp, not a sequentially increasing + version + """ + + contents: "bytes" + """ + BCS bytes of a Move struct value + """ + + def __init__(self, *, type_tag: "StructTag", version: "int", contents: "bytes"): + self.type_tag = type_tag + self.version = version + self.contents = contents + + def __str__(self): + return "MoveStruct(type_tag={}, version={}, contents={})".format(self.type_tag, self.version, self.contents) + + def __eq__(self, other): + if self.type_tag != other.type_tag: + return False + if self.version != other.version: + return False + if self.contents != other.contents: + return False + return True + +class _UniffiConverterTypeMoveStruct(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MoveStruct( + type_tag=_UniffiConverterTypeStructTag.read(buf), + version=_UniffiConverterUInt64.read(buf), + contents=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeStructTag.check_lower(value.type_tag) + _UniffiConverterUInt64.check_lower(value.version) + _UniffiConverterBytes.check_lower(value.contents) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeStructTag.write(value.type_tag, buf) + _UniffiConverterUInt64.write(value.version, buf) + _UniffiConverterBytes.write(value.contents, buf) + + class ObjectFilter: - type: "typing.Optional[str]" + type_tag: "typing.Optional[str]" owner: "typing.Optional[Address]" object_ids: "typing.Optional[typing.List[ObjectId]]" - def __init__(self, *, type: "typing.Optional[str]", owner: "typing.Optional[Address]", object_ids: "typing.Optional[typing.List[ObjectId]]"): - self.type = type + def __init__(self, *, type_tag: "typing.Optional[str]", owner: "typing.Optional[Address]", object_ids: "typing.Optional[typing.List[ObjectId]]"): + self.type_tag = type_tag self.owner = owner self.object_ids = object_ids def __str__(self): - return "ObjectFilter(type={}, owner={}, object_ids={})".format(self.type, self.owner, self.object_ids) + return "ObjectFilter(type_tag={}, owner={}, object_ids={})".format(self.type_tag, self.owner, self.object_ids) def __eq__(self, other): - if self.type != other.type: + if self.type_tag != other.type_tag: return False if self.owner != other.owner: return False @@ -3711,24 +3843,64 @@ class _UniffiConverterTypeObjectFilter(_UniffiConverterRustBuffer): @staticmethod def read(buf): return ObjectFilter( - type=_UniffiConverterOptionalString.read(buf), + type_tag=_UniffiConverterOptionalString.read(buf), owner=_UniffiConverterOptionalTypeAddress.read(buf), object_ids=_UniffiConverterOptionalSequenceTypeObjectId.read(buf), ) @staticmethod def check_lower(value): - _UniffiConverterOptionalString.check_lower(value.type) + _UniffiConverterOptionalString.check_lower(value.type_tag) _UniffiConverterOptionalTypeAddress.check_lower(value.owner) _UniffiConverterOptionalSequenceTypeObjectId.check_lower(value.object_ids) @staticmethod def write(value, buf): - _UniffiConverterOptionalString.write(value.type, buf) + _UniffiConverterOptionalString.write(value.type_tag, buf) _UniffiConverterOptionalTypeAddress.write(value.owner, buf) _UniffiConverterOptionalSequenceTypeObjectId.write(value.object_ids, buf) +class ObjectIdUpgradeInfoMap: + """ + A mapping between an Object ID and a package upgrade info. + """ + + id: "ObjectId" + info: "UpgradeInfo" + def __init__(self, *, id: "ObjectId", info: "UpgradeInfo"): + self.id = id + self.info = info + + def __str__(self): + return "ObjectIdUpgradeInfoMap(id={}, info={})".format(self.id, self.info) + + def __eq__(self, other): + if self.id != other.id: + return False + if self.info != other.info: + return False + return True + +class _UniffiConverterTypeObjectIdUpgradeInfoMap(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ObjectIdUpgradeInfoMap( + id=_UniffiConverterTypeObjectId.read(buf), + info=_UniffiConverterTypeUpgradeInfo.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeObjectId.check_lower(value.id) + _UniffiConverterTypeUpgradeInfo.check_lower(value.info) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeObjectId.write(value.id, buf) + _UniffiConverterTypeUpgradeInfo.write(value.info, buf) + + class ObjectPage: """ A page of items returned by the GraphQL server. @@ -4285,6 +4457,117 @@ def write(value, buf): _UniffiConverterOptionalTypeObjectId.write(value.wrapped_or_deleted_object, buf) +class TypeOrigin: + """ + Identifies a struct and the module it was defined in + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + type-origin = identifier identifier object-id + ``` + """ + + module_name: "str" + struct_name: "str" + package: "ObjectId" + def __init__(self, *, module_name: "str", struct_name: "str", package: "ObjectId"): + self.module_name = module_name + self.struct_name = struct_name + self.package = package + + def __str__(self): + return "TypeOrigin(module_name={}, struct_name={}, package={})".format(self.module_name, self.struct_name, self.package) + + def __eq__(self, other): + if self.module_name != other.module_name: + return False + if self.struct_name != other.struct_name: + return False + if self.package != other.package: + return False + return True + +class _UniffiConverterTypeTypeOrigin(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TypeOrigin( + module_name=_UniffiConverterString.read(buf), + struct_name=_UniffiConverterString.read(buf), + package=_UniffiConverterTypeObjectId.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.module_name) + _UniffiConverterString.check_lower(value.struct_name) + _UniffiConverterTypeObjectId.check_lower(value.package) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.module_name, buf) + _UniffiConverterString.write(value.struct_name, buf) + _UniffiConverterTypeObjectId.write(value.package, buf) + + +class UpgradeInfo: + """ + Upgraded package info for the linkage table + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + upgrade-info = object-id u64 + ``` + """ + + upgraded_id: "ObjectId" + """ + Id of the upgraded packages + """ + + upgraded_version: "int" + """ + Version of the upgraded package + """ + + def __init__(self, *, upgraded_id: "ObjectId", upgraded_version: "int"): + self.upgraded_id = upgraded_id + self.upgraded_version = upgraded_version + + def __str__(self): + return "UpgradeInfo(upgraded_id={}, upgraded_version={})".format(self.upgraded_id, self.upgraded_version) + + def __eq__(self, other): + if self.upgraded_id != other.upgraded_id: + return False + if self.upgraded_version != other.upgraded_version: + return False + return True + +class _UniffiConverterTypeUpgradeInfo(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return UpgradeInfo( + upgraded_id=_UniffiConverterTypeObjectId.read(buf), + upgraded_version=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeObjectId.check_lower(value.upgraded_id) + _UniffiConverterUInt64.check_lower(value.upgraded_version) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeObjectId.write(value.upgraded_id, buf) + _UniffiConverterUInt64.write(value.upgraded_version, buf) + + class Validator: """ Represents a validator in the system. @@ -5317,33 +5600,6 @@ def read(cls, buf): -class _UniffiConverterOptionalTypeMoveStruct(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterTypeMoveStruct.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterTypeMoveStruct.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterTypeMoveStruct.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - class _UniffiConverterOptionalTypeObject(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -5641,6 +5897,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeMoveStruct(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeMoveStruct.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeMoveStruct.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeMoveStruct.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeObjectFilter(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -6284,6 +6567,56 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeIdentifierModuleMap(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeIdentifierModuleMap.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeIdentifierModuleMap.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeIdentifierModuleMap.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeObjectIdUpgradeInfoMap(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeObjectIdUpgradeInfoMap.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeObjectIdUpgradeInfoMap.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeObjectIdUpgradeInfoMap.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeObjectReference(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -6309,6 +6642,31 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeTypeOrigin(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeTypeOrigin.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeTypeOrigin.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeTypeOrigin.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeValidator(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -8660,7 +9018,7 @@ def objects(self, pagination_filter: "PaginationFilter",filter: "typing.Union[ob ```rust,ignore let filter = ObjectFilter { - type_: None, + type_tag: None, owner: Some(Address::from_str("test").unwrap().into()), object_ids: None, }; @@ -9697,7 +10055,7 @@ async def objects(self, pagination_filter: "PaginationFilter",filter: "typing.Un ```rust,ignore let filter = ObjectFilter { - type_: None, + type_tag: None, owner: Some(Address::from_str("test").unwrap().into()), object_ids: None, }; @@ -10432,9 +10790,23 @@ class MovePackage(): """ _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + def __init__(self, id: "ObjectId",version: "int",modules: "typing.List[IdentifierModuleMap]",type_origin_table: "typing.List[TypeOrigin]",linkage_table: "typing.List[ObjectIdUpgradeInfoMap]"): + _UniffiConverterTypeObjectId.check_lower(id) + + _UniffiConverterUInt64.check_lower(version) + + _UniffiConverterSequenceTypeIdentifierModuleMap.check_lower(modules) + + _UniffiConverterSequenceTypeTypeOrigin.check_lower(type_origin_table) + + _UniffiConverterSequenceTypeObjectIdUpgradeInfoMap.check_lower(linkage_table) + + self._pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new, + _UniffiConverterTypeObjectId.lower(id), + _UniffiConverterUInt64.lower(version), + _UniffiConverterSequenceTypeIdentifierModuleMap.lower(modules), + _UniffiConverterSequenceTypeTypeOrigin.lower(type_origin_table), + _UniffiConverterSequenceTypeObjectIdUpgradeInfoMap.lower(linkage_table)) def __del__(self): # In case of partial initialization of instances. @@ -10483,62 +10855,6 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: MovePackageProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class MoveStructProtocol(typing.Protocol): - pass -# MoveStruct is a Rust-only trait - it's a wrapper around a Rust implementation. -class MoveStruct(): - _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_movestruct, pointer) - - def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movestruct, 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 _UniffiConverterTypeMoveStruct: - - @staticmethod - def lift(value: int): - return MoveStruct._make_instance_(value) - - @staticmethod - def check_lower(value: MoveStruct): - if not isinstance(value, MoveStruct): - raise TypeError("Expected MoveStruct instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: MoveStructProtocol): - if not isinstance(value, MoveStruct): - raise TypeError("Expected MoveStruct 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: MoveStructProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) class ObjectProtocol(typing.Protocol): """ An object on the IOTA blockchain @@ -11749,6 +12065,62 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: SignedTransactionProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class StructTagProtocol(typing.Protocol): + pass +# StructTag is a Rust-only trait - it's a wrapper around a Rust implementation. +class StructTag(): + _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_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 + + + +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 @@ -12596,8 +12968,11 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "EventPage", "GasCostSummary", "GasPayment", + "IdentifierModuleMap", "MovePackagePage", + "MoveStruct", "ObjectFilter", + "ObjectIdUpgradeInfoMap", "ObjectPage", "ObjectReference", "PageInfo", @@ -12607,6 +12982,8 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TransactionEffectsPage", "TransactionMetadata", "TransactionsFilter", + "TypeOrigin", + "UpgradeInfo", "Validator", "ValidatorCommitteeMember", "ValidatorCredentials", @@ -12640,7 +13017,6 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "MoveFunction", "MoveModule", "MovePackage", - "MoveStruct", "Object", "ObjectData", "ObjectDigest", @@ -12655,6 +13031,7 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "Secp256r1PublicKey", "ServiceConfig", "SignedTransaction", + "StructTag", "Transaction", "TransactionDataEffects", "TransactionDigest", @@ -12666,3 +13043,4 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TypeTag", "UserSignature", ] + From 39bb9f122d0fcc4f7dcf93c29e38abb5ceb59fcc Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 14:41:57 +0200 Subject: [PATCH 08/17] fix collision --- bindings/python/lib/iota_sdk_ffi.py | 2394 +++++++++++++++++------ crates/iota-sdk-ffi/src/types/object.rs | 4 +- 2 files changed, 1765 insertions(+), 633 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 8b7f8c6f0..12d2c7631 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -499,9 +499,9 @@ 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_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") @@ -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: @@ -669,6 +713,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: @@ -683,6 +737,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. @@ -1012,16 +1088,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), @@ -1100,16 +1166,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), @@ -1254,7 +1310,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 @@ -1309,7 +1365,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 = ( @@ -1465,6 +1521,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), @@ -1617,16 +1683,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), @@ -1745,42 +1801,52 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_serviceconfig.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_signedtransaction.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_structtag.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_signedtransaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_signedtransaction.argtypes = ( +_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_signedtransaction.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_signedtransaction_new.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_structtag.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin.argtypes = ( ctypes.c_void_p, - _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_signedtransaction_new.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_signedtransaction_signatures.argtypes = ( +_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_method_signedtransaction_signatures.restype = _UniffiRustBuffer -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_signedtransaction_transaction.argtypes = ( +_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_signedtransaction_transaction.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_structtag.argtypes = ( +_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_clone_structtag.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_structtag.argtypes = ( +_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_free_structtag.restype = None +_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), @@ -1795,7 +1861,7 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.c_void_p, ctypes.c_void_p, _UniffiRustBuffer, - ctypes.c_void_p, + _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transaction_new.restype = ctypes.c_void_p @@ -1803,7 +1869,7 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_expiration.restype = ctypes.c_void_p +_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), @@ -1819,32 +1885,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_sender.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactiondataeffects.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactiondataeffects.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transactiondataeffects.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transactiondataeffects.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactiondataeffects_new.argtypes = ( - ctypes.c_void_p, - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactiondataeffects_new.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_effects.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_effects.restype = ctypes.c_void_p -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_tx.argtypes = ( - ctypes.c_void_p, - ctypes.POINTER(_UniffiRustCallStatus), -) -_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_tx.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactiondigest.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1950,6 +1990,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), @@ -2435,12 +2596,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 @@ -2540,6 +2767,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 @@ -2561,6 +2803,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 @@ -2821,6 +3096,33 @@ def write(value, buf): +class BigInt: + value: "str" + def __init__(self, *, value: "str"): + self.value = value + + def __str__(self): + return "BigInt(value={})".format(self.value) + + def __eq__(self, other): + if self.value != other.value: + return False + return True + +class _UniffiConverterTypeBigInt(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return BigInt( + 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 ChangedObject: @@ -3186,39 +3488,109 @@ def write(value, buf): _UniffiConverterSequenceTypeCoin.write(value.data, buf) -class DynamicFieldName: - """ - The name part of a dynamic field, including its type, bcs, and json - representation. - """ - - type_tag: "TypeTag" - """ - The type name of this dynamic field name - """ - - bcs: "bytes" - """ - The bcs bytes of this dynamic field name - """ - - json: "typing.Optional[Value]" - """ - The json representation of the dynamic field name - """ - - def __init__(self, *, type_tag: "TypeTag", bcs: "bytes", json: "typing.Optional[Value]"): - self.type_tag = type_tag - self.bcs = bcs - self.json = json +class DateTime: + value: "str" + def __init__(self, *, value: "str"): + self.value = value def __str__(self): - return "DynamicFieldName(type_tag={}, bcs={}, json={})".format(self.type_tag, self.bcs, self.json) + return "DateTime(value={})".format(self.value) def __eq__(self, other): - if self.type_tag != other.type_tag: - return False - if self.bcs != other.bcs: + 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 + representation. + """ + + type_tag: "TypeTag" + """ + The type name of this dynamic field name + """ + + bcs: "bytes" + """ + The bcs bytes of this dynamic field name + """ + + json: "typing.Optional[Value]" + """ + The json representation of the dynamic field name + """ + + def __init__(self, *, type_tag: "TypeTag", bcs: "bytes", json: "typing.Optional[Value]"): + self.type_tag = type_tag + self.bcs = bcs + self.json = json + + def __str__(self): + return "DynamicFieldName(type_tag={}, bcs={}, json={})".format(self.type_tag, self.bcs, self.json) + + def __eq__(self, other): + if self.type_tag != other.type_tag: + return False + if self.bcs != other.bcs: return False if self.json != other.json: return False @@ -3494,6 +3866,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]" @@ -3727,6 +4191,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 IdentifierModuleMap: """ A mapping between an identifier and a BCS encoded module. @@ -3767,6 +4260,128 @@ def write(value, buf): _UniffiConverterBytes.write(value.module, buf) +class MoveLocation: + """ + Location in move bytecode where an error occurred + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + move-location = object-id identifier u16 u16 (option identifier) + ``` + """ + + package: "ObjectId" + """ + The package id + """ + + module: "str" + """ + The module name + """ + + function: "int" + """ + The function index + """ + + instruction: "int" + """ + Index into the code stream for a jump. The offset is relative to the + beginning of the instruction stream. + """ + + function_name: "typing.Optional[str]" + """ + The name of the function if available + """ + + def __init__(self, *, package: "ObjectId", module: "str", function: "int", instruction: "int", function_name: "typing.Optional[str]"): + self.package = package + self.module = module + self.function = function + self.instruction = instruction + self.function_name = function_name + + def __str__(self): + return "MoveLocation(package={}, module={}, function={}, instruction={}, function_name={})".format(self.package, self.module, self.function, self.instruction, self.function_name) + + def __eq__(self, other): + if self.package != other.package: + return False + if self.module != other.module: + return False + if self.function != other.function: + return False + if self.instruction != other.instruction: + return False + if self.function_name != other.function_name: + return False + return True + +class _UniffiConverterTypeMoveLocation(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return MoveLocation( + package=_UniffiConverterTypeObjectId.read(buf), + module=_UniffiConverterString.read(buf), + function=_UniffiConverterUInt16.read(buf), + instruction=_UniffiConverterUInt16.read(buf), + function_name=_UniffiConverterOptionalString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeObjectId.check_lower(value.package) + _UniffiConverterString.check_lower(value.module) + _UniffiConverterUInt16.check_lower(value.function) + _UniffiConverterUInt16.check_lower(value.instruction) + _UniffiConverterOptionalString.check_lower(value.function_name) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeObjectId.write(value.package, buf) + _UniffiConverterString.write(value.module, buf) + _UniffiConverterUInt16.write(value.function, buf) + _UniffiConverterUInt16.write(value.instruction, 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. @@ -4026,6 +4641,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 @@ -4084,15 +4742,41 @@ 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]" - 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) @@ -4134,9 +4818,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: @@ -4267,70 +4961,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" @@ -4899,6 +5529,83 @@ def write(value, buf): _UniffiConverterTypeObjectId.write(value.package, 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 + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + unchanged-shared-object = object-id unchanged-shared-object-kind + ``` + """ + + object_id: "ObjectId" + kind: "UnchangedSharedKind" + def __init__(self, *, object_id: "ObjectId", kind: "UnchangedSharedKind"): + self.object_id = object_id + self.kind = kind + + def __str__(self): + return "UnchangedSharedObject(object_id={}, kind={})".format(self.object_id, self.kind) + + def __eq__(self, other): + if self.object_id != other.object_id: + return False + if self.kind != other.kind: + return False + return True + +class _UniffiConverterTypeUnchangedSharedObject(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return UnchangedSharedObject( + object_id=_UniffiConverterTypeObjectId.read(buf), + kind=_UniffiConverterTypeUnchangedSharedKind.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeObjectId.check_lower(value.object_id) + _UniffiConverterTypeUnchangedSharedKind.check_lower(value.kind) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeObjectId.write(value.object_id, buf) + _UniffiConverterTypeUnchangedSharedKind.write(value.kind, buf) + + class UpgradeInfo: """ Upgraded package info for the linkage table @@ -5302,6 +6009,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]" @@ -5422,6 +6165,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) + + @@ -5788,6 +6560,10 @@ def write(value, buf): class Direction(enum.Enum): + """ + Pagination direction. + """ + FORWARD = 0 BACKWARD = 1 @@ -6105,7 +6881,7 @@ def __eq__(self, other): return False return True - class IOTA_MOVE_VERIFICATION_ERROR: + class IOTA_MOVE_VERIFICATION: """ IOTA Move Bytecode Verification Error. """ @@ -6115,14 +6891,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: @@ -6135,10 +6911,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 @@ -6168,7 +6944,7 @@ def __eq__(self, other): return False return True - class VM_VERIFICATION_OR_DESERIALIZATION_ERROR: + class VM_VERIFICATION_OR_DESERIALIZATION: """ Bytecode verification error. """ @@ -6178,10 +6954,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 @@ -6272,7 +7048,7 @@ def __eq__(self, other): return False return True - class COMMAND_ARGUMENT_ERROR: + class COMMAND_ARGUMENT: """ Invalid command argument """ @@ -6285,10 +7061,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 @@ -6296,7 +7072,7 @@ def __eq__(self, other): return False return True - class TYPE_ARGUMENT_ERROR: + class TYPE_ARGUMENT: """ Type argument error """ @@ -6313,10 +7089,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 @@ -6448,7 +7224,7 @@ def __eq__(self, other): return False return True - class PACKAGE_UPGRADE_ERROR: + class PACKAGE_UPGRADE: """ Invalid package upgrade """ @@ -6459,10 +7235,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 @@ -6729,22 +7505,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: @@ -6765,14 +7541,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: @@ -6797,10 +7573,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: @@ -6860,24 +7636,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 @@ -6933,10 +7709,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: @@ -6945,7 +7721,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( @@ -6963,12 +7739,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), ) @@ -6996,7 +7772,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: @@ -7069,16 +7845,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 @@ -7090,11 +7866,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 @@ -7115,7 +7891,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(): @@ -7177,16 +7953,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) @@ -7198,11 +7974,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) @@ -7223,7 +7999,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(): @@ -8985,17 +9761,71 @@ def read(cls, buf): if flag == 0: return None elif flag == 1: - return _UniffiConverterTypeObject.read(buf) + return _UniffiConverterTypeObject.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeObjectId(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeObjectId.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeObjectId.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeObjectId.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeProtocolConfigs(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeProtocolConfigs.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeProtocolConfigs.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeProtocolConfigs.read(buf) else: raise InternalError("Unexpected flag byte for optional type") -class _UniffiConverterOptionalTypeObjectId(_UniffiConverterRustBuffer): +class _UniffiConverterOptionalTypeStructTag(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): if value is not None: - _UniffiConverterTypeObjectId.check_lower(value) + _UniffiConverterTypeStructTag.check_lower(value) @classmethod def write(cls, value, buf): @@ -9004,7 +9834,7 @@ def write(cls, value, buf): return buf.write_u8(1) - _UniffiConverterTypeObjectId.write(value, buf) + _UniffiConverterTypeStructTag.write(value, buf) @classmethod def read(cls, buf): @@ -9012,17 +9842,17 @@ def read(cls, buf): if flag == 0: return None elif flag == 1: - return _UniffiConverterTypeObjectId.read(buf) + return _UniffiConverterTypeStructTag.read(buf) else: raise InternalError("Unexpected flag byte for optional type") -class _UniffiConverterOptionalTypeProtocolConfigs(_UniffiConverterRustBuffer): +class _UniffiConverterOptionalTypeTransactionEffects(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): if value is not None: - _UniffiConverterTypeProtocolConfigs.check_lower(value) + _UniffiConverterTypeTransactionEffects.check_lower(value) @classmethod def write(cls, value, buf): @@ -9031,7 +9861,7 @@ def write(cls, value, buf): return buf.write_u8(1) - _UniffiConverterTypeProtocolConfigs.write(value, buf) + _UniffiConverterTypeTransactionEffects.write(value, buf) @classmethod def read(cls, buf): @@ -9039,17 +9869,17 @@ def read(cls, buf): if flag == 0: return None elif flag == 1: - return _UniffiConverterTypeProtocolConfigs.read(buf) + return _UniffiConverterTypeTransactionEffects.read(buf) else: raise InternalError("Unexpected flag byte for optional type") -class _UniffiConverterOptionalTypeTransactionEffects(_UniffiConverterRustBuffer): +class _UniffiConverterOptionalTypeTransactionEventsDigest(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): if value is not None: - _UniffiConverterTypeTransactionEffects.check_lower(value) + _UniffiConverterTypeTransactionEventsDigest.check_lower(value) @classmethod def write(cls, value, buf): @@ -9058,7 +9888,7 @@ def write(cls, value, buf): return buf.write_u8(1) - _UniffiConverterTypeTransactionEffects.write(value, buf) + _UniffiConverterTypeTransactionEventsDigest.write(value, buf) @classmethod def read(cls, buf): @@ -9066,17 +9896,17 @@ def read(cls, buf): if flag == 0: return None elif flag == 1: - return _UniffiConverterTypeTransactionEffects.read(buf) + return _UniffiConverterTypeTransactionEventsDigest.read(buf) else: raise InternalError("Unexpected flag byte for optional type") -class _UniffiConverterOptionalTypeTransactionEventsDigest(_UniffiConverterRustBuffer): +class _UniffiConverterOptionalTypeTypeTag(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): if value is not None: - _UniffiConverterTypeTransactionEventsDigest.check_lower(value) + _UniffiConverterTypeTypeTag.check_lower(value) @classmethod def write(cls, value, buf): @@ -9085,7 +9915,7 @@ def write(cls, value, buf): return buf.write_u8(1) - _UniffiConverterTypeTransactionEventsDigest.write(value, buf) + _UniffiConverterTypeTypeTag.write(value, buf) @classmethod def read(cls, buf): @@ -9093,7 +9923,7 @@ def read(cls, buf): if flag == 0: return None elif flag == 1: - return _UniffiConverterTypeTransactionEventsDigest.read(buf) + return _UniffiConverterTypeTypeTag.read(buf) else: raise InternalError("Unexpected flag byte for optional type") @@ -9234,6 +10064,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeMoveLocation(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeMoveLocation.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeMoveLocation.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeMoveLocation.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeMoveStruct(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -9683,31 +10540,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): @@ -9783,18 +10615,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): @@ -9803,23 +10635,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): @@ -9828,23 +10660,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): @@ -9853,7 +10685,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) ] @@ -9958,6 +10790,31 @@ 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 _UniffiConverterSequenceTypeIdentifierModuleMap(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -10008,6 +10865,31 @@ def read(cls, buf): +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): @@ -10033,6 +10915,56 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeSignedTransaction(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeSignedTransaction.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeSignedTransaction.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeSignedTransaction.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeTransactionDataEffects(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeTransactionDataEffects.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeTransactionDataEffects.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeTransactionDataEffects.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeTypeOrigin(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -10058,6 +10990,31 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeUnchangedSharedObject(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeUnchangedSharedObject.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeUnchangedSharedObject.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeUnchangedSharedObject.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeValidator(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -11293,69 +12250,13 @@ def lift(value: int): @staticmethod def check_lower(value: Digest): - if not isinstance(value, Digest): - raise TypeError("Expected Digest instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: DigestProtocol): - if not isinstance(value, Digest): - raise TypeError("Expected Digest 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: 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__)) + if not isinstance(value, Digest): + raise TypeError("Expected Digest 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__)) + def lower(value: DigestProtocol): + if not isinstance(value, Digest): + raise TypeError("Expected Digest instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -11366,7 +12267,7 @@ def read(cls, buf: _UniffiRustBuffer): return cls.lift(ptr) @classmethod - def write(cls, value: DryRunResultProtocol, buf: _UniffiRustBuffer): + def write(cls, value: DigestProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class Ed25519PublicKeyProtocol(typing.Protocol): """ @@ -11739,62 +12640,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. @@ -12862,9 +13707,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, @@ -12903,9 +13748,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, @@ -14032,6 +14877,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. @@ -14754,62 +15687,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. @@ -15374,31 +16251,77 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: ServiceConfigProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class SignedTransactionProtocol(typing.Protocol): - def signatures(self, ): +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 transaction(self, ): + def coin_type_opt(self, ): + """ + Checks if this is a Coin type + """ + raise NotImplementedError -# SignedTransaction is a Rust-only trait - it's a wrapper around a Rust implementation. -class SignedTransaction(): +# 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, transaction: "Transaction",signatures: "typing.List[UserSignature]"): - _UniffiConverterTypeTransaction.check_lower(transaction) + def __init__(self, address: "Address",module: "Identifier",name: "Identifier",type_params: "typing.List[TypeTag]"): + _UniffiConverterTypeAddress.check_lower(address) - _UniffiConverterSequenceTypeUserSignature.check_lower(signatures) + _UniffiConverterTypeIdentifier.check_lower(module) + + _UniffiConverterTypeIdentifier.check_lower(name) - self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_signedtransaction_new, - _UniffiConverterTypeTransaction.lower(transaction), - _UniffiConverterSequenceTypeUserSignature.lower(signatures)) + _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_signedtransaction, pointer) + _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_signedtransaction, self._pointer) + 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 @@ -15408,80 +16331,62 @@ def _make_instance_(cls, 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) - def signatures(self, ) -> "typing.List[UserSignature]": - return _UniffiConverterSequenceTypeUserSignature.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_signedtransaction_signatures,self._uniffi_clone_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 transaction(self, ) -> "Transaction": - return _UniffiConverterTypeTransaction.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_signedtransaction_transaction,self._uniffi_clone_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(),) + ) -class _UniffiConverterTypeSignedTransaction: - @staticmethod - def lift(value: int): - return SignedTransaction._make_instance_(value) - @staticmethod - def check_lower(value: SignedTransaction): - if not isinstance(value, SignedTransaction): - raise TypeError("Expected SignedTransaction instance, {} found".format(type(value).__name__)) - @staticmethod - def lower(value: SignedTransactionProtocol): - if not isinstance(value, SignedTransaction): - raise TypeError("Expected SignedTransaction 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) + def coin_type_opt(self, ) -> "typing.Optional[TypeTag]": + """ + Checks if this is a Coin type + """ - @classmethod - def write(cls, value: SignedTransactionProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) -class StructTagProtocol(typing.Protocol): - pass -# StructTag is a Rust-only trait - it's a wrapper around a Rust implementation. -class StructTag(): - _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + return _UniffiConverterOptionalTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt,self._uniffi_clone_pointer(),) + ) - 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 @@ -15650,88 +16555,6 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: TransactionProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class TransactionDataEffectsProtocol(typing.Protocol): - def effects(self, ): - raise NotImplementedError - def tx(self, ): - raise NotImplementedError -# TransactionDataEffects is a Rust-only trait - it's a wrapper around a Rust implementation. -class TransactionDataEffects(): - _pointer: ctypes.c_void_p - def __init__(self, tx: "SignedTransaction",effects: "TransactionEffects"): - _UniffiConverterTypeSignedTransaction.check_lower(tx) - - _UniffiConverterTypeTransactionEffects.check_lower(effects) - - self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactiondataeffects_new, - _UniffiConverterTypeSignedTransaction.lower(tx), - _UniffiConverterTypeTransactionEffects.lower(effects)) - - 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_transactiondataeffects, pointer) - - def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactiondataeffects, 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 - - - def effects(self, ) -> "TransactionEffects": - return _UniffiConverterTypeTransactionEffects.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_effects,self._uniffi_clone_pointer(),) - ) - - - - - - def tx(self, ) -> "SignedTransaction": - return _UniffiConverterTypeSignedTransaction.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_tx,self._uniffi_clone_pointer(),) - ) - - - - - - -class _UniffiConverterTypeTransactionDataEffects: - - @staticmethod - def lift(value: int): - return TransactionDataEffects._make_instance_(value) - - @staticmethod - def check_lower(value: TransactionDataEffects): - if not isinstance(value, TransactionDataEffects): - raise TypeError("Expected TransactionDataEffects instance, {} found".format(type(value).__name__)) - - @staticmethod - def lower(value: TransactionDataEffectsProtocol): - if not isinstance(value, TransactionDataEffects): - raise TypeError("Expected TransactionDataEffects 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: TransactionDataEffectsProtocol, buf: _UniffiRustBuffer): - buf.write_u64(cls.lower(value)) class TransactionDigestProtocol(typing.Protocol): pass # TransactionDigest is a Rust-only trait - it's a wrapper around a Rust implementation. @@ -16137,9 +16960,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): @@ -16162,6 +17082,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(),) + ) + + + @@ -16330,32 +17457,39 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TransactionExpiration", "TypeArgumentError", "UnchangedSharedKind", + "BigInt", "ChangedObject", "CheckpointSummary", "CheckpointSummaryPage", "CoinPage", + "DateTime", + "DryRunResult", "DynamicFieldName", "DynamicFieldOutput", "DynamicFieldOutputPage", "DynamicFieldValue", "EndOfEpochData", "EpochPage", + "Event", "EventFilter", "EventPage", "GasCostSummary", "GasPayment", + "GqlAddress", "IdentifierModuleMap", + "MoveLocation", + "MoveObject", "MovePackagePage", "MoveStruct", "ObjectFilter", "ObjectIdUpgradeInfoMap", "ObjectPage", + "ObjectRef", "ObjectReference", "PageInfo", "PaginationFilter", "SignedTransaction", "SignedTransactionPage", - "Transaction", "TransactionDataEffects", "TransactionDataEffectsPage", "TransactionEffectsPage", @@ -16363,11 +17497,15 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TransactionMetadata", "TransactionsFilter", "TypeOrigin", + "TypeParseError", + "UnchangedSharedObject", "UpgradeInfo", "Validator", "ValidatorCommitteeMember", + "ValidatorConnection", "ValidatorCredentials", "ValidatorPage", + "ValidatorSet", "Address", "AuthenticatorStateExpire", "AuthenticatorStateUpdateV1", @@ -16383,17 +17521,16 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ConsensusCommitDigest", "ConsensusCommitPrologueV1", "Digest", - "DryRunResult", "Ed25519PublicKey", "EffectsAuxiliaryDataDigest", "EndOfEpochTransactionKind", "Epoch", - "Event", "ExecutionTimeObservations", "FaucetClient", "FaucetReceipt", "GenesisTransaction", "GraphQlClient", + "Identifier", "MoveFunction", "MoveModule", "MovePackage", @@ -16401,7 +17538,6 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ObjectData", "ObjectDigest", "ObjectId", - "ObjectRef", "ObjectType", "Owner", "ProgrammableTransaction", @@ -16410,10 +17546,8 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "Secp256k1PublicKey", "Secp256r1PublicKey", "ServiceConfig", - "SignedTransaction", "StructTag", "Transaction", - "TransactionDataEffects", "TransactionDigest", "TransactionEffects", "TransactionEffectsDigest", diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index f1f92f26d..2a6f82788 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -10,6 +10,7 @@ use crate::{ types::{ address::Address, digest::{ObjectDigest, TransactionDigest}, + struct_tag::StructTag, }, }; @@ -334,9 +335,6 @@ impl MovePackage { } } -#[derive(Clone, Debug, derive_more::From, uniffi::Object)] -pub struct StructTag(pub iota_types::StructTag); - /// A move struct /// /// # BCS From 50c53cc0448df955131951c29d6ad0770e00158b Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Mon, 11 Aug 2025 14:44:36 +0200 Subject: [PATCH 09/17] fix compilation and update python --- bindings/python/lib/iota_sdk_ffi.py | 28 ++++++------ crates/iota-sdk-ffi/src/types/object.rs | 49 ++++++--------------- crates/iota-sdk-ffi/src/types/struct_tag.rs | 4 +- 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 12d2c7631..3d5b848af 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -4225,9 +4225,9 @@ class IdentifierModuleMap: A mapping between an identifier and a BCS encoded module. """ - id: "str" + id: "Identifier" module: "bytes" - def __init__(self, *, id: "str", module: "bytes"): + def __init__(self, *, id: "Identifier", module: "bytes"): self.id = id self.module = module @@ -4245,18 +4245,18 @@ class _UniffiConverterTypeIdentifierModuleMap(_UniffiConverterRustBuffer): @staticmethod def read(buf): return IdentifierModuleMap( - id=_UniffiConverterString.read(buf), + id=_UniffiConverterTypeIdentifier.read(buf), module=_UniffiConverterBytes.read(buf), ) @staticmethod def check_lower(value): - _UniffiConverterString.check_lower(value.id) + _UniffiConverterTypeIdentifier.check_lower(value.id) _UniffiConverterBytes.check_lower(value.module) @staticmethod def write(value, buf): - _UniffiConverterString.write(value.id, buf) + _UniffiConverterTypeIdentifier.write(value.id, buf) _UniffiConverterBytes.write(value.module, buf) @@ -5487,10 +5487,10 @@ class TypeOrigin: ``` """ - module_name: "str" - struct_name: "str" + module_name: "Identifier" + struct_name: "Identifier" package: "ObjectId" - def __init__(self, *, module_name: "str", struct_name: "str", package: "ObjectId"): + def __init__(self, *, module_name: "Identifier", struct_name: "Identifier", package: "ObjectId"): self.module_name = module_name self.struct_name = struct_name self.package = package @@ -5511,21 +5511,21 @@ class _UniffiConverterTypeTypeOrigin(_UniffiConverterRustBuffer): @staticmethod def read(buf): return TypeOrigin( - module_name=_UniffiConverterString.read(buf), - struct_name=_UniffiConverterString.read(buf), + module_name=_UniffiConverterTypeIdentifier.read(buf), + struct_name=_UniffiConverterTypeIdentifier.read(buf), package=_UniffiConverterTypeObjectId.read(buf), ) @staticmethod def check_lower(value): - _UniffiConverterString.check_lower(value.module_name) - _UniffiConverterString.check_lower(value.struct_name) + _UniffiConverterTypeIdentifier.check_lower(value.module_name) + _UniffiConverterTypeIdentifier.check_lower(value.struct_name) _UniffiConverterTypeObjectId.check_lower(value.package) @staticmethod def write(value, buf): - _UniffiConverterString.write(value.module_name, buf) - _UniffiConverterString.write(value.struct_name, buf) + _UniffiConverterTypeIdentifier.write(value.module_name, buf) + _UniffiConverterTypeIdentifier.write(value.struct_name, buf) _UniffiConverterTypeObjectId.write(value.package, buf) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 2a6f82788..4aedc8006 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -10,25 +10,10 @@ use crate::{ types::{ address::Address, digest::{ObjectDigest, TransactionDigest}, - struct_tag::StructTag, + struct_tag::{Identifier, StructTag}, }, }; -/// 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 -/// ``` -pub type Identifier = String; - /// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on /// the IOTA blockchain. /// @@ -210,37 +195,35 @@ pub struct ObjectData(pub iota_types::ObjectData); /// ``` #[derive(Clone, Debug, uniffi::Record)] pub struct TypeOrigin { - pub module_name: Identifier, - pub struct_name: Identifier, + pub module_name: Arc, + pub struct_name: Arc, pub package: Arc, } impl From for TypeOrigin { fn from(value: iota_types::TypeOrigin) -> Self { Self { - module_name: value.module_name.into_inner().into_string(), - struct_name: value.struct_name.into_inner().into_string(), + module_name: Arc::new(value.module_name.into()), + struct_name: Arc::new(value.struct_name.into()), package: Arc::new(value.package.into()), } } } -impl TryFrom for iota_types::TypeOrigin { - type Error = TypeParseError; - - fn try_from(value: TypeOrigin) -> Result { - Ok(Self { - module_name: value.module_name.parse()?, - struct_name: value.struct_name.parse()?, +impl From for iota_types::TypeOrigin { + fn from(value: TypeOrigin) -> Self { + Self { + module_name: value.module_name.0.clone(), + struct_name: value.struct_name.0.clone(), package: **value.package, - }) + } } } /// A mapping between an identifier and a BCS encoded module. #[derive(Clone, Debug, uniffi::Record)] pub struct IdentifierModuleMap { - id: Identifier, + id: Arc, module: Vec, } @@ -317,12 +300,8 @@ impl MovePackage { version, modules: modules .into_iter() - .map(|m| (iota_types::Identifier::from_str(&m.id), m.module)) - .map(|(r, module)| match r { - Ok(id) => Ok((id, module)), - Err(err) => Err(err), - }) - .collect::, _>>()?, + .map(|m| (m.id.0.clone(), m.module)) + .collect::>(), type_origin_table: type_origin_table .into_iter() .map(TryInto::try_into) diff --git a/crates/iota-sdk-ffi/src/types/struct_tag.rs b/crates/iota-sdk-ffi/src/types/struct_tag.rs index 4741016cf..f2e1bbd19 100644 --- a/crates/iota-sdk-ffi/src/types/struct_tag.rs +++ b/crates/iota-sdk-ffi/src/types/struct_tag.rs @@ -39,8 +39,8 @@ impl From for TypeParseError { /// /// UNDERSCORE = %x95 /// ``` -#[derive(Clone, Debug, derive_more::From, uniffi::Object)] -pub struct Identifier(iota_types::Identifier); +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, derive_more::From, uniffi::Object)] +pub struct Identifier(pub iota_types::Identifier); impl Identifier { #[uniffi::constructor] From 0581b18bce25e453ca9cf0206ebc791eb00889ec Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 15:09:21 +0200 Subject: [PATCH 10/17] fix python --- bindings/python/lib/iota_sdk_ffi.py | 16 +++--- bindings/python/test.py | 75 +++++++++++++++++++------ crates/iota-sdk-ffi/src/types/object.rs | 6 +- 3 files changed, 70 insertions(+), 27 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 3d5b848af..c7995c246 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -4453,7 +4453,7 @@ class MoveStruct: ``` """ - type_tag: "StructTag" + struct_type: "StructTag" """ The type of this object """ @@ -4470,16 +4470,16 @@ class MoveStruct: BCS bytes of a Move struct value """ - def __init__(self, *, type_tag: "StructTag", version: "int", contents: "bytes"): - self.type_tag = type_tag + def __init__(self, *, struct_type: "StructTag", version: "int", contents: "bytes"): + self.struct_type = struct_type self.version = version self.contents = contents def __str__(self): - return "MoveStruct(type_tag={}, version={}, contents={})".format(self.type_tag, self.version, self.contents) + return "MoveStruct(struct_type={}, version={}, contents={})".format(self.struct_type, self.version, self.contents) def __eq__(self, other): - if self.type_tag != other.type_tag: + if self.struct_type != other.struct_type: return False if self.version != other.version: return False @@ -4491,20 +4491,20 @@ class _UniffiConverterTypeMoveStruct(_UniffiConverterRustBuffer): @staticmethod def read(buf): return MoveStruct( - type_tag=_UniffiConverterTypeStructTag.read(buf), + struct_type=_UniffiConverterTypeStructTag.read(buf), version=_UniffiConverterUInt64.read(buf), contents=_UniffiConverterBytes.read(buf), ) @staticmethod def check_lower(value): - _UniffiConverterTypeStructTag.check_lower(value.type_tag) + _UniffiConverterTypeStructTag.check_lower(value.struct_type) _UniffiConverterUInt64.check_lower(value.version) _UniffiConverterBytes.check_lower(value.contents) @staticmethod def write(value, buf): - _UniffiConverterTypeStructTag.write(value.type_tag, buf) + _UniffiConverterTypeStructTag.write(value.struct_type, buf) _UniffiConverterUInt64.write(value.version, buf) _UniffiConverterBytes.write(value.contents, buf) diff --git a/bindings/python/test.py b/bindings/python/test.py index ecb5d9d1f..19b7c5dfc 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -1,38 +1,81 @@ -from lib.iota_sdk_ffi import GraphQlClient, PaginationFilter, Address, Direction, TransactionsFilter, ObjectId, EventFilter, MoveStruct, MovePackage, TypeOrigin, UpgradeInfo, IdentifierModuleMap, ObjectIdUpgradeInfoMap +from lib.iota_sdk_ffi import ( + GraphQlClient, + PaginationFilter, + Address, + Direction, + TransactionsFilter, + ObjectId, + EventFilter, + MoveStruct, + MovePackage, + TypeOrigin, + UpgradeInfo, + IdentifierModuleMap, + ObjectIdUpgradeInfoMap, + TypeTag, + StructTag, + Identifier, +) import asyncio + async def main(): client = GraphQlClient.new_devnet() chain_id = await client.chain_id() print(chain_id) - - my_address=Address.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f") + + my_address = Address.from_hex( + "0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f" + ) coins = await client.coins( - my_address, - PaginationFilter(direction=Direction.FORWARD, cursor=None, limit=None) + my_address, + PaginationFilter(direction=Direction.FORWARD, cursor=None, limit=None), ) for coin in coins.data: - print(f'ID = 0x{coin.id().to_hex()} Balance = {coin.balance()}') + print(f"ID = 0x{coin.id().to_hex()} Balance = {coin.balance()}") balance = await client.balance(my_address) - print(f'Total Balance = {balance}') + print(f"Total Balance = {balance}") - filter=TransactionsFilter(at_checkpoint=3, input_object=ObjectId.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f")) + filter = TransactionsFilter( + at_checkpoint=3, + input_object=ObjectId.from_hex( + "0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f" + ), + ) - filter=EventFilter(sender=my_address) + filter = EventFilter(sender=my_address) - # TODO depends on StructTag - # move_struct = MoveStruct(struct_tag, version, contents) + move_struct = MoveStruct( + struct_type=StructTag.coin(TypeTag.vector(TypeTag.u8())), + version=1, + contents=bytes(), + ) - id = ObjectId.from_hex("0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f") - type_origin = TypeOrigin(module_name="module_name", struct_name="struct_name", package=id) + id = ObjectId.from_hex( + "0xb14f13f5343641e5b52d144fd6f106a7058efe2f1ad44598df5cda73acf0101f" + ) + type_origin = TypeOrigin( + module_name=Identifier("module_name"), + struct_name=Identifier("struct_name"), + package=id, + ) upgrade_info = UpgradeInfo(upgraded_id=id, upgraded_version=43) - id_module = IdentifierModuleMap(id="some_id", module=bytes.fromhex("48656c6c6f")) + id_module = IdentifierModuleMap( + id=Identifier("some_id"), module=bytes.fromhex("48656c6c6f") + ) object_id_upgrade_info = ObjectIdUpgradeInfoMap(id=id, info=upgrade_info) - move_package = MovePackage(id, version=42, modules=[id_module], type_origin_table=[type_origin], linkage_table=[object_id_upgrade_info]) + move_package = MovePackage( + id, + version=42, + modules=[id_module], + type_origin_table=[type_origin], + linkage_table=[object_id_upgrade_info], + ) + -if __name__ == '__main__': +if __name__ == "__main__": asyncio.run(main()) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 4aedc8006..bcd7099a8 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -335,7 +335,7 @@ impl MovePackage { #[derive(Clone, Debug, uniffi::Record)] pub struct MoveStruct { /// The type of this object - pub type_tag: Arc, + pub struct_type: Arc, /// Number that increases each time a tx takes this object as a mutable /// input This is a lamport timestamp, not a sequentially increasing /// version @@ -347,7 +347,7 @@ pub struct MoveStruct { impl From for MoveStruct { fn from(value: iota_types::MoveStruct) -> Self { Self { - type_tag: Arc::new(value.type_.into()), + struct_type: Arc::new(value.type_.into()), version: value.version, contents: value.contents, } @@ -357,7 +357,7 @@ impl From for MoveStruct { impl From for iota_types::MoveStruct { fn from(value: MoveStruct) -> Self { Self { - type_: value.type_tag.0.clone(), + type_: value.struct_type.0.clone(), version: value.version, contents: value.contents, } From 82ed5136eaba5e617ac6436c5e80d1c93e006ab1 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Mon, 11 Aug 2025 15:10:03 +0200 Subject: [PATCH 11/17] use * --- bindings/python/test.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/bindings/python/test.py b/bindings/python/test.py index 19b7c5dfc..f61850607 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -1,21 +1,4 @@ -from lib.iota_sdk_ffi import ( - GraphQlClient, - PaginationFilter, - Address, - Direction, - TransactionsFilter, - ObjectId, - EventFilter, - MoveStruct, - MovePackage, - TypeOrigin, - UpgradeInfo, - IdentifierModuleMap, - ObjectIdUpgradeInfoMap, - TypeTag, - StructTag, - Identifier, -) +from lib.iota_sdk_ffi import * import asyncio From ded42e6fc505309bcc96951e2e867cb1ac053c21 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 09:44:06 +0200 Subject: [PATCH 12/17] fix missing `Identifier` impls --- bindings/python/lib/iota_sdk_ffi.py | 40 ++++++++++++++++++--- crates/iota-sdk-ffi/src/types/struct_tag.rs | 16 ++++----- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index c7995c246..4d2c3dbd6 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -573,6 +573,8 @@ 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_transactions_effects() != 2687: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str() != 63815: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() != 37303: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_object_data() != 4330: @@ -693,6 +695,8 @@ 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_graphqlclient_new_testnet() != 48529: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new() != 9398: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 47014: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_object_new() != 56232: @@ -1531,6 +1535,16 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_identifier.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_identifier_new.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_identifier_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_identifier_as_str.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_identifier_as_str.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movefunction.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -2557,6 +2571,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct.restype = ctypes.c_uint16 @@ -2737,6 +2754,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new.restype = ctypes.c_uint16 @@ -14894,7 +14914,8 @@ class IdentifierProtocol(typing.Protocol): ``` """ - pass + def as_str(self, ): + raise NotImplementedError # Identifier is a Rust-only trait - it's a wrapper around a Rust implementation. class Identifier(): """ @@ -14914,9 +14935,11 @@ class Identifier(): """ _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + def __init__(self, identifier: "str"): + _UniffiConverterString.check_lower(identifier) + + self._pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_identifier_new, + _UniffiConverterString.lower(identifier)) def __del__(self): # In case of partial initialization of instances. @@ -14937,6 +14960,15 @@ def _make_instance_(cls, pointer): return inst + def as_str(self, ) -> "str": + return _UniffiConverterString.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_identifier_as_str,self._uniffi_clone_pointer(),) + ) + + + + + class _UniffiConverterTypeIdentifier: diff --git a/crates/iota-sdk-ffi/src/types/struct_tag.rs b/crates/iota-sdk-ffi/src/types/struct_tag.rs index f2e1bbd19..00c6464bf 100644 --- a/crates/iota-sdk-ffi/src/types/struct_tag.rs +++ b/crates/iota-sdk-ffi/src/types/struct_tag.rs @@ -3,7 +3,10 @@ use std::sync::Arc; -use crate::types::{address::Address, type_tag::TypeTag}; +use crate::{ + error::Result, + types::{address::Address, type_tag::TypeTag}, +}; #[derive(Clone, Debug, derive_more::From, uniffi::Record)] pub struct TypeParseError { @@ -42,18 +45,15 @@ impl From for TypeParseError { #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, derive_more::From, uniffi::Object)] pub struct Identifier(pub iota_types::Identifier); +#[uniffi::export] impl Identifier { #[uniffi::constructor] - pub fn new(identifier: impl AsRef) -> Result { + pub fn new(identifier: String) -> Result { Ok(Self(iota_types::Identifier::new(identifier)?)) } - pub fn into_inner(self) -> Box { - self.0.into_inner() - } - - pub fn as_str(&self) -> &str { - self.0.as_str() + pub fn as_str(&self) -> String { + self.0.as_str().to_owned() } } From 9ba5a8fc87783e85916dd7ae5d511abd0f5a0c59 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 09:58:04 +0200 Subject: [PATCH 13/17] 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 116d8bdf7..a712452cb 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -37,9 +37,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()) move_struct = MoveStruct( struct_type=StructTag.coin(TypeTag.vector(TypeTag.u8())), From 124faf9c7b5789fce2c1017d044421fc70fde83c Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 10:10:20 +0200 Subject: [PATCH 14/17] use maps --- bindings/python/lib/iota_sdk_ffi.py | 210 +++++++------------- bindings/python/test.py | 8 +- crates/iota-sdk-ffi/src/types/object.rs | 35 ++-- crates/iota-sdk-ffi/src/types/struct_tag.rs | 2 +- 4 files changed, 87 insertions(+), 168 deletions(-) diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 7f18c48b0..125fe6faa 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -959,7 +959,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_constructor_identifier_new() != 9398: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 47014: + if lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 17506: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new() != 3396: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -6042,46 +6042,6 @@ def write(value, buf): _UniffiConverterTypeAddress.write(value.address, buf) -class IdentifierModuleMap: - """ - A mapping between an identifier and a BCS encoded module. - """ - - id: "Identifier" - module: "bytes" - def __init__(self, *, id: "Identifier", module: "bytes"): - self.id = id - self.module = module - - def __str__(self): - return "IdentifierModuleMap(id={}, module={})".format(self.id, self.module) - - def __eq__(self, other): - if self.id != other.id: - return False - if self.module != other.module: - return False - return True - -class _UniffiConverterTypeIdentifierModuleMap(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return IdentifierModuleMap( - id=_UniffiConverterTypeIdentifier.read(buf), - module=_UniffiConverterBytes.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterTypeIdentifier.check_lower(value.id) - _UniffiConverterBytes.check_lower(value.module) - - @staticmethod - def write(value, buf): - _UniffiConverterTypeIdentifier.write(value.id, buf) - _UniffiConverterBytes.write(value.module, buf) - - class MoveLocation: """ Location in move bytecode where an error occurred @@ -6374,46 +6334,6 @@ def write(value, buf): _UniffiConverterOptionalSequenceTypeObjectId.write(value.object_ids, buf) -class ObjectIdUpgradeInfoMap: - """ - A mapping between an Object ID and a package upgrade info. - """ - - id: "ObjectId" - info: "UpgradeInfo" - def __init__(self, *, id: "ObjectId", info: "UpgradeInfo"): - self.id = id - self.info = info - - def __str__(self): - return "ObjectIdUpgradeInfoMap(id={}, info={})".format(self.id, self.info) - - def __eq__(self, other): - if self.id != other.id: - return False - if self.info != other.info: - return False - return True - -class _UniffiConverterTypeObjectIdUpgradeInfoMap(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return ObjectIdUpgradeInfoMap( - id=_UniffiConverterTypeObjectId.read(buf), - info=_UniffiConverterTypeUpgradeInfo.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterTypeObjectId.check_lower(value.id) - _UniffiConverterTypeUpgradeInfo.check_lower(value.info) - - @staticmethod - def write(value, buf): - _UniffiConverterTypeObjectId.write(value.id, buf) - _UniffiConverterTypeUpgradeInfo.write(value.info, buf) - - class ObjectPage: """ A page of items returned by the GraphQL server. @@ -13098,56 +13018,6 @@ def read(cls, buf): -class _UniffiConverterSequenceTypeIdentifierModuleMap(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterTypeIdentifierModuleMap.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterTypeIdentifierModuleMap.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterTypeIdentifierModuleMap.read(buf) for i in range(count) - ] - - - -class _UniffiConverterSequenceTypeObjectIdUpgradeInfoMap(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterTypeObjectIdUpgradeInfoMap.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterTypeObjectIdUpgradeInfoMap.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterTypeObjectIdUpgradeInfoMap.read(buf) for i in range(count) - ] - - - class _UniffiConverterSequenceTypeObjectRef(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -13347,6 +13217,72 @@ def read(cls, buf): ] + +class _UniffiConverterMapTypeIdentifierBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiConverterTypeIdentifier.check_lower(key) + _UniffiConverterBytes.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiConverterTypeIdentifier.write(key, buf) + _UniffiConverterBytes.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiConverterTypeIdentifier.read(buf) + val = _UniffiConverterBytes.read(buf) + d[key] = val + return d + + + +class _UniffiConverterMapTypeObjectIdTypeUpgradeInfo(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, items): + for (key, value) in items.items(): + _UniffiConverterTypeObjectId.check_lower(key) + _UniffiConverterTypeUpgradeInfo.check_lower(value) + + @classmethod + def write(cls, items, buf): + buf.write_i32(len(items)) + for (key, value) in items.items(): + _UniffiConverterTypeObjectId.write(key, buf) + _UniffiConverterTypeUpgradeInfo.write(value, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative map size") + + # It would be nice to use a dict comprehension, + # but in Python 3.7 and before the evaluation order is not according to spec, + # so we we're reading the value before the key. + # This loop makes the order explicit: first reading the key, then the value. + d = {} + for i in range(count): + key = _UniffiConverterTypeObjectId.read(buf) + val = _UniffiConverterTypeUpgradeInfo.read(buf) + d[key] = val + return d + + class _UniffiConverterTypeBase64: @staticmethod def write(value, buf): @@ -18205,23 +18141,23 @@ class MovePackage(): """ _pointer: ctypes.c_void_p - def __init__(self, id: "ObjectId",version: "int",modules: "typing.List[IdentifierModuleMap]",type_origin_table: "typing.List[TypeOrigin]",linkage_table: "typing.List[ObjectIdUpgradeInfoMap]"): + def __init__(self, id: "ObjectId",version: "int",modules: "dict[Identifier, bytes]",type_origin_table: "typing.List[TypeOrigin]",linkage_table: "dict[ObjectId, UpgradeInfo]"): _UniffiConverterTypeObjectId.check_lower(id) _UniffiConverterUInt64.check_lower(version) - _UniffiConverterSequenceTypeIdentifierModuleMap.check_lower(modules) + _UniffiConverterMapTypeIdentifierBytes.check_lower(modules) _UniffiConverterSequenceTypeTypeOrigin.check_lower(type_origin_table) - _UniffiConverterSequenceTypeObjectIdUpgradeInfoMap.check_lower(linkage_table) + _UniffiConverterMapTypeObjectIdTypeUpgradeInfo.check_lower(linkage_table) self._pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new, _UniffiConverterTypeObjectId.lower(id), _UniffiConverterUInt64.lower(version), - _UniffiConverterSequenceTypeIdentifierModuleMap.lower(modules), + _UniffiConverterMapTypeIdentifierBytes.lower(modules), _UniffiConverterSequenceTypeTypeOrigin.lower(type_origin_table), - _UniffiConverterSequenceTypeObjectIdUpgradeInfoMap.lower(linkage_table)) + _UniffiConverterMapTypeObjectIdTypeUpgradeInfo.lower(linkage_table)) def __del__(self): # In case of partial initialization of instances. @@ -23255,13 +23191,11 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "GasCostSummary", "GasPayment", "GqlAddress", - "IdentifierModuleMap", "MoveLocation", "MoveObject", "MovePackagePage", "MoveStruct", "ObjectFilter", - "ObjectIdUpgradeInfoMap", "ObjectPage", "ObjectRef", "ObjectReference", diff --git a/bindings/python/test.py b/bindings/python/test.py index a712452cb..7da0b7fca 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -56,16 +56,12 @@ async def main(): package=id, ) upgrade_info = UpgradeInfo(upgraded_id=id, upgraded_version=43) - id_module = IdentifierModuleMap( - id=Identifier("some_id"), module=bytes.fromhex("48656c6c6f") - ) - object_id_upgrade_info = ObjectIdUpgradeInfoMap(id=id, info=upgrade_info) move_package = MovePackage( id, version=42, - modules=[id_module], + modules={Identifier("some_id"): bytes.fromhex("48656c6c6f")}, type_origin_table=[type_origin], - linkage_table=[object_id_upgrade_info], + linkage_table={id: upgrade_info}, ) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index bcd7099a8..ff318efb3 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -1,7 +1,11 @@ // Copyright (c) 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use std::{collections::BTreeMap, str::FromStr, sync::Arc}; +use std::{ + collections::{BTreeMap, HashMap}, + str::FromStr, + sync::Arc, +}; use iota_types::{TypeParseError, Version}; @@ -32,7 +36,9 @@ use crate::{ /// ```text /// object-id = 32*OCTET /// ``` -#[derive(Clone, Debug, derive_more::From, derive_more::Deref, uniffi::Object)] +#[derive( + Clone, Debug, PartialEq, Eq, Hash, derive_more::From, derive_more::Deref, uniffi::Object, +)] pub struct ObjectId(pub iota_types::ObjectId); #[uniffi::export] @@ -220,20 +226,6 @@ impl From for iota_types::TypeOrigin { } } -/// A mapping between an identifier and a BCS encoded module. -#[derive(Clone, Debug, uniffi::Record)] -pub struct IdentifierModuleMap { - id: Arc, - module: Vec, -} - -/// A mapping between an Object ID and a package upgrade info. -#[derive(Clone, Debug, uniffi::Record)] -pub struct ObjectIdUpgradeInfoMap { - id: Arc, - info: UpgradeInfo, -} - /// Upgraded package info for the linkage table /// /// # BCS @@ -291,24 +283,21 @@ impl MovePackage { pub fn new( id: &ObjectId, version: Version, - modules: Vec, + modules: HashMap, Vec>, type_origin_table: Vec, - linkage_table: Vec, + linkage_table: HashMap, UpgradeInfo>, ) -> Result { Ok(Self(iota_types::MovePackage { id: id.into(), version, - modules: modules - .into_iter() - .map(|m| (m.id.0.clone(), m.module)) - .collect::>(), + modules: modules.into_iter().map(|(k, v)| (k.0.clone(), v)).collect(), type_origin_table: type_origin_table .into_iter() .map(TryInto::try_into) .collect::, _>>()?, linkage_table: linkage_table .into_iter() - .map(|m| (m.id.0, m.info.into())) + .map(|(k, v)| (**k, v.into())) .collect(), })) } diff --git a/crates/iota-sdk-ffi/src/types/struct_tag.rs b/crates/iota-sdk-ffi/src/types/struct_tag.rs index 00c6464bf..dc58bc265 100644 --- a/crates/iota-sdk-ffi/src/types/struct_tag.rs +++ b/crates/iota-sdk-ffi/src/types/struct_tag.rs @@ -42,7 +42,7 @@ impl From for TypeParseError { /// /// UNDERSCORE = %x95 /// ``` -#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, derive_more::From, uniffi::Object)] +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash, derive_more::From, uniffi::Object)] pub struct Identifier(pub iota_types::Identifier); #[uniffi::export] From 4d7c782571b08ab34eca6b0fca5eddd537397ad1 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 11:10:25 +0200 Subject: [PATCH 15/17] remove error --- crates/iota-sdk-ffi/src/types/object.rs | 2 +- crates/iota-sdk-ffi/src/types/struct_tag.rs | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index ff318efb3..846978ad0 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -7,7 +7,7 @@ use std::{ sync::Arc, }; -use iota_types::{TypeParseError, Version}; +use iota_types::Version; use crate::{ error::Result, diff --git a/crates/iota-sdk-ffi/src/types/struct_tag.rs b/crates/iota-sdk-ffi/src/types/struct_tag.rs index dc58bc265..0475e7a4f 100644 --- a/crates/iota-sdk-ffi/src/types/struct_tag.rs +++ b/crates/iota-sdk-ffi/src/types/struct_tag.rs @@ -8,27 +8,6 @@ use crate::{ types::{address::Address, type_tag::TypeTag}, }; -#[derive(Clone, Debug, derive_more::From, uniffi::Record)] -pub struct TypeParseError { - source: String, -} - -impl From for iota_types::TypeParseError { - fn from(value: TypeParseError) -> Self { - iota_types::TypeParseError { - source: value.source, - } - } -} - -impl From for TypeParseError { - fn from(value: iota_types::TypeParseError) -> Self { - TypeParseError { - source: value.source, - } - } -} - /// A move identifier /// /// # BCS From bf239c6d7fd851951b4c014a7ded217795ea2715 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 11:18:55 +0200 Subject: [PATCH 16/17] remove from impl --- crates/iota-sdk-ffi/src/types/object.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 846978ad0..7398a82ab 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -74,12 +74,6 @@ impl From<&iota_types::ObjectId> for ObjectId { } } -impl From<&ObjectId> for iota_types::ObjectId { - fn from(value: &ObjectId) -> Self { - (*value.0.as_address()).into() - } -} - /// Reference to an object /// /// Contains sufficient information to uniquely identify a specific object. @@ -288,7 +282,7 @@ impl MovePackage { linkage_table: HashMap, UpgradeInfo>, ) -> Result { Ok(Self(iota_types::MovePackage { - id: id.into(), + id: **id, version, modules: modules.into_iter().map(|(k, v)| (k.0.clone(), v)).collect(), type_origin_table: type_origin_table From c3e221fac93426e2a97dd09c218a9bac1154150c Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 12 Aug 2025 12:35:04 +0200 Subject: [PATCH 17/17] last one --- crates/iota-sdk-ffi/src/types/object.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 7398a82ab..416a63bea 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -68,12 +68,6 @@ impl ObjectId { } } -impl From<&iota_types::ObjectId> for ObjectId { - fn from(value: &iota_types::ObjectId) -> Self { - Self(*value) - } -} - /// Reference to an object /// /// Contains sufficient information to uniquely identify a specific object. @@ -95,7 +89,7 @@ pub struct ObjectReference { impl From for ObjectReference { fn from(value: iota_types::ObjectReference) -> Self { Self { - object_id: Arc::new(value.object_id().into()), + object_id: Arc::new((*value.object_id()).into()), version: value.version(), digest: Arc::new(value.digest().into()), }