size
- Number
: The byte size for the HEX string, e.g. 32
will result in a 32 bytes HEX string with 64 characters preficed with "0x".String
: The generated random HEX string.value
- String|Number
: A number, number string or HEX string to convert to a BN object.Boolean
Boolean
string
- String
: A string to hash.String
: the result hash.paramX
- Mixed
: Any type, or an object with {type: 'uint', value: '123456'}
or {t: 'bytes', v: '0xfff456'}
. Basic types are autodetected as follows:String
non numerical UTF-8 string is interpreted as string
.String|Number|BN|HEX
positive number is interpreted as uint256
.String|Number|BN
negative number is interpreted as int256
. Boolean
as bool
. String
HEX string with leading 0x
is interpreted as bytes
. HEX
HEX number representation is interpreted as uint256
.String
: the result hash.hex
- String|HEX
: The given HEX string.Boolean
meterify.utils.isHex()
is that it expects HEX to be prefixed with 0x
.hex
- String|HEX
: The given HEX string.Boolean
address
- String
: An address string.chainId
- number
(optional): Chain id where checksummed address should be valid, defaults to null
. RSKIP-60 for details.Boolean
address
- String
: An address string.chainId
- number
(optional): Chain id where checksummed address should be valid, defaults to null
. RSKIP-60 for details.String
: The checksum address.0x
from a given hex if it exists.hex
- String
: HexString
: Hex without prefix.address
- String
: An address string.chainId
- number
(optional): Chain id where checksummed address should be valid, defaults to null
. RSKIP-60 for details.Boolean
: true
when the checksum of the address is valid, false
if its not a checksum address, or the checksum is invalid.value
- String|Number|BN|BigNumber
: The input to convert to HEX.String
: The resulting HEX string.number
- String|Number|HEX
: Number to convert to a big number.hexString
- String|HEX
: A string to hash.String
: The number as a string.hexString
- String|HEX
: A string to hash.Number
number
- String|Number|BN|BigNumber
: A number as string or number.String
: The HEX value of the given number.hex
- String
: A HEX string to convert to a UTF-8 string.String
: The UTF-8 string.hex
- String
: A HEX string to convert to a ASCII string.String
: The ASCII string.string
- String
: A UTF-8 string to convert to a HEX string.String
: The HEX string.bytes4
, bytes8
etc. value then please pass the correct length as the second parameter.string
- String
: A ASCII string to convert to a HEX string.length
- Number
: The length of the returned hex string. The default size is 32
e.g.: bytes32
.String
: The HEX string.hex
- String|HEX
: A HEX to convert.Array
: The byte array.byteArray
- Array
: A byte array to convert.String
: The HEX string.wei
.wei
are the smallest conversion unit, and you should always make calculations in wei
and convert only for display reasons.number
- String|BN
: The value.unit
- String
(optional, defaults to "ether"
): The ether to convert from. Possible units are:noether
: '0'wei
: '1'kwei
: '1000'Kwei
: '1000'babbage
: '1000'femtoether
: '1000'mwei
: '1000000'Mwei
: '1000000'lovelace
: '1000000'picoether
: '1000000'gwei
: '1000000000'Gwei
: '1000000000'shannon
: '1000000000'nanoether
: '1000000000'nano
: '1000000000'szabo
: '1000000000000'microether
: '1000000000000'micro
: '1000000000000'finney
: '1000000000000000'milliether
: '1000000000000000'milli
: '1000000000000000'ether
: '1000000000000000000'kether
: '1000000000000000000000'grand
: '1000000000000000000000'mether
: '1000000000000000000000000'gether
: '1000000000000000000000000000'tether
: '1000000000000000000000000000000'wei
value into another value.wei
are the smallest conversion unit, and you should always make calculations in wei and convert only for display reasons.number
- String|BN
: The value in wei.unit
- String
(optional, defaults to "ether"
): The ether to convert to. Possible units are:noether
: '0'wei
: '1'kwei
: '1000'Kwei
: '1000'babbage
: '1000'femtoether
: '1000'mwei
: '1000000'Mwei
: '1000000'lovelace
: '1000000'picoether
: '1000000'gwei
: '1000000000'Gwei
: '1000000000'shannon
: '1000000000'nanoether
: '1000000000'nano
: '1000000000'szabo
: '1000000000000'microether
: '1000000000000'micro
: '1000000000000'finney
: '1000000000000000'milliether
: '1000000000000000'milli
: '1000000000000000'ether
: '1000000000000000000'kether
: '1000000000000000000000'grand
: '1000000000000000000000'mether
: '1000000000000000000000000'gether
: '1000000000000000000000000000'tether
: '1000000000000000000000000000000'String
: It always returns a string number.wei
.Object
with the following properties:noether
: '0'wei
: '1'kwei
: '1000'Kwei
: '1000'babbage
: '1000'femtoether
: '1000'mwei
: '1000000'Mwei
: '1000000'lovelace
: '1000000'picoether
: '1000000'gwei
: '1000000000'Gwei
: '1000000000'shannon
: '1000000000'nanoether
: '1000000000'nano
: '1000000000'szabo
: '1000000000000'microether
: '1000000000000'micro
: '1000000000000'finney
: '1000000000000000'milliether
: '1000000000000000'milli
: '1000000000000000'ether
: '1000000000000000000'kether
: '1000000000000000000000'grand
: '1000000000000000000000'mether
: '1000000000000000000000000'gether
: '1000000000000000000000000000'tether
: '1000000000000000000000000000000'string
- String
: The string to add padding on the left.characterAmount
- Number
: The number of characters the total string should have.sign
- String
(optional): The character sign to use, defaults to "0"
.String
: The padded string.string
- String
: The string to add padding on the right.characterAmount
- Number
: The number of characters the total string should have.sign
- String
(optional): The character sign to use, defaults to "0"
.String
: The padded string.