Skip to content

Commit

Permalink
chore: added available methods to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Jun 11, 2024
1 parent 32cb882 commit 688b0c9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions common/coins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,33 @@ coinsA.equal(coinsB)
coinsA.max(coinsB).toArray()
-> [{"denom": "acoin", amount: "10"}, {"denom": "bcoin", amount: "20"}, {"denom": "ccoin", amount: "30"}]
```

## Available methods

The following methods are available on the Coins class:

- toString() - return coins to string object
- toArray() - return coins in json form with denom and amount
- len() - get the number of coins
- empty() - check if coins are empty
- isZero() - check if all coins have a zero value
- amountOf() - get the amount of a coin
- find() - get the coin by denom
- equal() - assert if to coin sets are equal
- denoms() - get all denoms
- isAnyNegative() - check if any coin is negative
- isAllPositive() - check if all coins are positive
- add() - add two coin sets together
- sub() - subtract two coin sets
- mul() - multiply each coin with a number
- quo() - divide each coin and truncate with a number
- min() - get the minimum amounts of two coin sets
- max() - get the maximum amounts of two coin sets
- isAllGTE() - check if all coins are greater equal
- isAllGT() - check if all coins are greater
- isAllLTE() - check if all coins are less equal
- isAllLT() - check if all coins are less
- isAnyGTE() - check if any coins are greater equal
- isAnyGT() - check if any coins are greater
- isAnyLTE() - check if any coins are less equal
- isAnyLT() - check if any coins are less

0 comments on commit 688b0c9

Please sign in to comment.