fn internal_direct_actions(
        &mut self,
        token_in: AccountId,
        amount_in: Balance,
        referral_id: Option<AccountId>,
        actions: &[Action],
    ) -> Vec<(AccountId, Balance)> {

        // let @ be the virtual account
        let mut account: Account = Account::new(&String::from(VIRTUAL_ACC));

        account.deposit(&token_in, amount_in);
        let _ = self.internal_execute_actions(
            &mut account,
            &referral_id,
            &actions,
            ActionResult::Amount(U128(amount_in)),
        );

        let mut result = vec![];
        for (token, amount) in account.tokens.to_vec() {
            if amount > 0 {
                result.push((token.clone(), amount));
            }
        }
        account.tokens.clear();

        result
    }
/// Executes set of actions on virtual account.
/// Returns amounts to send to the sender directly.
Executes set of actions on virtual account.
Returns amounts to send to the sender directly.
Executes set of actions on virtual account . Returns amounts to send to the sender directly .
fn internal_direct_actions(
        &mut self,
        token_in: AccountId,
        amount_in: Balance,
        referral_id: Option<AccountId>,
        actions: &[Action],
    ) -> Vec<(AccountId, Balance)> {
        // let @ be the virtual account
        let mut account: Account = Account::new(&String::from(VIRTUAL_ACC));
        account.deposit(&token_in, amount_in);
        let _ = self.internal_execute_actions(
            &mut account,
            &referral_id,
            &actions,
            ActionResult::Amount(U128(amount_in)),
        );
        let mut result = vec![];
        for (token, amount) in account.tokens.to_vec() {
            if amount > 0 {
                result.push((token.clone(), amount));
            }
        }
        account.tokens.clear();
        result
    }
fn internal_direct_actions ( & mut self , token_in : AccountId , amount_in : Balance , referral_id : Option < AccountId > , actions : & [ Action ] , ) -> Vec < ( AccountId , Balance ) > { // let @ be the virtual account let mut account : Account = Account :: new ( & String :: from ( VIRTUAL_ACC ) ) ; account . deposit ( & token_in , amount_in ) ; let _ = self . internal_execute_actions ( & mut account , & referral_id , & actions , ActionResult :: Amount ( U128 ( amount_in ) ) , ) ; let mut result = vec ! [ ] ; for ( token , amount ) in account . tokens . to_vec ( ) { if amount > 0 { result . push ( ( token . clone ( ) , amount ) ) ; } } account . tokens . clear ( ) ; result }
Executes set of actions on virtual account.
Executes set of actions on virtual account .
&mut self
token_in
AccountId
amount_in
Balance
referral_id
Option<AccountId>
actions
&[Action]
&mut self
token_in
AccountId
amount_in
Balance
referral_id
Option<AccountId>
actions
&[Action]