Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5807,7 +5807,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins()
})
if checksum != 434 {
if checksum != 6220 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins: UniFFI API checksum mismatch")
}
Expand Down Expand Up @@ -24294,6 +24294,19 @@ type TransactionBuilderInterface interface {
Publish(packageData *MovePackageData, upgradeCapName string) *TransactionBuilder
// Transfer some coins to a recipient address. If multiple coins are
// provided then they will be merged.
//
// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
// equals 1_000_000_000 NANOS.
// If `amount` is provided, that amount is split from the provided coins
// and sent.
// If `amount` is `None`, the entire coins are transferred.
//
// All provided coins must have the same coin type. Mixing coins of
// different types will result in an error.
//
// If you intend to transfer all provided coins to another address in a
// single transaction, consider using
// `TransactionBuilder::transfer_objects()` instead.
SendCoins(coins []*PtbArgument, recipient *Address, amount **PtbArgument) *TransactionBuilder
// Send IOTA to a recipient address.
//
Expand Down Expand Up @@ -24610,6 +24623,19 @@ func (_self *TransactionBuilder) Publish(packageData *MovePackageData, upgradeCa

// Transfer some coins to a recipient address. If multiple coins are
// provided then they will be merged.
//
// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
// equals 1_000_000_000 NANOS.
// If `amount` is provided, that amount is split from the provided coins
// and sent.
// If `amount` is `None`, the entire coins are transferred.
//
// All provided coins must have the same coin type. Mixing coins of
// different types will result in an error.
//
// If you intend to transfer all provided coins to another address in a
// single transaction, consider using
// `TransactionBuilder::transfer_objects()` instead.
func (_self *TransactionBuilder) SendCoins(coins []*PtbArgument, recipient *Address, amount **PtbArgument) *TransactionBuilder {
_pointer := _self.ffiObject.incrementPointer("*TransactionBuilder")
defer _self.ffiObject.decrementPointer()
Expand Down
28 changes: 27 additions & 1 deletion bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9282,7 +9282,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_publish() != 22805.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins() != 434.toShort()) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins() != 6220.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota() != 2185.toShort()) {
Expand Down Expand Up @@ -40858,6 +40858,19 @@ public interface TransactionBuilderInterface {
/**
* Transfer some coins to a recipient address. If multiple coins are
* provided then they will be merged.
*
* The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
* equals 1_000_000_000 NANOS.
* If `amount` is provided, that amount is split from the provided coins
* and sent.
* If `amount` is `None`, the entire coins are transferred.
*
* All provided coins must have the same coin type. Mixing coins of
* different types will result in an error.
*
* If you intend to transfer all provided coins to another address in a
* single transaction, consider using
* `TransactionBuilder::transfer_objects()` instead.
*/
fun `sendCoins`(`coins`: List<PtbArgument>, `recipient`: Address, `amount`: PtbArgument? = null): TransactionBuilder

Expand Down Expand Up @@ -41271,6 +41284,19 @@ open class TransactionBuilder: Disposable, AutoCloseable, TransactionBuilderInte
/**
* Transfer some coins to a recipient address. If multiple coins are
* provided then they will be merged.
*
* The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
* equals 1_000_000_000 NANOS.
* If `amount` is provided, that amount is split from the provided coins
* and sent.
* If `amount` is `None`, the entire coins are transferred.
*
* All provided coins must have the same coin type. Mixing coins of
* different types will result in an error.
*
* If you intend to transfer all provided coins to another address in a
* single transaction, consider using
* `TransactionBuilder::transfer_objects()` instead.
*/override fun `sendCoins`(`coins`: List<PtbArgument>, `recipient`: Address, `amount`: PtbArgument?): TransactionBuilder {
return FfiConverterTypeTransactionBuilder.lift(
callWithPointer {
Expand Down
28 changes: 27 additions & 1 deletion bindings/python/lib/iota_sdk_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,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_transactionbuilder_publish() != 22805:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins() != 434:
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins() != 6220:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota() != 2185:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
Expand Down Expand Up @@ -40842,6 +40842,19 @@ def send_coins(self, coins: "typing.List[PtbArgument]",recipient: "Address",amou
"""
Transfer some coins to a recipient address. If multiple coins are
provided then they will be merged.

The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
equals 1_000_000_000 NANOS.
If `amount` is provided, that amount is split from the provided coins
and sent.
If `amount` is `None`, the entire coins are transferred.

All provided coins must have the same coin type. Mixing coins of
different types will result in an error.

If you intend to transfer all provided coins to another address in a
single transaction, consider using
`TransactionBuilder::transfer_objects()` instead.
"""

raise NotImplementedError
Expand Down Expand Up @@ -41299,6 +41312,19 @@ def send_coins(self, coins: "typing.List[PtbArgument]",recipient: "Address",amou
"""
Transfer some coins to a recipient address. If multiple coins are
provided then they will be merged.

The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
equals 1_000_000_000 NANOS.
If `amount` is provided, that amount is split from the provided coins
and sent.
If `amount` is `None`, the entire coins are transferred.

All provided coins must have the same coin type. Mixing coins of
different types will result in an error.

If you intend to transfer all provided coins to another address in a
single transaction, consider using
`TransactionBuilder::transfer_objects()` instead.
"""

_UniffiConverterSequenceTypePtbArgument.check_lower(coins)
Expand Down
13 changes: 13 additions & 0 deletions crates/iota-sdk-ffi/src/transaction_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ impl TransactionBuilder {

/// Transfer some coins to a recipient address. If multiple coins are
/// provided then they will be merged.
///
/// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
/// equals 1_000_000_000 NANOS.
/// If `amount` is provided, that amount is split from the provided coins
/// and sent.
/// If `amount` is `None`, the entire coins are transferred.
///
/// All provided coins must have the same coin type. Mixing coins of
/// different types will result in an error.
///
/// If you intend to transfer all provided coins to another address in a
/// single transaction, consider using
/// `TransactionBuilder::transfer_objects()` instead.
#[uniffi::method(default(amount = None))]
pub fn send_coins(
self: Arc<Self>,
Expand Down
40 changes: 40 additions & 0 deletions crates/iota-sdk-transaction-builder/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,46 @@ impl<C, L> TransactionBuilder<C, L> {

/// Transfer some coins to a recipient address. If multiple coins are
/// provided then they will be merged.
///
/// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
/// equals 1_000_000_000 NANOS.
/// If `amount` is provided, that amount is split from the provided coins
/// and sent.
/// If `amount` is `None`, the entire coins are transferred.
///
/// All provided coins must have the same coin type. Mixing coins of
/// different types will result in an error.
///
/// If you intend to transfer all provided coins to another address in a
/// single transaction, consider using
/// [`TransactionBuilder::transfer_objects()`] instead.
///
/// # Example
///
/// ```rust
/// use iota_graphql_client::Client;
/// use iota_sdk_transaction_builder::TransactionBuilder;
/// use iota_types::{Address, ObjectId};
///
/// # #[tokio::main(flavor = "current_thread")]
/// # async fn main() -> eyre::Result<()> {
/// let client = Client::new_devnet();
/// let from_address =
/// Address::from_hex("0x611830d3641a68f94a690dcc25d1f4b0dac948325ac18f6dd32564371735f32c")?;
/// let to_address =
/// Address::from_hex("0x0000a4984bd495d4346fa208ddff4f5d5e5ad48c21dec631ddebc99809f16900")?;
///
/// // This is a coin of type
/// // 0x3358bea865960fea2a1c6844b6fc365f662463dd1821f619838eb2e606a53b6a::cert::CERT
/// let coin =
/// ObjectId::from_hex("0x8ef4259fa2a3499826fa4b8aebeb1d8e478cf5397d05361c96438940b43d28c9")?;
///
/// let mut builder = TransactionBuilder::new(from_address).with_client(client);
/// builder.send_coins([coin], to_address, 50000000000u64);
/// let txn = builder.finish().await?;
/// # Ok(())
/// # }
/// ```
pub fn send_coins<T: PTBArgumentList, U: PTBArgument>(
&mut self,
coins: T,
Expand Down