pub fn prepare_transfer_coins(
        &mut self,
        sender_address: AccountAddress,
        sender_sequence_number: u64,
        receiver_address: AccountAddress,
        receiver_auth_key_prefix: Vec<u8>,
        num_coins: u64,
        coin_currency: String,
        gas_unit_price: Option<u64>,
        max_gas_amount: Option<u64>,
        gas_currency_code: Option<String>,
    ) -> Result<RawTransaction> {
        let currency_code = from_currency_code_string(&coin_currency)
            .map_err(|_| format_err!("Invalid currency code {} specified", coin_currency))?;
        let program = transaction_builder::encode_transfer_with_metadata_script(
            type_tag_for_currency_code(currency_code),
            &receiver_address,
            receiver_auth_key_prefix,
            num_coins,
            vec![],
            vec![],
        );

        Ok(create_unsigned_txn(
            TransactionPayload::Script(program),
            sender_address,
            sender_sequence_number,
            max_gas_amount.unwrap_or(MAX_GAS_AMOUNT),
            gas_unit_price.unwrap_or(GAS_UNIT_PRICE),
            gas_currency_code.unwrap_or_else(|| LBR_NAME.to_owned()),
            TX_EXPIRATION,
        ))
    }
/// Prepare a transfer transaction: return the unsigned raw transaction
Prepare a transfer transaction: return the unsigned raw transaction
Prepare a transfer transaction : return the unsigned raw transaction
pub fn prepare_transfer_coins(
        &mut self,
        sender_address: AccountAddress,
        sender_sequence_number: u64,
        receiver_address: AccountAddress,
        receiver_auth_key_prefix: Vec<u8>,
        num_coins: u64,
        coin_currency: String,
        gas_unit_price: Option<u64>,
        max_gas_amount: Option<u64>,
        gas_currency_code: Option<String>,
    ) -> Result<RawTransaction> {
        let currency_code = from_currency_code_string(&coin_currency)
            .map_err(|_| format_err!("Invalid currency code {} specified", coin_currency))?;
        let program = transaction_builder::encode_transfer_with_metadata_script(
            type_tag_for_currency_code(currency_code),
            &receiver_address,
            receiver_auth_key_prefix,
            num_coins,
            vec![],
            vec![],
        );
        Ok(create_unsigned_txn(
            TransactionPayload::Script(program),
            sender_address,
            sender_sequence_number,
            max_gas_amount.unwrap_or(MAX_GAS_AMOUNT),
            gas_unit_price.unwrap_or(GAS_UNIT_PRICE),
            gas_currency_code.unwrap_or_else(|| LBR_NAME.to_owned()),
            TX_EXPIRATION,
        ))
    }
pub fn prepare_transfer_coins ( & mut self , sender_address : AccountAddress , sender_sequence_number : u64 , receiver_address : AccountAddress , receiver_auth_key_prefix : Vec < u8 > , num_coins : u64 , coin_currency : String , gas_unit_price : Option < u64 > , max_gas_amount : Option < u64 > , gas_currency_code : Option < String > , ) -> Result < RawTransaction > { let currency_code = from_currency_code_string ( & coin_currency ) . map_err ( | _ | format_err ! ( " " coin_currency ) ) ? ; let program = transaction_builder :: encode_transfer_with_metadata_script ( type_tag_for_currency_code ( currency_code ) , & receiver_address , receiver_auth_key_prefix , num_coins , vec ! [ ] , vec ! [ ] , ) ; Ok ( create_unsigned_txn ( TransactionPayload :: Script ( program ) , sender_address , sender_sequence_number , max_gas_amount . unwrap_or ( MAX_GAS_AMOUNT ) , gas_unit_price . unwrap_or ( GAS_UNIT_PRICE ) , gas_currency_code . unwrap_or_else ( | | LBR_NAME . to_owned ( ) ) , TX_EXPIRATION , ) ) }
Prepare a transfer transaction: return the unsigned raw transaction
Prepare a transfer transaction : return the unsigned raw transaction
&mut self
sender_address
AccountAddress
sender_sequence_number
u64
receiver_address
AccountAddress
receiver_auth_key_prefix
Vec<u8>
num_coins
u64
coin_currency
String
gas_unit_price
Option<u64>
max_gas_amount
Option<u64>
gas_currency_code
Option<String>
&mut self
sender_address
AccountAddress
sender_sequence_number
u64
receiver_address
AccountAddress
receiver_auth_key_prefix
Vec<u8>
num_coins
u64
coin_currency
String
gas_unit_price
Option<u64>
max_gas_amount
Option<u64>
gas_currency_code
Option<String>