Skip to content
Merged
Changes from 1 commit
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
33 changes: 33 additions & 0 deletions crates/iota-transaction-builder/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,39 @@ impl<C, L> TransactionBuilder<C, L> {

/// Transfer some coins to a recipient address. If multiple coins are
/// provided then they will be merged.
///
/// # 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 coin = ObjectId::from_str(
/// "0x8ef4259fa2a3499826fa4b8aebeb1d8e478cf5397d05361c96438940b43d28c9",
/// )?;
/// let gas_coin = ObjectId::from_str(
/// "0x0b0270ee9d27da0db09651e5f7338dfa32c7ee6441ccefa1f6e305735bcfc7ab",
/// )?;
///
/// let mut builder = TransactionBuilder::new(from_address).with_client(client);
/// builder
/// .send_coins([coin], to_address, 50000000000u64)
/// .gas(gas_coin)
/// .gas_budget(1000000000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also remove the gas_coin, .gas() and .gas_budget() here as they are not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, already done in #292

/// let txn = builder.finish().await?;
/// Ok(())
/// }
/// ```
pub fn send_coins<T: PTBArgumentList, U: PTBArgument>(
&mut self,
coins: T,
Expand Down
Loading