Feature/validator client rc3 (#552)

* Bumped the version number

* Additional currency helper
This commit is contained in:
Jędrzej Stuczyński
2021-03-31 09:58:57 +01:00
committed by Dave
parent 2be0ab6474
commit 087efbe553
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@nymproject/nym-validator-client",
"version": "0.10.0-rc2",
"version": "0.10.0-rc3",
"description": "A TypeScript client for interacting with smart contracts in Nym validators",
"repository": "https://github.com/nymtech/nym",
"main": "./dist/index.js",
+9
View File
@@ -21,6 +21,15 @@ export function printableBalance(balance?: readonly Coin[]): string {
return balance.map(printableCoin).join(", ");
}
// converts display amount, such as "12.0346" to its native token representation,
// with 6 fractional digits. So in that case it would result in "12034600"
// Basically does the same job as `displayAmountToNative` but without the requirement
// of having the coinMap
export function printableBalanceToNative(amountToDisplay: string): string {
const decimalAmount = Decimal.fromUserInput(amountToDisplay, 6);
return decimalAmount.atomics;
}
export interface MappedCoin {
readonly denom: string;
readonly fractionalDigits: number;