mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[web3]: toWei does not accept number
This commit is contained in:
Vendored
+1
@@ -19,6 +19,7 @@
|
||||
// Donam Kim <https://github.com/donamk>
|
||||
// Doug Kent <https://github.com/dkent600>
|
||||
// Daniel Zhou <https://github.com/nerddan>
|
||||
// Alex Kvak <https://github.com/alexkvak>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -89,7 +89,7 @@ export default interface Utils {
|
||||
toDecimal(val: any): number;
|
||||
toHex(val: any): string;
|
||||
toUtf8(val: any): string;
|
||||
toWei(val: string | number, unit?: Unit): string;
|
||||
toWei(val: string, unit?: Unit): string;
|
||||
toWei(val: BigNumber, unit?: Unit): BigNumber;
|
||||
unitMap: any;
|
||||
}
|
||||
|
||||
@@ -163,6 +163,9 @@ const shhPromise: Promise<string> = web3.shh.generateSymKeyFromPassword("xyz");
|
||||
// --------------------------------------------------------------------------
|
||||
const weiStr: string = web3.utils.toWei("100", "gwei");
|
||||
const weiBn: BigNumber = web3.utils.toWei(web3.utils.toBN("1"));
|
||||
// $ExpectError
|
||||
const weiNumber = web3.utils.toWei(100);
|
||||
|
||||
const rndHex: string = Web3.utils.randomHex(10);
|
||||
const sha3: string = web3.utils.soliditySha3(0, 1, "abc");
|
||||
const fromWei1: BigNumber = web3.utils.fromWei(new BigNumber(1));
|
||||
|
||||
Reference in New Issue
Block a user