@coinify/currency
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "@coinify/currency", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Helper functions for managing amounts in different currencies", | ||
@@ -32,3 +32,3 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"@coinify/eslint-config-coinify": "^1.1.5", | ||
"@coinify/eslint-config-coinify": "^1.1.7", | ||
"chai": "^4.1.2", | ||
@@ -35,0 +35,0 @@ "eslint": "^4.11.0", |
# node-currency | ||
[![npm version](https://badge.fury.io/js/%40coinify%2Fcurrency.svg)](https://badge.fury.io/js/%40coinify%2Fcurrency) | ||
## Installation | ||
@@ -4,0 +6,0 @@ |
@@ -9,6 +9,15 @@ const CURRENCIES_NOT_DIVIDED_IN_HUNDREDS = { | ||
TND: 3, | ||
BTC: 8 | ||
BTC: 8, | ||
ETH: 12 // We use Mwei as lowest subunit for ether because wei (18 decimals) is too much for integer | ||
}; | ||
/** | ||
* Array of supported crypto currencies | ||
* | ||
* @type {array} | ||
*/ | ||
const CRYPTO_CURRENCIES = [ 'BTC', 'ETH' ]; | ||
/** | ||
* Object of all fiat currencies along with their English name | ||
@@ -183,3 +192,3 @@ * | ||
CURRENCIES_NOT_DIVIDED_IN_HUNDREDS, | ||
FIAT_CURRENCIES | ||
}; | ||
FIAT_CURRENCIES, CRYPTO_CURRENCIES | ||
}; |
@@ -143,3 +143,3 @@ const _ = require('lodash'); | ||
function isValidCryptoCurrency(code) { | ||
return code === 'BTC'; | ||
return constants.CRYPTO_CURRENCIES.includes(code); | ||
} | ||
@@ -146,0 +146,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
327
44
12821
6