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
10 changes: 9 additions & 1 deletion bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5609,7 +5609,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota()
})
if checksum != 38983 {
if checksum != 2185 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota: UniFFI API checksum mismatch")
}
Expand Down Expand Up @@ -24006,6 +24006,10 @@ type TransactionBuilderInterface interface {
// provided then they will be merged.
SendCoins(coins []*PtbArgument, recipient *Address, amount **PtbArgument) *TransactionBuilder
// Send IOTA to a recipient address.
//
// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
// equals 1_000_000_000 NANOS. That amount is split from the gas coin and
// sent.
SendIota(recipient *Address, amount *PtbArgument) *TransactionBuilder
// Split a coin by the provided amounts.
SplitCoins(coin *PtbArgument, amounts []*PtbArgument, names []string) *TransactionBuilder
Expand Down Expand Up @@ -24314,6 +24318,10 @@ func (_self *TransactionBuilder) SendCoins(coins []*PtbArgument, recipient *Addr
}

// Send IOTA to a recipient address.
//
// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
// equals 1_000_000_000 NANOS. That amount is split from the gas coin and
// sent.
func (_self *TransactionBuilder) SendIota(recipient *Address, amount *PtbArgument) *TransactionBuilder {
_pointer := _self.ffiObject.incrementPointer("*TransactionBuilder")
defer _self.ffiObject.decrementPointer()
Expand Down
10 changes: 9 additions & 1 deletion bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9051,7 +9051,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_coins() != 434.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota() != 38983.toShort()) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota() != 2185.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_split_coins() != 17747.toShort()) {
Expand Down Expand Up @@ -40546,6 +40546,10 @@ public interface TransactionBuilderInterface {

/**
* Send IOTA to a recipient address.
*
* The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
* equals 1_000_000_000 NANOS. That amount is split from the gas coin and
* sent.
*/
fun `sendIota`(`recipient`: Address, `amount`: PtbArgument): TransactionBuilder

Expand Down Expand Up @@ -40947,6 +40951,10 @@ open class TransactionBuilder: Disposable, AutoCloseable, TransactionBuilderInte

/**
* Send IOTA to a recipient address.
*
* The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
* equals 1_000_000_000 NANOS. That amount is split from the gas coin and
* sent.
*/override fun `sendIota`(`recipient`: Address, `amount`: PtbArgument): TransactionBuilder {
return FfiConverterTypeTransactionBuilder.lift(
callWithPointer {
Expand Down
10 changes: 9 additions & 1 deletion bindings/python/lib/iota_sdk_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,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_send_coins() != 434:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota() != 38983:
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_send_iota() != 2185:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_split_coins() != 17747:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
Expand Down Expand Up @@ -40513,6 +40513,10 @@ def send_coins(self, coins: "typing.List[PtbArgument]",recipient: "Address",amou
def send_iota(self, recipient: "Address",amount: "PtbArgument"):
"""
Send IOTA to a recipient address.

The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
equals 1_000_000_000 NANOS. That amount is split from the gas coin and
sent.
"""

raise NotImplementedError
Expand Down Expand Up @@ -40964,6 +40968,10 @@ def send_coins(self, coins: "typing.List[PtbArgument]",recipient: "Address",amou
def send_iota(self, recipient: "Address",amount: "PtbArgument") -> "TransactionBuilder":
"""
Send IOTA to a recipient address.

The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
equals 1_000_000_000 NANOS. That amount is split from the gas coin and
sent.
"""

_UniffiConverterTypeAddress.check_lower(recipient)
Expand Down
4 changes: 4 additions & 0 deletions crates/iota-sdk-ffi/src/transaction_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ impl TransactionBuilder {
}

/// Send IOTA to a recipient address.
///
/// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
/// equals 1_000_000_000 NANOS. That amount is split from the gas coin and
/// sent.
pub fn send_iota(self: Arc<Self>, recipient: &Address, amount: &PTBArgument) -> Arc<Self> {
self.write(|builder| {
builder.send_iota(**recipient, amount);
Expand Down
28 changes: 28 additions & 0 deletions crates/iota-transaction-builder/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,34 @@ impl<C, L> TransactionBuilder<C, L> {
}

/// Send IOTA to a recipient address.
///
/// The `amount` parameter specifies the quantity in NANOS, where 1 IOTA
/// equals 1_000_000_000 NANOS. That amount is split from the gas coin and
/// sent.
///
/// # Example
///
/// ```rust
/// use iota_graphql_client::Client;
/// use iota_transaction_builder::TransactionBuilder;
/// use iota_types::Address;
///
/// #[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",
/// )?;
///
/// let mut builder = TransactionBuilder::new(from_address).with_client(client);
/// builder.send_iota(to_address, 5000000000u64);
/// let txn = builder.finish().await?;
/// Ok(())
/// }
/// ```
pub fn send_iota<T: PTBArgument>(
&mut self,
recipient: Address,
Expand Down