@injectivelabs/utils 0.0.56 → 0.0.60

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BigNumber } from './classes';
2
+ export declare const getSignificantDecimalsFromNumber: (number: BigNumber | number | string) => number;
2
3
  /**
3
4
  * On chain amounts queried from a sentry using the
4
5
  * gRPC API are returned with an extra decimal point
@@ -6,6 +7,13 @@ import { BigNumber } from './classes';
6
7
  * to get a workable amount
7
8
  */
8
9
  export declare const denomAmountFromGrpcChainDenomAmount: (value: string | number | BigNumber) => BigNumber;
10
+ /**
11
+ * On chain amounts broadcasted to a sentry directly using the
12
+ * gRPC API should be passed with an extra decimal point
13
+ * 18 places from the beginning, so we need to add it
14
+ * to get a workable amount
15
+ */
16
+ export declare const denomAmountToGrpcChainDenomAmount: (value: string | number | BigNumber) => BigNumber;
9
17
  /**
10
18
  * Amount that the chain requires is in the x * 10^(quoteDecimals) format
11
19
  * where x is a human readable number
@@ -14,6 +22,16 @@ export declare const denomAmountToChainDenomAmount: ({ value, decimals, }: {
14
22
  value: number | string | BigNumber;
15
23
  decimals?: string | number | undefined;
16
24
  }) => BigNumber;
25
+ /**
26
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
27
+ * where x is a human readable number
28
+ */
29
+ export declare const denomAmountToChainDenomAmountToFixed: ({ value, decimals, decimalPlaces, roundingMode, }: {
30
+ value: number | string | BigNumber;
31
+ decimals?: string | number | undefined;
32
+ decimalPlaces?: number | undefined;
33
+ roundingMode?: BigNumber.RoundingMode | undefined;
34
+ }) => string;
17
35
  /**
18
36
  * Amount that the chain returns is in the x * 10^(quoteDecimals) format
19
37
  * where x is a human readable number
@@ -22,6 +40,17 @@ export declare const denomAmountFromChainDenomAmount: ({ value, decimals, }: {
22
40
  value: number | string | BigNumber;
23
41
  decimals?: string | number | undefined;
24
42
  }) => BigNumber;
43
+ /**
44
+ *
45
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
46
+ * where x is a human readable number stringified
47
+ */
48
+ export declare const denomAmountFromChainDenomAmountToFixed: ({ value, decimals, decimalPlaces, roundingMode, }: {
49
+ value: number | string | BigNumber;
50
+ decimals?: string | number | undefined;
51
+ decimalPlaces?: number | undefined;
52
+ roundingMode?: BigNumber.RoundingMode | undefined;
53
+ }) => string;
25
54
  /**
26
55
  * Amount that the chain requires is in the x * 10^(quoteDecimals) format
27
56
  * where x is a human readable number
@@ -30,6 +59,16 @@ export declare const derivativeMarginToChainMargin: ({ value, quoteDecimals, }:
30
59
  value: number | string | BigNumber;
31
60
  quoteDecimals?: string | number | undefined;
32
61
  }) => BigNumber;
62
+ /**
63
+ * Amount that the chain requires is in the x * 10^(quoteDecimals) format
64
+ * where x is a human readable number stringified
65
+ */
66
+ export declare const derivativeMarginToChainMarginToFixed: ({ value, quoteDecimals, decimalPlaces, roundingMode, }: {
67
+ decimalPlaces?: number | undefined;
68
+ roundingMode?: BigNumber.RoundingMode | undefined;
69
+ value: number | string | BigNumber;
70
+ quoteDecimals?: string | number | undefined;
71
+ }) => string;
33
72
  /**
34
73
  * Amount that the chain returns is in the x * 10^(quoteDecimals) format
35
74
  * where x is a human readable number
@@ -38,6 +77,16 @@ export declare const derivativeMarginFromChainMargin: ({ value, quoteDecimals, }
38
77
  value: number | string | BigNumber;
39
78
  quoteDecimals?: string | number | undefined;
40
79
  }) => BigNumber;
80
+ /**
81
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
82
+ * where x is a human readable number
83
+ */
84
+ export declare const derivativeMarginFromChainMarginToFixed: ({ value, quoteDecimals, decimalPlaces, roundingMode, }: {
85
+ value: number | string | BigNumber;
86
+ quoteDecimals?: string | number | undefined;
87
+ decimalPlaces?: number | undefined;
88
+ roundingMode?: BigNumber.RoundingMode | undefined;
89
+ }) => string;
41
90
  /**
42
91
  * Amount that the chain requires is in the x * 10^(quoteDecimals) format
43
92
  * where x is a human readable number
@@ -46,6 +95,16 @@ export declare const derivativePriceToChainPrice: ({ value, quoteDecimals, }: {
46
95
  value: number | string | BigNumber;
47
96
  quoteDecimals?: string | number | undefined;
48
97
  }) => BigNumber;
98
+ /**
99
+ * Amount that the chain requires is in the x * 10^(quoteDecimals) format
100
+ * where x is a human readable number stringified
101
+ */
102
+ export declare const derivativePriceToChainPriceToFixed: ({ value, quoteDecimals, decimalPlaces, roundingMode, }: {
103
+ value: number | string | BigNumber;
104
+ quoteDecimals?: string | number | undefined;
105
+ decimalPlaces?: number | undefined;
106
+ roundingMode?: BigNumber.RoundingMode | undefined;
107
+ }) => string;
49
108
  /**
50
109
  * Amount that the chain returns is in the x * 10^(quoteDecimals) format
51
110
  * where x is a human readable number
@@ -54,11 +113,48 @@ export declare const derivativePriceFromChainPrice: ({ value, quoteDecimals, }:
54
113
  value: number | string | BigNumber;
55
114
  quoteDecimals?: string | number | undefined;
56
115
  }) => BigNumber;
116
+ /**
117
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
118
+ * where x is a human readable number stringified
119
+ */
120
+ export declare const derivativePriceFromChainPriceToFixed: ({ value, quoteDecimals, decimalPlaces, roundingMode, }: {
121
+ value: number | string | BigNumber;
122
+ quoteDecimals?: string | number | undefined;
123
+ decimalPlaces?: number | undefined;
124
+ roundingMode?: BigNumber.RoundingMode | undefined;
125
+ }) => string;
57
126
  /**
58
127
  * Amount that the chain requires is in the x format
59
128
  * where x is a human readable number
60
129
  */
61
- export declare const derivativeQuantityToChainQuantity: (value: number | string | BigNumber) => BigNumber;
130
+ export declare const derivativeQuantityToChainQuantity: ({ value, }: {
131
+ value: number | string | BigNumber;
132
+ }) => BigNumber;
133
+ /**
134
+ * Amount that the chain requires is in the x format
135
+ * where x is a human readable number stringified
136
+ */
137
+ export declare const derivativeQuantityToChainQuantityToFixed: ({ value, decimalPlaces, roundingMode, }: {
138
+ value: number | string | BigNumber;
139
+ decimalPlaces?: number | undefined;
140
+ roundingMode?: BigNumber.RoundingMode | undefined;
141
+ }) => string;
142
+ /**
143
+ * Amount that the chain requires is in the x format
144
+ * where x is a human readable number
145
+ */
146
+ export declare const derivativeQuantityFromChainQuantity: ({ value, }: {
147
+ value: number | string | BigNumber;
148
+ }) => BigNumber;
149
+ /**
150
+ * Amount that the chain requires is in the x format
151
+ * where x is a human readable number stringified
152
+ */
153
+ export declare const derivativeQuantityFromChainQuantityToFixed: ({ value, decimalPlaces, roundingMode, }: {
154
+ value: number | string | BigNumber;
155
+ decimalPlaces?: number | undefined;
156
+ roundingMode?: BigNumber.RoundingMode | undefined;
157
+ }) => string;
62
158
  /**
63
159
  * Amount that the chain requires is in the x / 10^(quoteDecimals - baseDecimals) format
64
160
  * where x is a human readable number
@@ -68,6 +164,17 @@ export declare const spotPriceToChainPrice: ({ value, baseDecimals, quoteDecimal
68
164
  quoteDecimals?: string | number | undefined;
69
165
  baseDecimals?: string | number | undefined;
70
166
  }) => BigNumber;
167
+ /**
168
+ * Amount that the chain requires is in the x / 10^(quoteDecimals - baseDecimals) format
169
+ * where x is a human readable number stringified
170
+ */
171
+ export declare const spotPriceToChainPriceToFixed: ({ value, baseDecimals, quoteDecimals, decimalPlaces, roundingMode, }: {
172
+ value: number | string | BigNumber;
173
+ quoteDecimals?: string | number | undefined;
174
+ baseDecimals?: string | number | undefined;
175
+ decimalPlaces?: number | undefined;
176
+ roundingMode?: BigNumber.RoundingMode | undefined;
177
+ }) => string;
71
178
  /**
72
179
  * Amount that the chain returns is in the x / 10^(quoteDecimals - baseDecimals) format
73
180
  * where x is a human readable number
@@ -77,6 +184,17 @@ export declare const spotPriceFromChainPrice: ({ value, baseDecimals, quoteDecim
77
184
  quoteDecimals?: string | number | undefined;
78
185
  baseDecimals?: string | number | undefined;
79
186
  }) => BigNumber;
187
+ /**
188
+ * Amount that the chain returns is in the x / 10^(quoteDecimals - baseDecimals) format
189
+ * where x is a human readable number stringified
190
+ */
191
+ export declare const spotPriceFromChainPriceToFixed: ({ value, baseDecimals, quoteDecimals, decimalPlaces, roundingMode, }: {
192
+ value: number | string | BigNumber;
193
+ quoteDecimals?: string | number | undefined;
194
+ baseDecimals?: string | number | undefined;
195
+ decimalPlaces?: number | undefined;
196
+ roundingMode?: BigNumber.RoundingMode | undefined;
197
+ }) => string;
80
198
  /**
81
199
  * Amount that the chain requires is in the x * 10^(baseDecimals) format
82
200
  * where x is a human readable number
@@ -85,6 +203,16 @@ export declare const spotQuantityToChainQuantity: ({ value, baseDecimals, }: {
85
203
  value: number | string | BigNumber;
86
204
  baseDecimals?: string | number | undefined;
87
205
  }) => BigNumber;
206
+ /**
207
+ * Amount that the chain requires is in the x * 10^(baseDecimals) format
208
+ * where x is a human readable number
209
+ */
210
+ export declare const spotQuantityToChainQuantityToFixed: ({ value, baseDecimals, decimalPlaces, roundingMode, }: {
211
+ value: number | string | BigNumber;
212
+ baseDecimals?: string | number | undefined;
213
+ decimalPlaces?: number | undefined;
214
+ roundingMode?: BigNumber.RoundingMode | undefined;
215
+ }) => string;
88
216
  /**
89
217
  * Amount that the chain returns is in the x * 10^(baseDecimals) format
90
218
  * where x is a human readable number
@@ -93,4 +221,14 @@ export declare const spotQuantityFromChainQuantity: ({ value, baseDecimals, }: {
93
221
  value: number | string | BigNumber;
94
222
  baseDecimals?: string | number | undefined;
95
223
  }) => BigNumber;
224
+ /**
225
+ * Amount that the chain returns is in the x * 10^(baseDecimals) format
226
+ * where x is a human readable number
227
+ */
228
+ export declare const spotQuantityFromChainQuantityToFixed: ({ value, baseDecimals, decimalPlaces, roundingMode, }: {
229
+ value: number | string | BigNumber;
230
+ baseDecimals?: string | number | undefined;
231
+ decimalPlaces?: number | undefined;
232
+ roundingMode?: BigNumber.RoundingMode | undefined;
233
+ }) => string;
96
234
  //# sourceMappingURL=numbers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC;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dist/numbers.js CHANGED
@@ -1,79 +1,258 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spotQuantityFromChainQuantity = exports.spotQuantityToChainQuantity = exports.spotPriceFromChainPrice = exports.spotPriceToChainPrice = exports.derivativeQuantityToChainQuantity = exports.derivativePriceFromChainPrice = exports.derivativePriceToChainPrice = exports.derivativeMarginFromChainMargin = exports.derivativeMarginToChainMargin = exports.denomAmountFromChainDenomAmount = exports.denomAmountToChainDenomAmount = 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 classes_1.BigNumber(value).dividedBy(new classes_1.BigNumber(10).pow(18));
25
+ const denomAmountFromGrpcChainDenomAmount = (value) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(18));
12
26
  exports.denomAmountFromGrpcChainDenomAmount = denomAmountFromGrpcChainDenomAmount;
27
+ /**
28
+ * On chain amounts broadcasted to a sentry directly using the
29
+ * gRPC API should be passed with an extra decimal point
30
+ * 18 places from the beginning, so we need to add it
31
+ * to get a workable amount
32
+ */
33
+ const denomAmountToGrpcChainDenomAmount = (value) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(18));
34
+ exports.denomAmountToGrpcChainDenomAmount = denomAmountToGrpcChainDenomAmount;
13
35
  /**
14
36
  * Amount that the chain requires is in the x * 10^(quoteDecimals) format
15
37
  * where x is a human readable number
16
38
  */
17
- const denomAmountToChainDenomAmount = ({ value, decimals = 18, }) => new classes_1.BigNumber(value).multipliedBy(new classes_1.BigNumber(10).pow(decimals));
39
+ const denomAmountToChainDenomAmount = ({ value, decimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(decimals));
18
40
  exports.denomAmountToChainDenomAmount = denomAmountToChainDenomAmount;
19
41
  /**
20
42
  * Amount that the chain returns is in the x * 10^(quoteDecimals) format
21
43
  * where x is a human readable number
22
44
  */
23
- const denomAmountFromChainDenomAmount = ({ value, decimals = 18, }) => new classes_1.BigNumber(value).dividedBy(new classes_1.BigNumber(10).pow(decimals));
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
+ };
52
+ exports.denomAmountToChainDenomAmountToFixed = denomAmountToChainDenomAmountToFixed;
53
+ /**
54
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
55
+ * where x is a human readable number
56
+ */
57
+ const denomAmountFromChainDenomAmount = ({ value, decimals = 18, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(decimals));
24
58
  exports.denomAmountFromChainDenomAmount = denomAmountFromChainDenomAmount;
59
+ /**
60
+ *
61
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
62
+ * where x is a human readable number stringified
63
+ */
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
+ };
71
+ exports.denomAmountFromChainDenomAmountToFixed = denomAmountFromChainDenomAmountToFixed;
25
72
  /**
26
73
  * Amount that the chain requires is in the x * 10^(quoteDecimals) format
27
74
  * where x is a human readable number
28
75
  */
29
- const derivativeMarginToChainMargin = ({ value, quoteDecimals = 18, }) => new classes_1.BigNumber(value).multipliedBy(new classes_1.BigNumber(10).pow(quoteDecimals));
76
+ const derivativeMarginToChainMargin = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(quoteDecimals));
30
77
  exports.derivativeMarginToChainMargin = derivativeMarginToChainMargin;
78
+ /**
79
+ * Amount that the chain requires is in the x * 10^(quoteDecimals) format
80
+ * where x is a human readable number stringified
81
+ */
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
+ };
89
+ exports.derivativeMarginToChainMarginToFixed = derivativeMarginToChainMarginToFixed;
31
90
  /**
32
91
  * Amount that the chain returns is in the x * 10^(quoteDecimals) format
33
92
  * where x is a human readable number
34
93
  */
35
- const derivativeMarginFromChainMargin = ({ value, quoteDecimals = 18, }) => new classes_1.BigNumber(value).dividedBy(new classes_1.BigNumber(10).pow(quoteDecimals));
94
+ const derivativeMarginFromChainMargin = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(quoteDecimals));
36
95
  exports.derivativeMarginFromChainMargin = derivativeMarginFromChainMargin;
96
+ /**
97
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
98
+ * where x is a human readable number
99
+ */
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
+ };
107
+ exports.derivativeMarginFromChainMarginToFixed = derivativeMarginFromChainMarginToFixed;
37
108
  /**
38
109
  * Amount that the chain requires is in the x * 10^(quoteDecimals) format
39
110
  * where x is a human readable number
40
111
  */
41
- const derivativePriceToChainPrice = ({ value, quoteDecimals = 18, }) => new classes_1.BigNumber(value).multipliedBy(new classes_1.BigNumber(10).pow(quoteDecimals));
112
+ const derivativePriceToChainPrice = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(quoteDecimals));
42
113
  exports.derivativePriceToChainPrice = derivativePriceToChainPrice;
114
+ /**
115
+ * Amount that the chain requires is in the x * 10^(quoteDecimals) format
116
+ * where x is a human readable number stringified
117
+ */
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
+ };
125
+ exports.derivativePriceToChainPriceToFixed = derivativePriceToChainPriceToFixed;
43
126
  /**
44
127
  * Amount that the chain returns is in the x * 10^(quoteDecimals) format
45
128
  * where x is a human readable number
46
129
  */
47
- const derivativePriceFromChainPrice = ({ value, quoteDecimals = 18, }) => new classes_1.BigNumber(value).dividedBy(new classes_1.BigNumber(10).pow(quoteDecimals));
130
+ const derivativePriceFromChainPrice = ({ value, quoteDecimals = 18, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(quoteDecimals));
48
131
  exports.derivativePriceFromChainPrice = derivativePriceFromChainPrice;
132
+ /**
133
+ * Amount that the chain returns is in the x * 10^(quoteDecimals) format
134
+ * where x is a human readable number stringified
135
+ */
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
+ };
143
+ exports.derivativePriceFromChainPriceToFixed = derivativePriceFromChainPriceToFixed;
49
144
  /**
50
145
  * Amount that the chain requires is in the x format
51
146
  * where x is a human readable number
52
147
  */
53
- const derivativeQuantityToChainQuantity = (value) => new classes_1.BigNumber(value);
148
+ const derivativeQuantityToChainQuantity = ({ value, }) => new $BigNumber(value);
54
149
  exports.derivativeQuantityToChainQuantity = derivativeQuantityToChainQuantity;
150
+ /**
151
+ * Amount that the chain requires is in the x format
152
+ * where x is a human readable number stringified
153
+ */
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
+ };
161
+ exports.derivativeQuantityToChainQuantityToFixed = derivativeQuantityToChainQuantityToFixed;
162
+ /**
163
+ * Amount that the chain requires is in the x format
164
+ * where x is a human readable number
165
+ */
166
+ const derivativeQuantityFromChainQuantity = ({ value, }) => new $BigNumber(value);
167
+ exports.derivativeQuantityFromChainQuantity = derivativeQuantityFromChainQuantity;
168
+ /**
169
+ * Amount that the chain requires is in the x format
170
+ * where x is a human readable number stringified
171
+ */
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
+ };
179
+ exports.derivativeQuantityFromChainQuantityToFixed = derivativeQuantityFromChainQuantityToFixed;
55
180
  /**
56
181
  * Amount that the chain requires is in the x / 10^(quoteDecimals - baseDecimals) format
57
182
  * where x is a human readable number
58
183
  */
59
- const spotPriceToChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new classes_1.BigNumber(value).multipliedBy(new classes_1.BigNumber(10).pow(new classes_1.BigNumber(quoteDecimals).minus(baseDecimals)));
184
+ const spotPriceToChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(new $BigNumber(quoteDecimals).minus(baseDecimals)));
60
185
  exports.spotPriceToChainPrice = spotPriceToChainPrice;
186
+ /**
187
+ * Amount that the chain requires is in the x / 10^(quoteDecimals - baseDecimals) format
188
+ * where x is a human readable number stringified
189
+ */
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
+ };
197
+ exports.spotPriceToChainPriceToFixed = spotPriceToChainPriceToFixed;
61
198
  /**
62
199
  * Amount that the chain returns is in the x / 10^(quoteDecimals - baseDecimals) format
63
200
  * where x is a human readable number
64
201
  */
65
- const spotPriceFromChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new classes_1.BigNumber(value).dividedBy(new classes_1.BigNumber(10).pow(new classes_1.BigNumber(quoteDecimals).minus(baseDecimals)));
202
+ const spotPriceFromChainPrice = ({ value, baseDecimals = 18, quoteDecimals = 6, }) => new $BigNumber(value).dividedBy(new $BigNumber(10).pow(new $BigNumber(quoteDecimals).minus(baseDecimals)));
66
203
  exports.spotPriceFromChainPrice = spotPriceFromChainPrice;
204
+ /**
205
+ * Amount that the chain returns is in the x / 10^(quoteDecimals - baseDecimals) format
206
+ * where x is a human readable number stringified
207
+ */
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
+ };
215
+ exports.spotPriceFromChainPriceToFixed = spotPriceFromChainPriceToFixed;
67
216
  /**
68
217
  * Amount that the chain requires is in the x * 10^(baseDecimals) format
69
218
  * where x is a human readable number
70
219
  */
71
- const spotQuantityToChainQuantity = ({ value, baseDecimals = 18, }) => new classes_1.BigNumber(value).multipliedBy(new classes_1.BigNumber(10).pow(baseDecimals));
220
+ const spotQuantityToChainQuantity = ({ value, baseDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(baseDecimals));
72
221
  exports.spotQuantityToChainQuantity = spotQuantityToChainQuantity;
222
+ /**
223
+ * Amount that the chain requires is in the x * 10^(baseDecimals) format
224
+ * where x is a human readable number
225
+ */
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
+ };
236
+ exports.spotQuantityToChainQuantityToFixed = spotQuantityToChainQuantityToFixed;
73
237
  /**
74
238
  * Amount that the chain returns is in the x * 10^(baseDecimals) format
75
239
  * where x is a human readable number
76
240
  */
77
- const spotQuantityFromChainQuantity = ({ value, baseDecimals = 18, }) => new classes_1.BigNumber(value).multipliedBy(new classes_1.BigNumber(10).pow(baseDecimals));
241
+ const spotQuantityFromChainQuantity = ({ value, baseDecimals = 18, }) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(baseDecimals));
78
242
  exports.spotQuantityFromChainQuantity = spotQuantityFromChainQuantity;
243
+ /**
244
+ * Amount that the chain returns is in the x * 10^(baseDecimals) format
245
+ * where x is a human readable number
246
+ */
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
+ };
257
+ exports.spotQuantityFromChainQuantityToFixed = spotQuantityFromChainQuantityToFixed;
79
258
  //# sourceMappingURL=numbers.js.map
@@ -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,mBAAS,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,mBAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AAFjD,QAAA,mCAAmC,uCAEc;AAE9D;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,EAC5C,KAAK,EACL,QAAQ,GAAG,EAAE,GAId,EAAE,EAAE,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,IAAI,mBAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;AAN3D,QAAA,6BAA6B,iCAM8B;AAExE;;;GAGG;AACI,MAAM,+BAA+B,GAAG,CAAC,EAC9C,KAAK,EACL,QAAQ,GAAG,EAAE,GAId,EAAE,EAAE,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,mBAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;AANxD,QAAA,+BAA+B,mCAMyB;AAErE;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,EA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S,EACzB,YAAY,GAAG,mBAAS,CAAC,UAAU,GAMpC,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,IAAA,mCAA2B,EAAC;QACzC,KAAK;QACL,YAAY;KACb,CAAC,CAAA;IAEF,IAAI,aAAa,KAAK,SAAS,EAAE;QAC/B,OAAO,MAAM,CAAC,OAAO,EAAE,CAAA;KACxB;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,IAAA,wCAAgC,EAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAA;AAC/E,CAAC,CAAA;AArBY,QAAA,kCAAkC,sCAqB9C;AAED;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,EAC5C,KAAK,EACL,YAAY,GAAG,EAAE,GAIlB,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAA;AANjE,QAAA,6BAA6B,iCAMoC;AAE9E;;;GAGG;AACI,MAAM,oCAAoC,GAAG,CAAC,EACnD,KAAK,EACL,YAAY,GAAG,EAAE,EACjB,aAAa,GAAG,SAAS,EACzB,YAAY,GAAG,mBAAS,CAAC,UAAU,GAMpC,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,IAAA,qCAA6B,EAAC;QAC3C,KAAK;QACL,YAAY;KACb,CAAC,CAAA;IAEF,IAAI,aAAa,KAAK,SAAS,EAAE;QAC/B,OAAO,MAAM,CAAC,OAAO,EAAE,CAAA;KACxB;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,IAAA,wCAAgC,EAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAA;AAC/E,CAAC,CAAA;AArBY,QAAA,oCAAoC,wCAqBhD"}
package/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.56",
4
+ "version": "0.0.60",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -35,5 +35,5 @@
35
35
  "shx": "^0.3.2",
36
36
  "store2": "^2.12.0"
37
37
  },
38
- "gitHead": "fb71ba9559719bf67a73881e268a5b3cbdeb9fa3"
38
+ "gitHead": "b269c9aec7048ce1ae4b7862ab2e88cb7c59e033"
39
39
  }