@lodestar/utils 1.14.0-dev.88c3ee363f → 1.14.0-dev.9c4641a733

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.
@@ -0,0 +1,10 @@
1
+ export declare const ETH_TO_GWEI: bigint;
2
+ export declare const GWEI_TO_WEI: bigint;
3
+ export declare const ETH_TO_WEI: bigint;
4
+ type EthNumeric = bigint;
5
+ /**
6
+ * Convert gwei to wei.
7
+ */
8
+ export declare function gweiToWei(gwei: EthNumeric): EthNumeric;
9
+ export {};
10
+ //# sourceMappingURL=ethConversion.d.ts.map
@@ -0,0 +1,10 @@
1
+ export const ETH_TO_GWEI = BigInt(10 ** 9);
2
+ export const GWEI_TO_WEI = BigInt(10 ** 9);
3
+ export const ETH_TO_WEI = ETH_TO_GWEI * GWEI_TO_WEI;
4
+ /**
5
+ * Convert gwei to wei.
6
+ */
7
+ export function gweiToWei(gwei) {
8
+ return gwei * GWEI_TO_WEI;
9
+ }
10
+ //# sourceMappingURL=ethConversion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ethConversion.js","sourceRoot":"","sources":["../src/ethConversion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAIpD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAgB;IACxC,OAAO,IAAI,GAAG,WAAW,CAAC;AAC5B,CAAC"}
package/lib/index.d.ts CHANGED
@@ -19,4 +19,5 @@ export * from "./url.js";
19
19
  export * from "./verifyMerkleBranch.js";
20
20
  export * from "./promise.js";
21
21
  export * from "./waitFor.js";
22
+ export * from "./ethConversion.js";
22
23
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -19,4 +19,5 @@ export * from "./url.js";
19
19
  export * from "./verifyMerkleBranch.js";
20
20
  export * from "./promise.js";
21
21
  export * from "./waitFor.js";
22
+ export * from "./ethConversion.js";
22
23
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,KAAK,EAAoB,MAAM,YAAY,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAwB,OAAO,EAAC,MAAM,YAAY,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,KAAK,EAAoB,MAAM,YAAY,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAwB,OAAO,EAAC,MAAM,YAAY,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/ChainSafe/lodestar/issues"
13
13
  },
14
- "version": "1.14.0-dev.88c3ee363f",
14
+ "version": "1.14.0-dev.9c4641a733",
15
15
  "type": "module",
16
16
  "exports": "./lib/index.js",
17
17
  "files": [
@@ -31,8 +31,11 @@
31
31
  "lint": "eslint --color --ext .ts src/ test/",
32
32
  "lint:fix": "yarn run lint --fix",
33
33
  "pretest": "yarn run check-types",
34
- "test:unit": "mocha 'test/**/*.test.ts'",
35
- "test:browsers": "yarn karma start karma.config.cjs",
34
+ "test:unit": "vitest --run --dir test/unit/ --coverage",
35
+ "test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
36
+ "test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
37
+ "test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
38
+ "test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
36
39
  "check-readme": "typescript-docs-verifier"
37
40
  },
38
41
  "types": "lib/index.d.ts",
@@ -55,5 +58,5 @@
55
58
  "beacon",
56
59
  "blockchain"
57
60
  ],
58
- "gitHead": "8e47d41def3c32e643019904fd6fbdcf4672c991"
61
+ "gitHead": "00fb587823fe665bcead79e69ac3cc82f429dab7"
59
62
  }