GithubHelp home page GithubHelp logo

finalquest / usedapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from truefieng/usedapp

0.0 1.0 0.0 3.06 MB

Framework for rapid Dapp development. Simple. Robust. Extendable. Testable

Home Page: https://usedapp.io

License: MIT License

TypeScript 96.59% HTML 1.05% JavaScript 2.08% CSS 0.29%

usedapp's Introduction

useDapp

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 multicall

Combines the best practices:

  • ๐Ÿ”ง Modern stack - Employs ethers.js, web3-react, multicall & waffle
  • ๐Ÿ“š Extendability - Extends easily with custom hooks
  • ๐Ÿ’ก Testability - Simple integration tests for UI and blockchain

Example

const config = {
  readOnlyChainId: ChainId.Mainnet,
  readOnlyUrls: {
    [ChainId.Mainnet]: 'https://mainnet.infura.io/v3/62687d1a985d4508b2b7a24827551934',
  },
}

ReactDOM.render(
  <DAppProvider config={config}>
    <App />
  </DAppProvider>,
  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 (
    <div>
      {!account && <button onClick={activateBrowserWallet}> Connect </button>}
      {account && <button onClick={deactivate}> Disconnect </button>}
    
      {stakingBalance && <p>ETH2 staking balance: {formatEther(stakingBalance)} ETH </p>}
      {account && <p>Account: {account}</p>}
      {userBalance && <p>Ether balance: {formatEther(userBalance)} ETH </p>}
    </div>
  )
}

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.

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:

yarn

To build project:

yarn build

To run tests type:

yarn test

To run linter type:

yarn lint

Building documentation

Install Sphinx to build documentation:

cd docs
make html

Before building documentation for the first time you may have to install required python packages:

pip3 install -r docs/requirements.txt

License

useDapp is released under the MIT License.

usedapp's People

Contributors

github-actions[bot] avatar nezouse avatar marekkirejczyk avatar szymx95 avatar rzadp avatar justynabroniszewska avatar dmaretskyi avatar gasolin avatar miziet avatar quagliero avatar sz-piotr avatar hubertnastaly avatar clumsyvlad avatar ekowalsk avatar lcamargof avatar t4t5 avatar dylankilkenny avatar perski6 avatar turupawn avatar crazyrabbitltc avatar changoman avatar vanruch avatar jieyilong avatar itsshadowl avatar lorenzoprimi avatar wachulski avatar osamaelhariri avatar patrickalphac avatar paulrberg avatar priteshkeleven avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.