deduct_balance

function deduct_balance(account: account, asset: asset, amount: big_integer): big_integer(source)

Removes a certain amount of money from an account. It does NOT update total supply, extra care is needed to either decrease it or add the assets to another account.

Only supposed to be called internally, use functions like burn or transfer whenever possible.

Throws "INSUFFICIENT BALANCE" if the amount to be removed is higher than the amount the account holds, or if there's no balance connected to the account and asset given, which means the account has 0 of this asset.

Can only be called from an operation.

Return

the final balance of the account

Parameters

account

the account from which the amount is to be removed

asset

the asset to remove from the account

amount

the amount to remove