/// Returns a transaction to transfer coin from one account to another (possibly new) one, with the
/// given arguments.
Returns a transaction to transfer coin from one account to another (possibly new) one, with the
given arguments.
Returns a transaction to transfer coin from one account to another ( possibly new ) one with the given arguments .
pub fn peer_to_peer_txn(
    sender: &Account,
    receiver: &Account,
    seq_num: u64,
    transfer_amount: u64,
) -> SignedTransaction {
    let mut args: Vec<TransactionArgument> = Vec::new();
    args.push(TransactionArgument::Address(*receiver.address()));
    args.push(TransactionArgument::U64(transfer_amount));
    args.push(TransactionArgument::U8Vector(vec![]));
    args.push(TransactionArgument::U8Vector(vec![]));
    // get a SignedTransaction
    sender.create_signed_txn_with_args(
        StdlibScript::PeerToPeerWithMetadata
            .compiled_bytes()
            .into_vec(),
        vec![lbr_type_tag()],
        args,
        seq_num,
        gas_costs::TXN_RESERVED, // this is a default for gas
        0,                       // this is a default for gas
        LBR_NAME.to_owned(),
    )
}
pub fn peer_to_peer_txn ( sender : & Account , receiver : & Account , seq_num : u64 , transfer_amount : u64 , ) -> SignedTransaction { let mut args : Vec < TransactionArgument > = Vec :: new ( ) ; args . push ( TransactionArgument :: Address ( * receiver . address ( ) ) ) ; args . push ( TransactionArgument :: U64 ( transfer_amount ) ) ; args . push ( TransactionArgument :: U8Vector ( vec ! [ ] ) ) ; args . push ( TransactionArgument :: U8Vector ( vec ! [ ] ) ) ; // get a SignedTransaction sender . create_signed_txn_with_args ( StdlibScript :: PeerToPeerWithMetadata . compiled_bytes ( ) . into_vec ( ) , vec ! [ lbr_type_tag ( ) ] , args , seq_num , gas_costs :: TXN_RESERVED , // this is a default for gas 0 , // this is a default for gas LBR_NAME . to_owned ( ) , ) }
Returns a transaction to transfer coin from one account to another (possibly new) one, with the
given arguments.
Returns a transaction to transfer coin from one account to another ( possibly new ) one with the given arguments .
sender
&Account
receiver
&Account
seq_num
u64
transfer_amount
u64