Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/truefieng/usedapp
Framework for rapid Dapp development. Simple. Robust. Extendable. Testable
https://github.com/truefieng/usedapp
dapp ethereum react typescript usedapp
Last synced: 5 days ago
JSON representation
Framework for rapid Dapp development. Simple. Robust. Extendable. Testable
- Host: GitHub
- URL: https://github.com/truefieng/usedapp
- Owner: TrueFiEng
- License: mit
- Created: 2020-12-18T09:01:59.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-10T19:28:09.000Z (6 months ago)
- Last Synced: 2024-10-29T15:37:21.388Z (about 2 months ago)
- Topics: dapp, ethereum, react, typescript, usedapp
- Language: TypeScript
- Homepage: https://usedapp.io
- Size: 69.2 MB
- Stars: 1,590
- Watchers: 20
- Forks: 371
- Open Issues: 57
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# useDapp
[![CI](https://github.com/TrueFiEng/useDApp/actions/workflows/CI.yml/badge.svg)](https://github.com/TrueFiEng/useDApp/actions/workflows/CI.yml)
[![Npm package version](https://badgen.net/npm/v/@usedapp/core)](https://npmjs.com/package/@usedapp/core)
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/ppFxC3E44X)### Ethereum 🤝 React
Framework for rapid Dapp development.
Simple. Robust. Extendable. Testable.## About
Introduces great features:
- 🏗️ **React hooks** - Uses React hooks as your primary building ingredient
- 🚅 **Auto refresh** - Refreshes on a new block, wallet change or network change
- 🛒 **Multicall** - Combines multiple blockchain calls into a single multicallCombines the best practices:
- 🔧 **Modern stack** - Employs [ethers.js](https://github.com/ethers-io/), [multicall](https://github.com/makerdao/multicall) & [waffle](https://getwaffle.io/)
- 📚 **Extendability** - Extends easily with custom hooks
- 💡 **Testability** - Simple integration tests for UI and blockchain## Example
```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 (
{!account && Connect }
{account && Disconnect }
{stakingBalance &Ð2 staking balance: {formatEther(stakingBalance)} ETH
}
{account &&Account: {account}
}
{userBalance &&Ether balance: {formatEther(userBalance)} ETH
}
)
}
```See application [here](https://example.usedapp.io/balance).
## Documentation
For detailed feature walkthrough checkout [documentation](https://usedapp-docs.netlify.app/docs).## Contributing
Contributions are always welcome, no matter how large or small. Before contributing, please read the [code of conduct](https://github.com/TrueFiEng/useDApp/blob/master/CODE_OF_CONDUCT.md) and [contribution policy](https://github.com/TrueFiEng/useDApp/blob/master/CONTRIBUTION.md).
### Before you issue pull request:
* 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
```## License
useDapp is released under the [MIT License](https://opensource.org/licenses/MIT).