@chain-registry/utils 1.29.11 → 1.29.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calc.js +2 -2
- package/esm/calc.js +2 -2
- package/package.json +3 -3
package/calc.js
CHANGED
|
@@ -72,7 +72,7 @@ exports.convertBaseUnitToDollarValueByDenom = convertBaseUnitToDollarValueByDeno
|
|
|
72
72
|
const convertDollarValueToBaseUnit = (assets, prices, symbol, value, chainName) => {
|
|
73
73
|
const { denom, exponent } = getAssetInfo(assets, symbol, chainName);
|
|
74
74
|
const baseAmount = new bignumber_js_1.default(value).dividedBy(prices[denom]).toString();
|
|
75
|
-
return
|
|
75
|
+
return shiftDecimalPlaces(baseAmount, exponent);
|
|
76
76
|
};
|
|
77
77
|
exports.convertDollarValueToBaseUnit = convertDollarValueToBaseUnit;
|
|
78
78
|
const convertBaseUnitToDisplayUnit = (assets, symbol, amount, chainName) => {
|
|
@@ -95,6 +95,6 @@ const convertBaseUnitToDisplayUnitByDenom = (assets, denom, amount, chainName) =
|
|
|
95
95
|
exports.convertBaseUnitToDisplayUnitByDenom = convertBaseUnitToDisplayUnitByDenom;
|
|
96
96
|
const convertDisplayUnitToBaseUnit = (assets, symbol, amount, chainName) => {
|
|
97
97
|
const { exponent } = getAssetInfo(assets, symbol, chainName);
|
|
98
|
-
return
|
|
98
|
+
return shiftDecimalPlaces(amount, exponent);
|
|
99
99
|
};
|
|
100
100
|
exports.convertDisplayUnitToBaseUnit = convertDisplayUnitToBaseUnit;
|
package/esm/calc.js
CHANGED
|
@@ -62,7 +62,7 @@ export const convertBaseUnitToDollarValueByDenom = (assets, prices, denom, amoun
|
|
|
62
62
|
export const convertDollarValueToBaseUnit = (assets, prices, symbol, value, chainName) => {
|
|
63
63
|
const { denom, exponent } = getAssetInfo(assets, symbol, chainName);
|
|
64
64
|
const baseAmount = new BigNumber(value).dividedBy(prices[denom]).toString();
|
|
65
|
-
return
|
|
65
|
+
return shiftDecimalPlaces(baseAmount, exponent);
|
|
66
66
|
};
|
|
67
67
|
export const convertBaseUnitToDisplayUnit = (assets, symbol, amount, chainName) => {
|
|
68
68
|
const { exponent } = getAssetInfo(assets, symbol, chainName);
|
|
@@ -82,5 +82,5 @@ export const convertBaseUnitToDisplayUnitByDenom = (assets, denom, amount, chain
|
|
|
82
82
|
};
|
|
83
83
|
export const convertDisplayUnitToBaseUnit = (assets, symbol, amount, chainName) => {
|
|
84
84
|
const { exponent } = getAssetInfo(assets, symbol, chainName);
|
|
85
|
-
return
|
|
85
|
+
return shiftDecimalPlaces(amount, exponent);
|
|
86
86
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chain-registry/utils",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.12",
|
|
4
4
|
"description": "Chain Registry Utils",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/cosmology-tech/chain-registry",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/sha.js": "^2.4.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@chain-registry/types": "^0.28.
|
|
34
|
+
"@chain-registry/types": "^0.28.12",
|
|
35
35
|
"bignumber.js": "9.1.1",
|
|
36
36
|
"sha.js": "^2.4.11"
|
|
37
37
|
},
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"cosmos",
|
|
42
42
|
"interchain"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "75558cf0c1f53dfdc3e492f59595a4efef0b8b72"
|
|
45
45
|
}
|