Function ergo_lib::wallet::box_selector::subtract_tokens
source · pub fn subtract_tokens(
tokens1: &HashMap<TokenId, TokenAmount>,
tokens2: &HashMap<TokenId, TokenAmount>
) -> Result<HashMap<TokenId, TokenAmount>, TokenAmountError>
Expand description
Subtract tokens2 from tokens1 subtracting amounts of the same token or removing the token if amount is the same Returns an error if trying to subtract more tokens than there are in tokens1