Opiniated list of tools for TypeScript development with Ethereum
Do you want to use TypeScript when developing an app that interfaces with Ethereum? Here are some tools in the landscape.
- Ethers - Ethers is the best library right now for interfacing with Ethereum contracts. It includes neat utilities like
isAddress. The library and utilities are typed, but the contracts are NOT automatically typed.
- TypeChain - Gives you fully typed interfaces for your
.solsmart contracts. Paired with Ethers (or web3.js) under the hood. TypeChain basically injects Ethers with types.
- HardHat - Development environment to set up compiling, testing, deployment, and debugging when writing your own
.solsmart contracts. Easy to add TypeChain and get types.
- Waffle - Good tool for testing. It let’s you deploy, compile and mock contracts in tests. Usually paired with Chai (assertion methods
assert) and a test runner (Mocha).
- @openzeppelin/test-helpers - An Ethereum supercharged version of Chai. Provides ethereum specific assertion methods like
expectEventand works well with
- useDapp - React hooks for Ethereum interactions like
useTokenBalance. Uses Ethers under the hood. Can pair with TypeChain for types.
- solhint - Eslint but for Solidity development
There is no good way to use Ethers with types without having your own
Imagine if you want to interface with ERC-20 contracts that you don’t develop yourself. It would be cool to have types in Ethers another way than using TypeChain.
- Web3.js - Came out before Ethers. Ethers has better types and is generally a more solid library. You’ll probably want to use Ethers instead.
- Truffle - Similar to HardHat. Been around for longer. Hardhat provides a better experience for TypeScript.
- Drizzle - last commit in 2020, seems dead. Also, it uses redux and who wants to use redux.