From 23bc434a545cbd166a467e687eb6b8145bd3934e Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Thu, 9 Oct 2025 13:18:17 +0200 Subject: [PATCH 1/5] chore(graphql): Make stream methods sync and add helpers --- crates/iota-graphql-client/src/lib.rs | 68 ++++++++++++++++------- crates/iota-sdk-ffi/src/graphql.rs | 31 +++++++++-- crates/iota-sdk-types/src/type_tag/mod.rs | 30 +++++----- 3 files changed, 89 insertions(+), 40 deletions(-) diff --git a/crates/iota-graphql-client/src/lib.rs b/crates/iota-graphql-client/src/lib.rs index 22cf4d25d..3c126e200 100644 --- a/crates/iota-graphql-client/src/lib.rs +++ b/crates/iota-graphql-client/src/lib.rs @@ -18,8 +18,9 @@ use cynic::{GraphQlResponse, MutationBuilder, Operation, QueryBuilder, serde}; use error::{Error, Kind}; use futures::Stream; use iota_types::{ - Address, CheckpointSequenceNumber, CheckpointSummary, Digest, MovePackage, Object, ObjectId, - SignedTransaction, Transaction, TransactionEffects, TransactionKind, TypeTag, UserSignature, + Address, CheckpointSequenceNumber, CheckpointSummary, Digest, IdentifierRef, MovePackage, + Object, ObjectId, SignedTransaction, StructTag, Transaction, TransactionEffects, + TransactionKind, TypeTag, UserSignature, framework::Coin, iota_names::{NameFormat, NameRegistration, name::Name}, }; @@ -118,13 +119,12 @@ impl Client { /// Get the list of coins for the specified address as a stream. /// - /// If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - /// which will return all coins. For IOTA coin, pass in the coin type: - /// `0x2::coin::Coin<0x2::iota::IOTA>`. - pub async fn coins_stream( + /// If `coin_type` is not provided, all coins will be returned. For IOTA + /// coins, pass in the coin type: `0x2::iota::IOTA`. + pub fn coins_stream( &self, address: Address, - coin_type: impl Into>, + coin_type: impl Into>, streaming_direction: Direction, ) -> impl Stream> + '_ { let coin_type = coin_type.into(); @@ -134,9 +134,21 @@ impl Client { ) } + /// Get the list of gas coins for the specified address as a stream. + pub fn gas_coins_stream( + &self, + address: Address, + streaming_direction: Direction, + ) -> impl Stream> + '_ { + stream_paginated_query( + move |filter| self.gas_coins(address, filter), + streaming_direction, + ) + } + /// Get a stream of [`CheckpointSummary`]. Note that this will fetch all /// checkpoints which may trigger a lot of requests. - pub async fn checkpoints_stream( + pub fn checkpoints_stream( &self, streaming_direction: Direction, ) -> impl Stream> + '_ { @@ -145,7 +157,7 @@ impl Client { /// Get a stream of dynamic fields for the provided address. Note that this /// will also fetch dynamic fields on wrapped objects. - pub async fn dynamic_fields_stream( + pub fn dynamic_fields_stream( &self, address: Address, streaming_direction: Direction, @@ -167,7 +179,7 @@ impl Client { } /// Return a stream of events based on the (optional) event filter. - pub async fn events_stream( + pub fn events_stream( &self, filter: impl Into>, streaming_direction: Direction, @@ -180,7 +192,7 @@ impl Client { } /// Return a stream of objects based on the (optional) object filter. - pub async fn objects_stream( + pub fn objects_stream( &self, filter: impl Into>, streaming_direction: Direction, @@ -292,7 +304,7 @@ impl Client { } /// Get a stream of transactions based on the (optional) transaction filter. - pub async fn transactions_stream( + pub fn transactions_stream( &self, filter: impl Into>, streaming_direction: Direction, @@ -306,7 +318,7 @@ impl Client { /// Get a stream of transactions' effects based on the (optional) /// transaction filter. - pub async fn transactions_effects_stream( + pub fn transactions_effects_stream( &self, filter: impl Into>, streaming_direction: Direction, @@ -610,13 +622,12 @@ impl Client { /// Get the list of coins for the specified address. /// - /// If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - /// which will return all coins. For IOTA coin, pass in the coin type: - /// `0x2::coin::Coin<0x2::iota::IOTA>`. + /// If `coin_type` is not provided, all coins will be returned. For IOTA + /// coins, pass in the coin type: `0x2::iota::IOTA`. pub async fn coins( &self, owner: Address, - coin_type: impl Into>, + coin_type: impl Into>, pagination_filter: PaginationFilter, ) -> Result> { let response = self @@ -625,7 +636,14 @@ impl Client { type_: Some( coin_type .into() - .unwrap_or_else(|| "0x2::coin::Coin".to_owned()), + .map(|coin_type| StructTag::coin(coin_type)) + .unwrap_or_else(|| StructTag { + address: Address::TWO, + module: IdentifierRef::const_new("coin").into(), + name: IdentifierRef::const_new("Coin").into(), + type_params: Default::default(), + }) + .to_string(), ), owner: Some(owner), object_ids: None, @@ -644,6 +662,16 @@ impl Client { )) } + /// Get the list of gas coins for the specified address. + pub async fn gas_coins( + &self, + owner: Address, + pagination_filter: PaginationFilter, + ) -> Result> { + self.coins(owner, StructTag::iota(), pagination_filter) + .await + } + /// Get the coin metadata for the coin type. pub async fn coin_metadata(&self, coin_type: &str) -> Result> { let operation = CoinMetadataQuery::build(CoinMetadataArgs { coin_type }); @@ -2189,9 +2217,7 @@ mod tests { let mut num_coins = 0; for attempt in 0..MAX_RETRIES { - let mut stream = client - .coins_stream(address, None, Direction::default()) - .await; + let mut stream = client.coins_stream(address, None, Direction::default()); while let Some(result) = stream.next().await { match result { diff --git a/crates/iota-sdk-ffi/src/graphql.rs b/crates/iota-sdk-ffi/src/graphql.rs index ff66727c8..0bc112caa 100644 --- a/crates/iota-sdk-ffi/src/graphql.rs +++ b/crates/iota-sdk-ffi/src/graphql.rs @@ -24,6 +24,7 @@ use crate::{ iota_names::Name, object::{MovePackage, Object, ObjectId}, signature::UserSignature, + struct_tag::StructTag, transaction::{SignedTransaction, Transaction, TransactionEffects, TransactionKind}, type_tag::TypeTag, }, @@ -169,21 +170,41 @@ impl GraphQLClient { /// Get the list of coins for the specified address. /// - /// If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - /// which will return all coins. For IOTA coin, pass in the coin type: - /// `0x2::coin::Coin<0x2::iota::IOTA>`. + /// If `coin_type` is not provided, all coins will be returned. For IOTA + /// coins, pass in the coin type: `0x2::iota::IOTA`. #[uniffi::method(default(pagination_filter = None, coin_type = None))] pub async fn coins( &self, owner: &Address, pagination_filter: Option, - coin_type: Option, + coin_type: Option>, + ) -> Result { + Ok(self + .0 + .read() + .await + .coins( + **owner, + coin_type.map(|t| t.0.clone()), + pagination_filter.unwrap_or_default(), + ) + .await? + .map(Into::into) + .into()) + } + + /// Get the list of gas coins for the specified address. + #[uniffi::method(default(pagination_filter = None))] + pub async fn gas_coins( + &self, + owner: &Address, + pagination_filter: Option, ) -> Result { Ok(self .0 .read() .await - .coins(**owner, coin_type, pagination_filter.unwrap_or_default()) + .gas_coins(**owner, pagination_filter.unwrap_or_default()) .await? .map(Into::into) .into()) diff --git a/crates/iota-sdk-types/src/type_tag/mod.rs b/crates/iota-sdk-types/src/type_tag/mod.rs index 39677f761..64905db2e 100644 --- a/crates/iota-sdk-types/src/type_tag/mod.rs +++ b/crates/iota-sdk-types/src/type_tag/mod.rs @@ -402,12 +402,12 @@ pub struct StructTag { } impl StructTag { - pub fn coin(type_tag: TypeTag) -> Self { + pub fn coin(type_tag: impl Into) -> Self { Self { address: Address::TWO, - module: Identifier::new("coin").unwrap(), - name: Identifier::new("Coin").unwrap(), - type_params: vec![type_tag], + module: IdentifierRef::const_new("coin").into(), + name: IdentifierRef::const_new("Coin").into(), + type_params: vec![type_tag.into()], } } @@ -433,22 +433,24 @@ impl StructTag { self.coin_type_opt().expect("not a coin") } - pub fn gas_coin() -> Self { - let iota = Self { + pub fn iota() -> Self { + Self { address: Address::TWO, - module: Identifier::new("iota").unwrap(), - name: Identifier::new("IOTA").unwrap(), + module: IdentifierRef::const_new("iota").into(), + name: IdentifierRef::const_new("IOTA").into(), type_params: vec![], - }; + } + } - Self::coin(TypeTag::Struct(Box::new(iota))) + pub fn gas_coin() -> Self { + Self::coin(Self::iota()) } pub fn staked_iota() -> Self { Self { address: Address::THREE, - module: Identifier::new("staking_pool").unwrap(), - name: Identifier::new("StakedIota").unwrap(), + module: IdentifierRef::const_new("staking_pool").into(), + name: IdentifierRef::const_new("StakedIota").into(), type_params: vec![], } } @@ -456,8 +458,8 @@ impl StructTag { pub fn timelocked_staked_iota() -> Self { Self { address: Address::THREE, - module: Identifier::new("timelocked_staking").unwrap(), - name: Identifier::new("TimelockedStakedIota").unwrap(), + module: IdentifierRef::const_new("timelocked_staking").into(), + name: IdentifierRef::const_new("TimelockedStakedIota").into(), type_params: vec![], } } From ef2ece07bddf948d808508fc6c8d02d15b956223 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Thu, 9 Oct 2025 14:05:45 +0200 Subject: [PATCH 2/5] bindings --- bindings/go/iota_sdk_ffi/iota_sdk_ffi.go | 61 +++++++++++++++--- bindings/go/iota_sdk_ffi/iota_sdk_ffi.h | 11 ++++ bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt | 56 +++++++++++++--- bindings/python/lib/iota_sdk_ffi.py | 67 ++++++++++++++++---- 4 files changed, 164 insertions(+), 31 deletions(-) diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index 8cbca8fe8..58c7b5769 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -1325,7 +1325,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() }) - if checksum != 50359 { + if checksum != 47450 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins: UniFFI API checksum mismatch") } @@ -1421,6 +1421,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins() + }) + if checksum != 24826 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_default_name() }) @@ -11521,10 +11530,9 @@ type GraphQlClientInterface interface { CoinMetadata(coinType string) (*CoinMetadata, error) // Get the list of coins for the specified address. // - // If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - // which will return all coins. For IOTA coin, pass in the coin type: - // `0x2::coin::Coin<0x2::iota::IOTA>`. - Coins(owner *Address, paginationFilter *PaginationFilter, coinType *string) (CoinPage, error) + // If `coin_type` is not provided, all coins will be returned. For IOTA + // coins, pass in the coin type: `0x2::iota::IOTA`. + Coins(owner *Address, paginationFilter *PaginationFilter, coinType **StructTag) (CoinPage, error) // Dry run a [`Transaction`] and return the transaction effects and dry run // error (if any). // @@ -11594,6 +11602,8 @@ type GraphQlClientInterface interface { Events(filter *EventFilter, paginationFilter *PaginationFilter) (EventPage, error) // Execute a transaction. ExecuteTx(signatures []*UserSignature, tx *Transaction) (**TransactionEffects, error) + // Get the list of gas coins for the specified address. + GasCoins(owner *Address, paginationFilter *PaginationFilter) (CoinPage, error) // Get the default name pointing to this address, if one exists. IotaNamesDefaultName(address *Address, format *NameFormat) (**Name, error) // Return the resolved address for the given name. @@ -11969,10 +11979,9 @@ func (_self *GraphQlClient) CoinMetadata(coinType string) (*CoinMetadata, error) // Get the list of coins for the specified address. // -// If `coin_type` is not provided, it will default to `0x2::coin::Coin`, -// which will return all coins. For IOTA coin, pass in the coin type: -// `0x2::coin::Coin<0x2::iota::IOTA>`. -func (_self *GraphQlClient) Coins(owner *Address, paginationFilter *PaginationFilter, coinType *string) (CoinPage, error) { +// If `coin_type` is not provided, all coins will be returned. For IOTA +// coins, pass in the coin type: `0x2::iota::IOTA`. +func (_self *GraphQlClient) Coins(owner *Address, paginationFilter *PaginationFilter, coinType **StructTag) (CoinPage, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() res, err :=uniffiRustCallAsync[SdkFfiError]( @@ -11989,7 +11998,7 @@ func (_self *GraphQlClient) Coins(owner *Address, paginationFilter *PaginationFi return FfiConverterCoinPageINSTANCE.Lift(ffi) }, C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( - _pointer,FfiConverterAddressINSTANCE.Lower(owner), FfiConverterOptionalPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalStringINSTANCE.Lower(coinType)), + _pointer,FfiConverterAddressINSTANCE.Lower(owner), FfiConverterOptionalPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalStructTagINSTANCE.Lower(coinType)), // pollFn func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) @@ -12372,6 +12381,38 @@ func (_self *GraphQlClient) ExecuteTx(signatures []*UserSignature, tx *Transacti return res, err } +// Get the list of gas coins for the specified address. +func (_self *GraphQlClient) GasCoins(owner *Address, paginationFilter *PaginationFilter) (CoinPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) CoinPage { + return FfiConverterCoinPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_gas_coins( + _pointer,FfiConverterAddressINSTANCE.Lower(owner), FfiConverterOptionalPaginationFilterINSTANCE.Lower(paginationFilter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + + return res, err +} + // Get the default name pointing to this address, if one exists. func (_self *GraphQlClient) IotaNamesDefaultName(address *Address, format *NameFormat) (**Name, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index 09e121b6e..2a72a2ce9 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -1701,6 +1701,11 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_events(void* ptr, RustBuffe uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx(void* ptr, RustBuffer signatures, void* tx ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_GAS_COINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_GAS_COINS +uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_gas_coins(void* ptr, void* owner, RustBuffer pagination_filter +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_IOTA_NAMES_DEFAULT_NAME #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_GRAPHQLCLIENT_IOTA_NAMES_DEFAULT_NAME uint64_t uniffi_iota_sdk_ffi_fn_method_graphqlclient_iota_names_default_name(void* ptr, void* address, RustBuffer format @@ -5825,6 +5830,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_GRAPHQLCLIENT_EXECUTE_TX uint16_t uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_GRAPHQLCLIENT_GAS_COINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_GRAPHQLCLIENT_GAS_COINS +uint16_t uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_GRAPHQLCLIENT_IOTA_NAMES_DEFAULT_NAME diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index c0a3fada8..77435a329 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -2273,6 +2273,8 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { + + @@ -2527,6 +2529,8 @@ fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events( ): Short fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins( +): Short fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_default_name( ): Short fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_lookup( @@ -4210,6 +4214,8 @@ fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_events(`ptr`: Pointer,`filter`: ): Long fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx(`ptr`: Pointer,`signatures`: RustBuffer.ByValue,`tx`: Pointer, ): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_gas_coins(`ptr`: Pointer,`owner`: Pointer,`paginationFilter`: RustBuffer.ByValue, +): Long fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_iota_names_default_name(`ptr`: Pointer,`address`: Pointer,`format`: RustBuffer.ByValue, ): Long fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_iota_names_lookup(`ptr`: Pointer,`name`: RustBuffer.ByValue, @@ -5901,7 +5907,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 10872.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 50359.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 47450.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 12272.toShort()) { @@ -5934,6 +5940,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx() != 41079.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins() != 24826.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_default_name() != 53764.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -18934,11 +18943,10 @@ public interface GraphQlClientInterface { /** * Get the list of coins for the specified address. * - * If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - * which will return all coins. For IOTA coin, pass in the coin type: - * `0x2::coin::Coin<0x2::iota::IOTA>`. + * If `coin_type` is not provided, all coins will be returned. For IOTA + * coins, pass in the coin type: `0x2::iota::IOTA`. */ - suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter? = null, `coinType`: kotlin.String? = null): CoinPage + suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter? = null, `coinType`: StructTag? = null): CoinPage /** * Dry run a [`Transaction`] and return the transaction effects and dry run @@ -19039,6 +19047,11 @@ public interface GraphQlClientInterface { */ suspend fun `executeTx`(`signatures`: List, `tx`: Transaction): TransactionEffects? + /** + * Get the list of gas coins for the specified address. + */ + suspend fun `gasCoins`(`owner`: Address, `paginationFilter`: PaginationFilter? = null): CoinPage + /** * Get the default name pointing to this address, if one exists. */ @@ -19506,18 +19519,17 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** * Get the list of coins for the specified address. * - * If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - * which will return all coins. For IOTA coin, pass in the coin type: - * `0x2::coin::Coin<0x2::iota::IOTA>`. + * If `coin_type` is not provided, all coins will be returned. For IOTA + * coins, pass in the coin type: `0x2::iota::IOTA`. */ @Throws(SdkFfiException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter?, `coinType`: kotlin.String?) : CoinPage { + override suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter?, `coinType`: StructTag?) : CoinPage { return uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( thisPtr, - FfiConverterTypeAddress.lower(`owner`),FfiConverterOptionalTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalString.lower(`coinType`), + FfiConverterTypeAddress.lower(`owner`),FfiConverterOptionalTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeStructTag.lower(`coinType`), ) }, { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, @@ -19820,6 +19832,30 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface } + /** + * Get the list of gas coins for the specified address. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `gasCoins`(`owner`: Address, `paginationFilter`: PaginationFilter?) : CoinPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_gas_coins( + thisPtr, + FfiConverterTypeAddress.lower(`owner`),FfiConverterOptionalTypePaginationFilter.lower(`paginationFilter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeCoinPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } + + /** * Get the default name pointing to this address, if one exists. */ diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 6ffe1a890..601702a65 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -675,7 +675,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_coin_metadata() != 10872: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 50359: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 47450: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") 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") @@ -697,6 +697,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_execute_tx() != 41079: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins() != 24826: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_default_name() != 53764: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_lookup() != 20908: @@ -3268,6 +3270,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): 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_gas_coins.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_gas_coins.restype = ctypes.c_uint64 _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_iota_names_default_name.argtypes = ( ctypes.c_void_p, ctypes.c_void_p, @@ -7139,6 +7147,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_gas_coins.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_default_name.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_iota_names_default_name.restype = ctypes.c_uint16 @@ -26895,13 +26906,12 @@ def coin_metadata(self, coin_type: "str"): """ raise NotImplementedError - def coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT,coin_type: "typing.Union[object, typing.Optional[str]]" = _DEFAULT): + def coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT,coin_type: "typing.Union[object, typing.Optional[StructTag]]" = _DEFAULT): """ Get the list of coins for the specified address. - If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - which will return all coins. For IOTA coin, pass in the coin type: - `0x2::coin::Coin<0x2::iota::IOTA>`. + If `coin_type` is not provided, all coins will be returned. For IOTA + coins, pass in the coin type: `0x2::iota::IOTA`. """ raise NotImplementedError @@ -27013,6 +27023,12 @@ def execute_tx(self, signatures: "typing.List[UserSignature]",tx: "Transaction") Execute a transaction. """ + raise NotImplementedError + def gas_coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT): + """ + Get the list of gas coins for the specified address. + """ + raise NotImplementedError def iota_names_default_name(self, address: "Address",format: "typing.Optional[NameFormat]"): """ @@ -27513,13 +27529,12 @@ async def coin_metadata(self, coin_type: "str") -> "typing.Optional[CoinMetadata - async def coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT,coin_type: "typing.Union[object, typing.Optional[str]]" = _DEFAULT) -> "CoinPage": + async def coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT,coin_type: "typing.Union[object, typing.Optional[StructTag]]" = _DEFAULT) -> "CoinPage": """ Get the list of coins for the specified address. - If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - which will return all coins. For IOTA coin, pass in the coin type: - `0x2::coin::Coin<0x2::iota::IOTA>`. + If `coin_type` is not provided, all coins will be returned. For IOTA + coins, pass in the coin type: `0x2::iota::IOTA`. """ _UniffiConverterTypeAddress.check_lower(owner) @@ -27530,14 +27545,14 @@ async def coins(self, owner: "Address",pagination_filter: "typing.Union[object, if coin_type is _DEFAULT: coin_type = None - _UniffiConverterOptionalString.check_lower(coin_type) + _UniffiConverterOptionalTypeStructTag.check_lower(coin_type) return await _uniffi_rust_call_async( _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(owner), _UniffiConverterOptionalTypePaginationFilter.lower(pagination_filter), - _UniffiConverterOptionalString.lower(coin_type) + _UniffiConverterOptionalTypeStructTag.lower(coin_type) ), _UniffiLib.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer, _UniffiLib.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer, @@ -27897,6 +27912,36 @@ async def execute_tx(self, signatures: "typing.List[UserSignature]",tx: "Transac + async def gas_coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT) -> "CoinPage": + """ + Get the list of gas coins for the specified address. + """ + + _UniffiConverterTypeAddress.check_lower(owner) + + if pagination_filter is _DEFAULT: + pagination_filter = None + _UniffiConverterOptionalTypePaginationFilter.check_lower(pagination_filter) + + return await _uniffi_rust_call_async( + _UniffiLib.uniffi_iota_sdk_ffi_fn_method_graphqlclient_gas_coins( + self._uniffi_clone_pointer(), + _UniffiConverterTypeAddress.lower(owner), + _UniffiConverterOptionalTypePaginationFilter.lower(pagination_filter) + ), + _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 + _UniffiConverterTypeCoinPage.lift, + + # Error FFI converter +_UniffiConverterTypeSdkFfiError, + + ) + + + async def iota_names_default_name(self, address: "Address",format: "typing.Optional[NameFormat]") -> "typing.Optional[Name]": """ Get the default name pointing to this address, if one exists. From d7edae932368833048a98ad4b1202b2ef66e61b6 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Thu, 9 Oct 2025 14:11:12 +0200 Subject: [PATCH 3/5] clippy --- crates/iota-graphql-client/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/iota-graphql-client/src/lib.rs b/crates/iota-graphql-client/src/lib.rs index 3c126e200..d0c26a089 100644 --- a/crates/iota-graphql-client/src/lib.rs +++ b/crates/iota-graphql-client/src/lib.rs @@ -636,7 +636,7 @@ impl Client { type_: Some( coin_type .into() - .map(|coin_type| StructTag::coin(coin_type)) + .map(StructTag::coin) .unwrap_or_else(|| StructTag { address: Address::TWO, module: IdentifierRef::const_new("coin").into(), From bce3a89827c41fbabd69d7da35270c6c43b441ef Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 14 Oct 2025 13:49:57 +0200 Subject: [PATCH 4/5] update bindings --- bindings/go/iota_sdk_ffi/iota_sdk_ffi.go | 111 ++++++++++++++++++- bindings/go/iota_sdk_ffi/iota_sdk_ffi.h | 84 ++++++++++++++ bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt | 5 +- 3 files changed, 194 insertions(+), 6 deletions(-) diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index 2e6fe5b10..bfdbc524b 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -1352,7 +1352,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() }) - if checksum != 29988 { + if checksum != 17199 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field: UniFFI API checksum mismatch") } @@ -4517,6 +4517,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_framework() + }) + if checksum != 52951 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_framework: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes() }) @@ -4544,6 +4553,33 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_std_lib() + }) + if checksum != 35825 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_std_lib: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_system() + }) + if checksum != 4297 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_system: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_zero() + }) + if checksum != 46553 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_zero: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas() }) @@ -5624,6 +5660,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_clock() + }) + if checksum != 14732 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_clock: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id() }) @@ -5651,6 +5696,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_system() + }) + if checksum != 9600 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_system: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_zero() + }) + if checksum != 40526 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_zero: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_objecttype_new_package() }) @@ -7372,6 +7435,12 @@ type Address struct { } +func AddressFramework() *Address { + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_framework(_uniffiStatus) + })) +} + func AddressFromBytes(bytes []byte) (*Address, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { return C.uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) @@ -7402,6 +7471,24 @@ func AddressGenerate() *Address { })) } +func AddressStdLib() *Address { + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_std_lib(_uniffiStatus) + })) +} + +func AddressSystem() *Address { + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_system(_uniffiStatus) + })) +} + +func AddressZero() *Address { + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_zero(_uniffiStatus) + })) +} + func (_self *Address) ToBytes() []byte { @@ -12005,7 +12092,7 @@ type GraphQlClientInterface interface { // ```rust,ignore // // let client = iota_graphql_client::Client::new_devnet(); - // let address = Address::from_str("0x5").unwrap(); + // let address = ObjectId::SYSTEM.into(); // let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); // // # alternatively, pass in the bcs bytes @@ -12544,7 +12631,7 @@ func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta Transac // ```rust,ignore // // let client = iota_graphql_client::Client::new_devnet(); -// let address = Address::from_str("0x5").unwrap(); +// let address = ObjectId::SYSTEM.into(); // let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); // // # alternatively, pass in the bcs bytes @@ -17057,6 +17144,12 @@ type ObjectId struct { } +func ObjectIdClock() *ObjectId { + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_clock(_uniffiStatus) + })) +} + // Create an ObjectId from a transaction digest and the number of objects // that have been created during a transactions. func ObjectIdDeriveId(digest *Digest, count uint64) *ObjectId { @@ -17089,6 +17182,18 @@ func ObjectIdFromHex(hex string) (*ObjectId, error) { } } +func ObjectIdSystem() *ObjectId { + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_system(_uniffiStatus) + })) +} + +func ObjectIdZero() *ObjectId { + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_zero(_uniffiStatus) + })) +} + // Derive an ObjectId for a Dynamic Child Object. diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index 84d8a4b7d..a64ce6feb 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -386,6 +386,12 @@ void* uniffi_iota_sdk_ffi_fn_clone_address(void* ptr, RustCallStatus *out_status #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ADDRESS void uniffi_iota_sdk_ffi_fn_free_address(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_FRAMEWORK +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_FRAMEWORK +void* uniffi_iota_sdk_ffi_fn_constructor_address_framework(RustCallStatus *out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_FROM_BYTES @@ -402,6 +408,24 @@ void* uniffi_iota_sdk_ffi_fn_constructor_address_from_hex(RustBuffer hex, RustCa #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_GENERATE void* uniffi_iota_sdk_ffi_fn_constructor_address_generate(RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_STD_LIB +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_STD_LIB +void* uniffi_iota_sdk_ffi_fn_constructor_address_std_lib(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_SYSTEM +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_SYSTEM +void* uniffi_iota_sdk_ffi_fn_constructor_address_system(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_ZERO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ADDRESS_ZERO +void* uniffi_iota_sdk_ffi_fn_constructor_address_zero(RustCallStatus *out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ADDRESS_TO_BYTES @@ -2740,6 +2764,12 @@ void* uniffi_iota_sdk_ffi_fn_clone_objectid(void* ptr, RustCallStatus *out_statu #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_OBJECTID #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_OBJECTID void uniffi_iota_sdk_ffi_fn_free_objectid(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_CLOCK +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_CLOCK +void* uniffi_iota_sdk_ffi_fn_constructor_objectid_clock(RustCallStatus *out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_DERIVE_ID @@ -2755,6 +2785,18 @@ void* uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes(RustBuffer bytes, R #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_FROM_HEX #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_FROM_HEX void* uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex(RustBuffer hex, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_SYSTEM +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_SYSTEM +void* uniffi_iota_sdk_ffi_fn_constructor_objectid_system(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_ZERO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_ZERO +void* uniffi_iota_sdk_ffi_fn_constructor_objectid_zero(RustCallStatus *out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTID_DERIVE_DYNAMIC_CHILD_ID @@ -8149,6 +8191,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginverifier_verify(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINVERIFIER_WITH_JWKS uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginverifier_with_jwks(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_FRAMEWORK +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_FRAMEWORK +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_framework(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_FROM_BYTES @@ -8167,6 +8215,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_STD_LIB +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_STD_LIB +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_std_lib(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_SYSTEM +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_SYSTEM +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_system(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_ZERO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_ZERO +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_zero(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_GAS @@ -8887,6 +8953,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_package(vo #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDATA_NEW_MOVE_STRUCT uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_struct(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_CLOCK +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_CLOCK +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectid_clock(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_DERIVE_ID @@ -8905,6 +8977,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_FROM_HEX uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_SYSTEM +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_SYSTEM +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectid_system(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_ZERO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_ZERO +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectid_zero(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTTYPE_NEW_PACKAGE diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index b09874470..f4f3c06f3 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -2378,8 +2378,6 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { -<<<<<<< HEAD -======= @@ -2392,7 +2390,8 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { ->>>>>>> sdk-bindings + + // For large crates we prevent `MethodTooLargeException` (see #2340) // N.B. the name of the extension is very misleading, since it is // rather `InterfaceTooLargeException`, caused by too many methods From fd294762045b8ae3b94122b8fe079d769c3df0f5 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Wed, 15 Oct 2025 09:38:55 +0200 Subject: [PATCH 5/5] move example --- .../examples/prepare_transfer_objects_offline.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename crates/{iota-graphql-client => iota-sdk}/examples/prepare_transfer_objects_offline.rs (100%) diff --git a/crates/iota-graphql-client/examples/prepare_transfer_objects_offline.rs b/crates/iota-sdk/examples/prepare_transfer_objects_offline.rs similarity index 100% rename from crates/iota-graphql-client/examples/prepare_transfer_objects_offline.rs rename to crates/iota-sdk/examples/prepare_transfer_objects_offline.rs