[](https://github.com/TrueFiEng/useDApp/actions/workflows/CI.yml) [](https://npmjs.com/package/@usedapp/core) [


Combines the best practices:
- 🔧 Modern stack - Employs ethers.js, multicall & waffle
- 📚 Extendability - Extends easily with custom hooks
- 💡 Testability - Simple integration tests for UI and blockchain
``tsx
import { Mainnet } from '@usedapp/core/modal/chain/ethereum'
import { useEthers, useEtherBalance } from '@usedapp/core'
const config = {
readOnlyChainId: Mainnet.chainId,
readOnlyUrls: {
[Mainnet.chainId]: 'https://mainnet.infura.io/v3/62687d1a985d4508b2b7a24827551934',
},
}
ReactDOM.render(
document.getElementById('root')
)
const STAKING_CONTRACT = '0x00000000219ab540356cBB839Cbe05303d7705Fa'
export function App() {
const { activateBrowserWallet, deactivate, account } = useEthers()
const userBalance = useEtherBalance(account)
const stakingBalance = useEtherBalance(STAKING_CONTRACT)
return (
ETH2 staking balance: {formatEther(stakingBalance)} ETH
}Account: {account}
}Ether balance: {formatEther(userBalance)} ETH
}See application here.
Documentation
For detailed feature walkthrough checkout documentation.Contributing
Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct and contribution policy.
$3
* Make sure all tests pass.
* Make sure linter passes.
* Make sure you have test coverage for any new features.
To install dependencies type:
`sh
npm i -g pnpm
pnpm install
`To build project:
`sh
yarn build
`To run tests type:
`sh
yarn test
`To run linter type:
`sh
yarn lint
``useDapp is released under the MIT License.