Onboard
JavaScript library to easily onboard users to ethereum apps by enabling wallet selection, connection, wallet checks and real time state updates.
Install
npm install bnc-onboard
Quick Start
import Onboard from 'bnc-onboard'
import Web3 from 'web3'
let web3
const BLOCKNATIVE_KEY = 'blocknative-api-key'
const NETWORK_ID = 1
const onboard = Onboard({
dappId: BLOCKNATIVE_KEY,
networkId: NETWORK_ID,
subscriptions: {
wallet: wallet => {
web3 = new Web3(wallet.provider)
console.log(`${wallet.name} connected!`)
}
}
})
await onboard.walletSelect()
await onboard.walletCheck()
Documentation
For detailed documentation head to docs.blocknative.com