@injectivelabs/utils 0.0.59 → 0.0.63
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/dist/numbers.d.ts +1 -0
- package/dist/numbers.d.ts.map +1 -1
- package/dist/numbers.js +119 -27
- package/dist/numbers.js.map +1 -1
- package/package.json +4 -4
package/dist/numbers.d.ts
CHANGED
package/dist/numbers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAIrC,eAAO,MAAM,gCAAgC,WACnC,SAAS,GAAG,MAAM,GAAG,MAAM,KAClC,MAcF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,UACvC,MAAM,GAAG,MAAM,GAAG,SAAS,cAC4B,CAAA;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,UACrC,MAAM,GAAG,MAAM,GAAG,SAAS,cAC+B,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,6BAA6B;WAIjC,MAAM,GAAG,MAAM,GAAG,SAAS;;eAEsC,CAAA;AAE1E;;;GAGG;AACH,eAAO,MAAM,oCAAoC;WAMxC,MAAM,GAAG,MAAM,GAAG,SAAS;;;;YAYnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,+BAA+B;WAInC,MAAM,GAAG,MAAM,GAAG,SAAS;;eAEmC,CAAA;AACvE;;;;GAIG;AACH,eAAO,MAAM,sCAAsC;WAM1C,MAAM,GAAG,MAAM,GAAG,SAAS;;;;YAYnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B;WAIjC,MAAM,G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;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB;WAK3B,MAAM,GAAG,MAAM,GAAG,SAAS;;;eAMjC,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,8BAA8B;WAOlC,MAAM,GAAG,MAAM,GAAG,SAAS;;;;;YAanC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B;WAI/B,MAAM,GAAG,MAAM,GAAG,SAAS;;eAE0C,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,kCAAkC;WAMtC,MAAM,GAAG,MAAM,GAAG,SAAS;;;;YAenC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B;WAIjC,MAAM,GAAG,MAAM,GAAG,SAAS;;eAE0C,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,oCAAoC;WAMxC,MAAM,GAAG,MAAM,GAAG,SAAS;;;;YAenC,CAAA"}
|
package/dist/numbers.js
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.spotQuantityFromChainQuantityToFixed = exports.spotQuantityFromChainQuantity = exports.spotQuantityToChainQuantityToFixed = exports.spotQuantityToChainQuantity = exports.spotPriceFromChainPriceToFixed = exports.spotPriceFromChainPrice = exports.spotPriceToChainPriceToFixed = exports.spotPriceToChainPrice = exports.derivativeQuantityFromChainQuantityToFixed = exports.derivativeQuantityFromChainQuantity = exports.derivativeQuantityToChainQuantityToFixed = exports.derivativeQuantityToChainQuantity = exports.derivativePriceFromChainPriceToFixed = exports.derivativePriceFromChainPrice = exports.derivativePriceToChainPriceToFixed = exports.derivativePriceToChainPrice = exports.derivativeMarginFromChainMarginToFixed = exports.derivativeMarginFromChainMargin = exports.derivativeMarginToChainMarginToFixed = exports.derivativeMarginToChainMargin = exports.denomAmountFromChainDenomAmountToFixed = exports.denomAmountFromChainDenomAmount = exports.denomAmountToChainDenomAmountToFixed = exports.denomAmountToChainDenomAmount = exports.denomAmountToGrpcChainDenomAmount = exports.denomAmountFromGrpcChainDenomAmount = void 0;
|
|
3
|
+
exports.spotQuantityFromChainQuantityToFixed = exports.spotQuantityFromChainQuantity = exports.spotQuantityToChainQuantityToFixed = exports.spotQuantityToChainQuantity = exports.spotPriceFromChainPriceToFixed = exports.spotPriceFromChainPrice = exports.spotPriceToChainPriceToFixed = exports.spotPriceToChainPrice = exports.derivativeQuantityFromChainQuantityToFixed = exports.derivativeQuantityFromChainQuantity = exports.derivativeQuantityToChainQuantityToFixed = exports.derivativeQuantityToChainQuantity = exports.derivativePriceFromChainPriceToFixed = exports.derivativePriceFromChainPrice = exports.derivativePriceToChainPriceToFixed = exports.derivativePriceToChainPrice = exports.derivativeMarginFromChainMarginToFixed = exports.derivativeMarginFromChainMargin = exports.derivativeMarginToChainMarginToFixed = exports.derivativeMarginToChainMargin = exports.denomAmountFromChainDenomAmountToFixed = exports.denomAmountFromChainDenomAmount = exports.denomAmountToChainDenomAmountToFixed = exports.denomAmountToChainDenomAmount = exports.denomAmountToGrpcChainDenomAmount = exports.denomAmountFromGrpcChainDenomAmount = exports.getSignificantDecimalsFromNumber = void 0;
|
|
4
4
|
const classes_1 = require("./classes");
|
|
5
|
+
const $BigNumber = classes_1.BigNumber.clone({ ROUNDING_MODE: classes_1.BigNumber.ROUND_DOWN });
|
|
6
|
+
const getSignificantDecimalsFromNumber = (number) => {
|
|
7
|
+
if (Math.floor(new $BigNumber(number).toNumber()) === number) {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
const parts = new $BigNumber(number).toFixed().split('.');
|
|
11
|
+
const [, decimals] = parts;
|
|
12
|
+
/** Number doesn't have decimals */
|
|
13
|
+
if (!decimals) {
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
return decimals.length;
|
|
17
|
+
};
|
|
18
|
+
exports.getSignificantDecimalsFromNumber = getSignificantDecimalsFromNumber;
|
|
5
19
|
/**
|
|
6
20
|
* On chain amounts queried from a sentry using the
|
|
7
21
|
* gRPC API are returned with an extra decimal point
|
|
8
22
|
* 18 places from the beginning, so we need to remove it
|
|
9
23
|
* to get a workable amount
|
|
10
24
|
*/
|
|
11
|
-
const denomAmountFromGrpcChainDenomAmount = (value) => new
|
|
25
|
+
const denomAmountFromGrpcChainDenomAmount = (value) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(18));
|
|
12
26
|
exports.denomAmountFromGrpcChainDenomAmount = denomAmountFromGrpcChainDenomAmount;
|
|
13
27
|
/**
|
|
14
28
|
* On chain amounts broadcasted to a sentry directly using the
|
|
@@ -16,151 +30,229 @@ exports.denomAmountFromGrpcChainDenomAmount = denomAmountFromGrpcChainDenomAmoun
|
|
|
16
30
|
* 18 places from the beginning, so we need to add it
|
|
17
31
|
* to get a workable amount
|
|
18
32
|
*/
|
|
19
|
-
const denomAmountToGrpcChainDenomAmount = (value) => new
|
|
33
|
+
const denomAmountToGrpcChainDenomAmount = (value) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(18));
|
|
20
34
|
exports.denomAmountToGrpcChainDenomAmount = denomAmountToGrpcChainDenomAmount;
|
|
21
35
|
/**
|
|
22
36
|
* Amount that the chain requires is in the x * 10^(quoteDecimals) format
|
|
23
37
|
* where x is a human readable number
|
|
24
38
|
*/
|
|
25
|
-
const denomAmountToChainDenomAmount = ({ value, decimals = 18, }) => new
|
|
39
|
+
const denomAmountToChainDenomAmount = ({ value, decimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(decimals));
|
|
26
40
|
exports.denomAmountToChainDenomAmount = denomAmountToChainDenomAmount;
|
|
27
41
|
/**
|
|
28
42
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
29
43
|
* where x is a human readable number
|
|
30
44
|
*/
|
|
31
|
-
const denomAmountToChainDenomAmountToFixed = ({ value, decimals = 18, decimalPlaces =
|
|
45
|
+
const denomAmountToChainDenomAmountToFixed = ({ value, decimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
46
|
+
const number = (0, exports.denomAmountToChainDenomAmount)({ value, decimals });
|
|
47
|
+
if (decimalPlaces === undefined) {
|
|
48
|
+
return number.toFixed();
|
|
49
|
+
}
|
|
50
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
51
|
+
};
|
|
32
52
|
exports.denomAmountToChainDenomAmountToFixed = denomAmountToChainDenomAmountToFixed;
|
|
33
53
|
/**
|
|
34
54
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
35
55
|
* where x is a human readable number
|
|
36
56
|
*/
|
|
37
|
-
const denomAmountFromChainDenomAmount = ({ value, decimals = 18, }) => new
|
|
57
|
+
const denomAmountFromChainDenomAmount = ({ value, decimals = 18, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(decimals));
|
|
38
58
|
exports.denomAmountFromChainDenomAmount = denomAmountFromChainDenomAmount;
|
|
39
59
|
/**
|
|
40
60
|
*
|
|
41
61
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
42
62
|
* where x is a human readable number stringified
|
|
43
63
|
*/
|
|
44
|
-
const denomAmountFromChainDenomAmountToFixed = ({ value, decimals = 18, decimalPlaces =
|
|
64
|
+
const denomAmountFromChainDenomAmountToFixed = ({ value, decimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
65
|
+
const number = (0, exports.denomAmountFromChainDenomAmount)({ value, decimals });
|
|
66
|
+
if (decimalPlaces === undefined) {
|
|
67
|
+
return number.toFixed();
|
|
68
|
+
}
|
|
69
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
70
|
+
};
|
|
45
71
|
exports.denomAmountFromChainDenomAmountToFixed = denomAmountFromChainDenomAmountToFixed;
|
|
46
72
|
/**
|
|
47
73
|
* Amount that the chain requires is in the x * 10^(quoteDecimals) format
|
|
48
74
|
* where x is a human readable number
|
|
49
75
|
*/
|
|
50
|
-
const derivativeMarginToChainMargin = ({ value, quoteDecimals = 18, }) => new
|
|
76
|
+
const derivativeMarginToChainMargin = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(quoteDecimals));
|
|
51
77
|
exports.derivativeMarginToChainMargin = derivativeMarginToChainMargin;
|
|
52
78
|
/**
|
|
53
79
|
* Amount that the chain requires is in the x * 10^(quoteDecimals) format
|
|
54
80
|
* where x is a human readable number stringified
|
|
55
81
|
*/
|
|
56
|
-
const derivativeMarginToChainMarginToFixed = ({ value, quoteDecimals = 18, decimalPlaces =
|
|
82
|
+
const derivativeMarginToChainMarginToFixed = ({ value, quoteDecimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
83
|
+
const number = (0, exports.derivativeMarginToChainMargin)({ value, quoteDecimals });
|
|
84
|
+
if (decimalPlaces === undefined) {
|
|
85
|
+
return number.toFixed();
|
|
86
|
+
}
|
|
87
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
88
|
+
};
|
|
57
89
|
exports.derivativeMarginToChainMarginToFixed = derivativeMarginToChainMarginToFixed;
|
|
58
90
|
/**
|
|
59
91
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
60
92
|
* where x is a human readable number
|
|
61
93
|
*/
|
|
62
|
-
const derivativeMarginFromChainMargin = ({ value, quoteDecimals = 18, }) => new
|
|
94
|
+
const derivativeMarginFromChainMargin = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(quoteDecimals));
|
|
63
95
|
exports.derivativeMarginFromChainMargin = derivativeMarginFromChainMargin;
|
|
64
96
|
/**
|
|
65
97
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
66
98
|
* where x is a human readable number
|
|
67
99
|
*/
|
|
68
|
-
const derivativeMarginFromChainMarginToFixed = ({ value, quoteDecimals = 18, decimalPlaces =
|
|
100
|
+
const derivativeMarginFromChainMarginToFixed = ({ value, quoteDecimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
101
|
+
const number = (0, exports.derivativeMarginFromChainMargin)({ value, quoteDecimals });
|
|
102
|
+
if (decimalPlaces === undefined) {
|
|
103
|
+
return number.toFixed();
|
|
104
|
+
}
|
|
105
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
106
|
+
};
|
|
69
107
|
exports.derivativeMarginFromChainMarginToFixed = derivativeMarginFromChainMarginToFixed;
|
|
70
108
|
/**
|
|
71
109
|
* Amount that the chain requires is in the x * 10^(quoteDecimals) format
|
|
72
110
|
* where x is a human readable number
|
|
73
111
|
*/
|
|
74
|
-
const derivativePriceToChainPrice = ({ value, quoteDecimals = 18, }) => new
|
|
112
|
+
const derivativePriceToChainPrice = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(quoteDecimals));
|
|
75
113
|
exports.derivativePriceToChainPrice = derivativePriceToChainPrice;
|
|
76
114
|
/**
|
|
77
115
|
* Amount that the chain requires is in the x * 10^(quoteDecimals) format
|
|
78
116
|
* where x is a human readable number stringified
|
|
79
117
|
*/
|
|
80
|
-
const derivativePriceToChainPriceToFixed = ({ value, quoteDecimals = 18, decimalPlaces =
|
|
118
|
+
const derivativePriceToChainPriceToFixed = ({ value, quoteDecimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
119
|
+
const number = (0, exports.derivativePriceToChainPrice)({ value, quoteDecimals });
|
|
120
|
+
if (decimalPlaces === undefined) {
|
|
121
|
+
return number.toFixed();
|
|
122
|
+
}
|
|
123
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
124
|
+
};
|
|
81
125
|
exports.derivativePriceToChainPriceToFixed = derivativePriceToChainPriceToFixed;
|
|
82
126
|
/**
|
|
83
127
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
84
128
|
* where x is a human readable number
|
|
85
129
|
*/
|
|
86
|
-
const derivativePriceFromChainPrice = ({ value, quoteDecimals = 18, }) => new
|
|
130
|
+
const derivativePriceFromChainPrice = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(quoteDecimals));
|
|
87
131
|
exports.derivativePriceFromChainPrice = derivativePriceFromChainPrice;
|
|
88
132
|
/**
|
|
89
133
|
* Amount that the chain returns is in the x * 10^(quoteDecimals) format
|
|
90
134
|
* where x is a human readable number stringified
|
|
91
135
|
*/
|
|
92
|
-
const derivativePriceFromChainPriceToFixed = ({ value, quoteDecimals = 18, decimalPlaces =
|
|
136
|
+
const derivativePriceFromChainPriceToFixed = ({ value, quoteDecimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
137
|
+
const number = (0, exports.derivativePriceFromChainPrice)({ value, quoteDecimals });
|
|
138
|
+
if (decimalPlaces === undefined) {
|
|
139
|
+
return number.toFixed();
|
|
140
|
+
}
|
|
141
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
142
|
+
};
|
|
93
143
|
exports.derivativePriceFromChainPriceToFixed = derivativePriceFromChainPriceToFixed;
|
|
94
144
|
/**
|
|
95
145
|
* Amount that the chain requires is in the x format
|
|
96
146
|
* where x is a human readable number
|
|
97
147
|
*/
|
|
98
|
-
const derivativeQuantityToChainQuantity = ({ value, }) => new
|
|
148
|
+
const derivativeQuantityToChainQuantity = ({ value, }) => new $BigNumber(value);
|
|
99
149
|
exports.derivativeQuantityToChainQuantity = derivativeQuantityToChainQuantity;
|
|
100
150
|
/**
|
|
101
151
|
* Amount that the chain requires is in the x format
|
|
102
152
|
* where x is a human readable number stringified
|
|
103
153
|
*/
|
|
104
|
-
const derivativeQuantityToChainQuantityToFixed = ({ value, decimalPlaces =
|
|
154
|
+
const derivativeQuantityToChainQuantityToFixed = ({ value, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
155
|
+
const number = (0, exports.derivativeQuantityToChainQuantity)({ value });
|
|
156
|
+
if (decimalPlaces === undefined) {
|
|
157
|
+
return number.toFixed();
|
|
158
|
+
}
|
|
159
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
160
|
+
};
|
|
105
161
|
exports.derivativeQuantityToChainQuantityToFixed = derivativeQuantityToChainQuantityToFixed;
|
|
106
162
|
/**
|
|
107
163
|
* Amount that the chain requires is in the x format
|
|
108
164
|
* where x is a human readable number
|
|
109
165
|
*/
|
|
110
|
-
const derivativeQuantityFromChainQuantity = ({ value, }) => new
|
|
166
|
+
const derivativeQuantityFromChainQuantity = ({ value, }) => new $BigNumber(value);
|
|
111
167
|
exports.derivativeQuantityFromChainQuantity = derivativeQuantityFromChainQuantity;
|
|
112
168
|
/**
|
|
113
169
|
* Amount that the chain requires is in the x format
|
|
114
170
|
* where x is a human readable number stringified
|
|
115
171
|
*/
|
|
116
|
-
const derivativeQuantityFromChainQuantityToFixed = ({ value, decimalPlaces =
|
|
172
|
+
const derivativeQuantityFromChainQuantityToFixed = ({ value, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
173
|
+
const number = (0, exports.derivativeQuantityFromChainQuantity)({ value });
|
|
174
|
+
if (decimalPlaces === undefined) {
|
|
175
|
+
return number.toFixed();
|
|
176
|
+
}
|
|
177
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
178
|
+
};
|
|
117
179
|
exports.derivativeQuantityFromChainQuantityToFixed = derivativeQuantityFromChainQuantityToFixed;
|
|
118
180
|
/**
|
|
119
181
|
* Amount that the chain requires is in the x / 10^(quoteDecimals - baseDecimals) format
|
|
120
182
|
* where x is a human readable number
|
|
121
183
|
*/
|
|
122
|
-
const spotPriceToChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new
|
|
184
|
+
const spotPriceToChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(new $BigNumber(quoteDecimals).minus(baseDecimals)));
|
|
123
185
|
exports.spotPriceToChainPrice = spotPriceToChainPrice;
|
|
124
186
|
/**
|
|
125
187
|
* Amount that the chain requires is in the x / 10^(quoteDecimals - baseDecimals) format
|
|
126
188
|
* where x is a human readable number stringified
|
|
127
189
|
*/
|
|
128
|
-
const spotPriceToChainPriceToFixed = ({ value, baseDecimals = 18, quoteDecimals = 6, decimalPlaces =
|
|
190
|
+
const spotPriceToChainPriceToFixed = ({ value, baseDecimals = 18, quoteDecimals = 6, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
191
|
+
const number = (0, exports.spotPriceToChainPrice)({ value, baseDecimals, quoteDecimals });
|
|
192
|
+
if (decimalPlaces === undefined) {
|
|
193
|
+
return number.toFixed();
|
|
194
|
+
}
|
|
195
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
196
|
+
};
|
|
129
197
|
exports.spotPriceToChainPriceToFixed = spotPriceToChainPriceToFixed;
|
|
130
198
|
/**
|
|
131
199
|
* Amount that the chain returns is in the x / 10^(quoteDecimals - baseDecimals) format
|
|
132
200
|
* where x is a human readable number
|
|
133
201
|
*/
|
|
134
|
-
const spotPriceFromChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new
|
|
202
|
+
const spotPriceFromChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(new $BigNumber(quoteDecimals).minus(baseDecimals)));
|
|
135
203
|
exports.spotPriceFromChainPrice = spotPriceFromChainPrice;
|
|
136
204
|
/**
|
|
137
205
|
* Amount that the chain returns is in the x / 10^(quoteDecimals - baseDecimals) format
|
|
138
206
|
* where x is a human readable number stringified
|
|
139
207
|
*/
|
|
140
|
-
const spotPriceFromChainPriceToFixed = ({ value, baseDecimals = 18, quoteDecimals = 6, decimalPlaces =
|
|
208
|
+
const spotPriceFromChainPriceToFixed = ({ value, baseDecimals = 18, quoteDecimals = 6, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
209
|
+
const number = (0, exports.spotPriceFromChainPrice)({ value, baseDecimals, quoteDecimals });
|
|
210
|
+
if (decimalPlaces === undefined) {
|
|
211
|
+
return number.toFixed();
|
|
212
|
+
}
|
|
213
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
214
|
+
};
|
|
141
215
|
exports.spotPriceFromChainPriceToFixed = spotPriceFromChainPriceToFixed;
|
|
142
216
|
/**
|
|
143
217
|
* Amount that the chain requires is in the x * 10^(baseDecimals) format
|
|
144
218
|
* where x is a human readable number
|
|
145
219
|
*/
|
|
146
|
-
const spotQuantityToChainQuantity = ({ value, baseDecimals = 18, }) => new
|
|
220
|
+
const spotQuantityToChainQuantity = ({ value, baseDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(baseDecimals));
|
|
147
221
|
exports.spotQuantityToChainQuantity = spotQuantityToChainQuantity;
|
|
148
222
|
/**
|
|
149
223
|
* Amount that the chain requires is in the x * 10^(baseDecimals) format
|
|
150
224
|
* where x is a human readable number
|
|
151
225
|
*/
|
|
152
|
-
const spotQuantityToChainQuantityToFixed = ({ value, baseDecimals = 18, decimalPlaces =
|
|
226
|
+
const spotQuantityToChainQuantityToFixed = ({ value, baseDecimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
227
|
+
const number = (0, exports.spotQuantityToChainQuantity)({
|
|
228
|
+
value,
|
|
229
|
+
baseDecimals,
|
|
230
|
+
});
|
|
231
|
+
if (decimalPlaces === undefined) {
|
|
232
|
+
return number.toFixed();
|
|
233
|
+
}
|
|
234
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
235
|
+
};
|
|
153
236
|
exports.spotQuantityToChainQuantityToFixed = spotQuantityToChainQuantityToFixed;
|
|
154
237
|
/**
|
|
155
238
|
* Amount that the chain returns is in the x * 10^(baseDecimals) format
|
|
156
239
|
* where x is a human readable number
|
|
157
240
|
*/
|
|
158
|
-
const spotQuantityFromChainQuantity = ({ value, baseDecimals = 18, }) => new
|
|
241
|
+
const spotQuantityFromChainQuantity = ({ value, baseDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(baseDecimals));
|
|
159
242
|
exports.spotQuantityFromChainQuantity = spotQuantityFromChainQuantity;
|
|
160
243
|
/**
|
|
161
244
|
* Amount that the chain returns is in the x * 10^(baseDecimals) format
|
|
162
245
|
* where x is a human readable number
|
|
163
246
|
*/
|
|
164
|
-
const spotQuantityFromChainQuantityToFixed = ({ value, baseDecimals = 18, decimalPlaces =
|
|
247
|
+
const spotQuantityFromChainQuantityToFixed = ({ value, baseDecimals = 18, decimalPlaces = undefined, roundingMode = classes_1.BigNumber.ROUND_DOWN, }) => {
|
|
248
|
+
const number = (0, exports.spotQuantityFromChainQuantity)({
|
|
249
|
+
value,
|
|
250
|
+
baseDecimals,
|
|
251
|
+
});
|
|
252
|
+
if (decimalPlaces === undefined) {
|
|
253
|
+
return number.toFixed();
|
|
254
|
+
}
|
|
255
|
+
return number.toFixed((0, exports.getSignificantDecimalsFromNumber)(number), roundingMode);
|
|
256
|
+
};
|
|
165
257
|
exports.spotQuantityFromChainQuantityToFixed = spotQuantityFromChainQuantityToFixed;
|
|
166
258
|
//# sourceMappingURL=numbers.js.map
|
package/dist/numbers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../src/numbers.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAErC;;;;;GAKG;AACI,MAAM,mCAAmC,GAAG,CACjD,KAAkC,EAClC,EAAE,CAAC,IAAI,
|
|
1
|
+
{"version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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/utils",
|
|
3
3
|
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.63",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"start": "node dist/index.js"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@injectivelabs/exceptions": "^0.0.
|
|
31
|
-
"@injectivelabs/ts-types": "^0.0.
|
|
30
|
+
"@injectivelabs/exceptions": "^0.0.45",
|
|
31
|
+
"@injectivelabs/ts-types": "^0.0.40",
|
|
32
32
|
"axios": "^0.21.1",
|
|
33
33
|
"bignumber.js": "^9.0.1",
|
|
34
34
|
"link-module-alias": "^1.2.0",
|
|
35
35
|
"shx": "^0.3.2",
|
|
36
36
|
"store2": "^2.12.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "787ad83e119ad03f33489a2cfc35d41259993425"
|
|
39
39
|
}
|