opnet 1.1.13 → 1.1.14
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/browser/_version.d.ts +1 -1
- package/browser/index.js +1 -1
- package/browser/utils/BitcoinUtils.d.ts +1 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/utils/BitcoinUtils.d.ts +1 -0
- package/build/utils/BitcoinUtils.js +6 -0
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/utils/BitcoinUtils.ts +14 -0
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.1.
|
|
1
|
+
export declare const version = "1.1.14";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.1.
|
|
1
|
+
export const version = '1.1.14';
|
|
@@ -4,4 +4,10 @@ export class BitcoinUtils {
|
|
|
4
4
|
const bn = new BigNumber(value.toString());
|
|
5
5
|
return bn.dividedBy(new BigNumber(10).pow(decimals)).toString();
|
|
6
6
|
}
|
|
7
|
+
expandToDecimals(n, decimals) {
|
|
8
|
+
const amount = new BigNumber(n)
|
|
9
|
+
.multipliedBy(new BigNumber(10).pow(decimals))
|
|
10
|
+
.decimalPlaces(0);
|
|
11
|
+
return BigInt(amount.toString());
|
|
12
|
+
}
|
|
7
13
|
}
|
package/package.json
CHANGED
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.1.
|
|
1
|
+
export const version = '1.1.14';
|
|
@@ -19,4 +19,18 @@ export class BitcoinUtils {
|
|
|
19
19
|
|
|
20
20
|
return bn.dividedBy(new BigNumber(10).pow(decimals)).toString();
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Convert number or string to BigInt
|
|
25
|
+
* @param {number | string} n
|
|
26
|
+
* @param {number | string} decimals
|
|
27
|
+
* @returns {BigInt}
|
|
28
|
+
*/
|
|
29
|
+
public expandToDecimals(n: number | string, decimals: number | string) {
|
|
30
|
+
const amount = new BigNumber(n)
|
|
31
|
+
.multipliedBy(new BigNumber(10).pow(decimals))
|
|
32
|
+
.decimalPlaces(0);
|
|
33
|
+
|
|
34
|
+
return BigInt(amount.toString());
|
|
35
|
+
}
|
|
22
36
|
}
|