Convert Ethereum address to a checksummed address
npm install ethereum-checksum-address
Convert to a checksummed address:
const { toChecksumAddress } = require('ethereum-checksum-address')
console.log(toChecksumAddress('0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1')) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
console.log(toChecksumAddress('0x90F8BF6A479F320EAD074411A4B0E7944EA8C9C1')) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
Check if address is a checksummed address:
const { checkAddressChecksum } = require('ethereum-checksum-address')
console.log(checkAddressChecksum('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1')) // true
console.log(checkAddressChecksum('0x90F8BF6A479F320EAD074411A4B0E7944EA8C9C1')) // false
Install:
npm install -g ethereum-checksum-address
Convert address to checksummed address:
$ ethereum_checksum_address 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
Check if address is a checksummed address
$ ethereum_checksum_address 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1 --check
true
npm test