Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
selectWallet and disconnectWallet functions to manage wallet state
Optional initialData to pass for initial address and balance values while wallet is loading
Install
pnpm i use-onboard
Example
importReactfrom'react'import{useOnboard}from'use-onboard'constApp=({ initialData })=>{// in case you are authorized before this won't ask to login from the walletconst{ selectWallet, address, isWalletSelected, disconnectWallet, balance }=useOnboard({options: {dappId: process.env.DAPP_ID,// optional API keynetworkId: 1// Ethereum network ID},
initialData // optional initial to data to pass while wallet is loading})return(<div>{<buttononClick={async()=>{if(isWalletSelected)disconnectWallet()elseawaitselectWallet()}}>{isWalletSelected ? 'Disconnect' : 'Connect'}</button>}<p>Address: {address}</p><p>Balance: {balance} ETH</p></div>)}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].