GithubHelp home page GithubHelp logo

isabella232 / web3-context Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chainsafe/web3-context

0.0 0.0 0.0 633 KB

A React context implementation of Onboard.js & general utilities

License: GNU Lesser General Public License v3.0

TypeScript 89.50% HTML 6.32% CSS 1.40% JavaScript 2.79%

web3-context's Introduction

Web3-Context

A React Context wrapper for Blocknative OnbardJS

How to use

Wrap you application in a

<Web3Provider networkIds={[1]}>
    {YOUR APP CODE}
</Web3Provider>

The following props can be passed in to configure the Web3 Provider:

  onboardConfig?: OnboardConfig; // The OnboardJS Configuration object - See [here](https://docs.blocknative.com/onboard#built-in-modules)
  networkIds?: number[]; // Defaults to 1 if nothing is provided
  ethGasStationApiKey?: string;
  gasPricePollingInterval?: number; //Seconds between gas price polls. Defaults to 0 - Disabled
  gasPriceSetting?: EthGasStationSettings | EtherchainGasSettings;
  tokensToWatch?: TokensToWatch; // Network-keyed collection of token addresses to watch
  spenderAddress?: string;
  cacheWalletSelection?: boolean;
  checkNetwork?: boolean; // Defaults to true if networkIds are provided
  children: React.ReactNode;

Anywhere further down the component tree, use:

  const {address} = useWeb3();

Take a look at the example folder for a basic implementation of the components.

Happy Building โ™ก

web3-context's People

Contributors

fsm1 avatar ryry79261 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.