1.3.11 • Published 2 years ago

@meterio/web3-context v1.3.11

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

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 ♡

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.11

2 years ago

0.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

0.3.6

2 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago