Package Exports
- @restless/ethereum
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@restless/ethereum) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Restless - Ethereum
Ethereum module for restless. Uses ethers.js. Provides utilities such as:
Installation
npm install @restless/ethereum
yarn add @restless/ethereumSanitizers
asEthAddress
Accepts any string that represents a valid ethereum address. Checks the checksum if present. Returns a normalized representation.
asEthAddress('0xA5fE...f213') // RIGHT 0xA5fE...f213
asEthAddress('0xa5fe...f213') // RIGHT 0xA5fE...f213
asEthAddress('bla bla bla') // LEFT 'expected: ethereum address'
asBigNumber(123) // LEFT 'expected: ethereum address'asBigNumber
Accepts any string or number that represents an integer. Converts the integer to a BigNumber.
asBigNumber('123') // RIGHT BigNumber(123)
asBigNumber(456) // RIGHT BigNumber(456)
asBigNumber(1.5) // LEFT 'expected: big number'
asBigNumber(true) // LEFT 'expected: big number'