pub fn create_send_tx<T: ?Sized, C, K>(
	wallet: &mut T,
	amount: u64,
	minimum_confirmations: u64,
	max_outputs: usize,
	num_change_outputs: usize,
	selection_strategy_is_use_all: bool,
	parent_key_id: &Identifier,
	message: Option<String>,
) -> Result<
	(
		Slate,
		Context,
		impl FnOnce(&mut T, &Transaction) -> Result<(), Error>,
	),
	Error,
>
where
	T: WalletBackend<C, K>,
	C: NodeClient,
	K: Keychain,
{
	// Get lock height
	let current_height = wallet.w2n_client().get_chain_height()?;
	// ensure outputs we're selecting are up to date
	updater::refresh_outputs(wallet, parent_key_id)?;

	let lock_height = current_height;

	// Sender selects outputs into a new slate and save our corresponding keys in
	// a transaction context. The secret key in our transaction context will be
	// randomly selected. This returns the public slate, and a closure that locks
	// our inputs and outputs once we're convinced the transaction exchange went
	// according to plan
	// This function is just a big helper to do all of that, in theory
	// this process can be split up in any way
	let (mut slate, mut context, sender_lock_fn) = selection::build_send_tx_slate(
		wallet,
		2,
		amount,
		current_height,
		minimum_confirmations,
		lock_height,
		max_outputs,
		num_change_outputs,
		selection_strategy_is_use_all,
		parent_key_id.clone(),
	)?;

	// Generate a kernel offset and subtract from our context's secret key. Store
	// the offset in the slate's transaction kernel, and adds our public key
	// information to the slate
	let _ = slate.fill_round_1(
		wallet.keychain(),
		&mut context.sec_key,
		&context.sec_nonce,
		0,
		message,
	)?;

	Ok((slate, context, sender_lock_fn))
}
/// Issue a new transaction to the provided sender by spending some of our
/// wallet
Issue a new transaction to the provided sender by spending some of our
wallet
Issue a new transaction to the provided sender by spending some of our wallet
pub fn create_send_tx<T: ?Sized, C, K>(
	wallet: &mut T,
	amount: u64,
	minimum_confirmations: u64,
	max_outputs: usize,
	num_change_outputs: usize,
	selection_strategy_is_use_all: bool,
	parent_key_id: &Identifier,
	message: Option<String>,
) -> Result<
	(
		Slate,
		Context,
		impl FnOnce(&mut T, &Transaction) -> Result<(), Error>,
	),
	Error,
>
where
	T: WalletBackend<C, K>,
	C: NodeClient,
	K: Keychain,
{
	// Get lock height
	let current_height = wallet.w2n_client().get_chain_height()?;
	// ensure outputs we're selecting are up to date
	updater::refresh_outputs(wallet, parent_key_id)?;
	let lock_height = current_height;
	// Sender selects outputs into a new slate and save our corresponding keys in
	// a transaction context. The secret key in our transaction context will be
	// randomly selected. This returns the public slate, and a closure that locks
	// our inputs and outputs once we're convinced the transaction exchange went
	// according to plan
	// This function is just a big helper to do all of that, in theory
	// this process can be split up in any way
	let (mut slate, mut context, sender_lock_fn) = selection::build_send_tx_slate(
		wallet,
		2,
		amount,
		current_height,
		minimum_confirmations,
		lock_height,
		max_outputs,
		num_change_outputs,
		selection_strategy_is_use_all,
		parent_key_id.clone(),
	)?;
	// Generate a kernel offset and subtract from our context's secret key. Store
	// the offset in the slate's transaction kernel, and adds our public key
	// information to the slate
	let _ = slate.fill_round_1(
		wallet.keychain(),
		&mut context.sec_key,
		&context.sec_nonce,
		0,
		message,
	)?;
	Ok((slate, context, sender_lock_fn))
}
pub fn create_send_tx < T : ? Sized , C , K > ( wallet : & mut T , amount : u64 , minimum_confirmations : u64 , max_outputs : usize , num_change_outputs : usize , selection_strategy_is_use_all : bool , parent_key_id : & Identifier , message : Option < String > , ) -> Result < ( Slate , Context , impl FnOnce ( & mut T , & Transaction ) -> Result < ( ) , Error > , ) , Error , > where T : WalletBackend < C , K > , C : NodeClient , K : Keychain , { // Get lock height let current_height = wallet . w2n_client ( ) . get_chain_height ( ) ? ; // ensure outputs we're selecting are up to date updater :: refresh_outputs ( wallet , parent_key_id ) ? ; let lock_height = current_height ; // Sender selects outputs into a new slate and save our corresponding keys in // a transaction context. The secret key in our transaction context will be // randomly selected. This returns the public slate, and a closure that locks // our inputs and outputs once we're convinced the transaction exchange went // according to plan // This function is just a big helper to do all of that, in theory // this process can be split up in any way let ( mut slate , mut context , sender_lock_fn ) = selection :: build_send_tx_slate ( wallet , 2 , amount , current_height , minimum_confirmations , lock_height , max_outputs , num_change_outputs , selection_strategy_is_use_all , parent_key_id . clone ( ) , ) ? ; // Generate a kernel offset and subtract from our context's secret key. Store // the offset in the slate's transaction kernel, and adds our public key // information to the slate let _ = slate . fill_round_1 ( wallet . keychain ( ) , & mut context . sec_key , & context . sec_nonce , 0 , message , ) ? ; Ok ( ( slate , context , sender_lock_fn ) ) }
Issue a new transaction to the provided sender by spending some of our
wallet
Issue a new transaction to the provided sender by spending some of our wallet
wallet
&mut T
amount
u64
minimum_confirmations
u64
max_outputs
usize
num_change_outputs
usize
selection_strategy_is_use_all
bool
parent_key_id
&Identifier
message
Option<String>