@withtally/address-helper
v3.0.0
Published
Tiny package for treating Ethereum addresses as types instead of strings in typescript.
Downloads
22
Readme
Tiny package for treating Ethereum addresses as types instead of strings in typescript.
Built on top of the ethers.js address helpers.
Usage
import { Address, BadAddressException } from '@withtally/address-helper';
try {
const address = new Address('0x0000000000000000000000000000000000000000');
} catch (e) {
if (e instanceof BadAddressException) {
console.log('Bad address');
} else {
throw e;
}
}