1.36.0-b • Published 2 years ago
@pooltogether/bnc-onboard v1.36.0-b
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'
// set a variable to store instantiated web3
let web3
// head to blocknative.com to create a key
const BLOCKNATIVE_KEY = 'blocknative-api-key'
// the network id that your dapp runs on
const NETWORK_ID = 1
// initialize onboard
const onboard = Onboard({
dappId: BLOCKNATIVE_KEY,
networkId: NETWORK_ID,
subscriptions: {
wallet: wallet => {
// instantiate web3 when the user has selected a wallet
web3 = new Web3(wallet.provider)
console.log(`${wallet.name} connected!`)
}
}
})
// Prompt user to select a wallet
await onboard.walletSelect()
// Run wallet checks to make sure that user is ready to transact
await onboard.walletCheck()
Documentation
For detailed documentation head to docs.blocknative.com
1.36.0
2 years ago
1.36.0-a
2 years ago
1.36.0-b
2 years ago
1.34.1-h
3 years ago
1.34.1-i
3 years ago
1.34.1-g
3 years ago
1.34.1-f
3 years ago
1.34.1-e
3 years ago
1.34.1-d
3 years ago
1.34.1
3 years ago
1.34.1-b
3 years ago
1.34.1-c
3 years ago
1.33.0-b
3 years ago
1.33.0-c
3 years ago
1.33.0
3 years ago
1.25.0-c
3 years ago
1.25.0
3 years ago
1.25.0-b
3 years ago
1.22.1
3 years ago
1.20.2
3 years ago
1.20.1
3 years ago
1.18.0
3 years ago
1.16.2-b
3 years ago
1.16.2
3 years ago
1.16.1
3 years ago
1.16.0
3 years ago
1.14.0-b
3 years ago
1.14.0
3 years ago
1.13.1-b
4 years ago
1.13.1-a
4 years ago
1.12.0-b
4 years ago
1.12.0
4 years ago
1.9.4
4 years ago
1.7.8
4 years ago