Skip to content

Subtracts the balanceToRemove from the existing balances. Returns a new BalanceArray.

subtractBalance<T>(balances, balanceToRemove, allowUnderflow?): BalanceArray<T>

Defined in: packages/bitbadgesjs-sdk/src/core/balances.ts:397

Subtracts the balanceToRemove from the existing balances. Returns a new BalanceArray.

Throws an error if the balances underflow.

Type Parameters

T

T extends NumberType

Parameters

balances

iBalance<T>[]

balanceToRemove

iBalance<T>

allowUnderflow?

boolean

Returns

BalanceArray<T>

Remarks

Can also be used via the corresponding method with same name on BalanceArray

Edit this page on GitHub