E&N Wallet
Reusable react component for connecting to web3 wallets
Usage
SigninModal and Context
import { SigninModal, useWallet } from '@edgeandnode/wallet'
const App = () => {
const { address, setIsModalOpen } = useWallet()
return (
<div>
Wallet address: { address }
<button onClick={() => { setIsModalOpen(true) }}>
Connect
</button>
<SigninModal headerImage="link/to/image.png" />
</div>
)
}
Context Provider
<WalletContextProvider infuraId={process.env.INFURA_KEY}>
<App />
</WalletContextProvider>
Building and running
- Run
yarn
to install all dependencies. - Run
yarn build
to bundle all files - Run
yarn npm:publish
to publish to NPM
Local development
- Run
yarn link
inside of this folder - Run
yarn link @edgeandnode/wallet
inside of another application that includes components in local development