Skip to content

Commit

Permalink
Merge pull request #58 from ElrondNetwork/add-balance-times-div
Browse files Browse the repository at this point in the history
Add times and div for balances
  • Loading branch information
ccorcoveanu authored Aug 23, 2021
2 parents 0dd8dc7 + d4a2d7e commit 1ec3395
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ export class Balance {
return new Balance(this.token, this.nonce, this.value.minus(other.value));
}

times(n: BigNumber.Value) {
return new Balance(this.token, this.nonce, this.value.times(n));
}

div(n: BigNumber.Value) {
return new Balance(this.token, this.nonce, this.value.div(n));
}

isEqualTo(other: Balance) {
this.checkSameToken(other);
return this.value.isEqualTo(other.value);
Expand Down

0 comments on commit 1ec3395

Please sign in to comment.