@haven-fi/solauto-sdk 1.0.377 → 1.0.378
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.
@@ -23,7 +23,7 @@ function getLiqUtilzationRateBps(supplyUsd, debtUsd, liqThresholdBps) {
|
|
23
23
|
}
|
24
24
|
function toBaseUnit(value, decimals) {
|
25
25
|
if (!decimals) {
|
26
|
-
return BigInt(value);
|
26
|
+
return BigInt(Math.floor(value));
|
27
27
|
}
|
28
28
|
return BigInt(Math.round(value * Math.pow(10, decimals)));
|
29
29
|
}
|
package/package.json
CHANGED
package/src/utils/numberUtils.ts
CHANGED
@@ -15,7 +15,7 @@ export function getLiqUtilzationRateBps(
|
|
15
15
|
|
16
16
|
export function toBaseUnit(value: number, decimals: number): bigint {
|
17
17
|
if (!decimals) {
|
18
|
-
return BigInt(value);
|
18
|
+
return BigInt(Math.floor(value));
|
19
19
|
}
|
20
20
|
return BigInt(Math.round(value * Math.pow(10, decimals)));
|
21
21
|
}
|