Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Client library to onboard users to web3 apps

License

NotificationsYou must be signed in to change notification settings

thirdweb-dev/web3-onboard

Repository files navigation

easy way to connect users to dapps

Features

  • Minimal Dependencies: All wallet dependencies are included in separate packages, so you only include the ones you want to use in your app.
  • Multiple Wallets and Accounts Connection: Allow your users to connect multiple wallets and multiple accounts within each wallet at the same time to your app.
  • Multiple Chain Support: Allow users to switch between chains/networks with ease.
  • Account Center: A persistent interface to manage wallet connections and networks, with a minimal version for mobile
  • Wallet Provider Standardization: All wallet modules expose a provider that is patched to be compliant with theEIP-1193,EIP-1102,EIP-3085 andEIP-3326 specifications.
  • Dynamic Imports: Supporting multiple wallets in your app requires a lot of dependencies. Onboard dynamically imports a wallet and its dependencies only when the user selects it, so that minimal bandwidth is used.

Quickstart

Install the core Onboard library, the injected wallets module and optionally ethers js to support browser extension and mobile wallets:

NPMnpm i @web3-onboard/core @web3-onboard/injected-wallets ethers

Yarnyarn add @web3-onboard/core @web3-onboard/injected-wallets ethers

Then initialize in your app:

importOnboardfrom'@web3-onboard/core'importinjectedModulefrom'@web3-onboard/injected-wallets'import{ethers}from'ethers'constMAINNET_RPC_URL='https://mainnet.infura.io/v3/<INFURA_KEY>'constinjected=injectedModule()constonboard=Onboard({wallets:[injected],chains:[{id:'0x1',token:'ETH',label:'Ethereum Mainnet',rpcUrl:MAINNET_RPC_URL},{id:42161,token:'ARB-ETH',label:'Arbitrum One',rpcUrl:'https://rpc.ankr.com/arbitrum'},{id:'0xa4ba',token:'ARB',label:'Arbitrum Nova',rpcUrl:'https://nova.arbitrum.io/rpc'},{id:'0x2105',token:'ETH',label:'Base',rpcUrl:'https://mainnet.base.org'}]})constwallets=awaitonboard.connectWallet()console.log(wallets)if(wallets[0]){// create an ethers provider with the last connected wallet providerconstethersProvider=newethers.providers.Web3Provider(wallets[0].provider,'any')constsigner=ethersProvider.getSigner()// send a transaction with the ethers providerconsttxn=awaitsigner.sendTransaction({to:'0x',value:100000000000000})constreceipt=awaittxn.wait()console.log(receipt)}

Onboard v1 migration guide

If you're coming from v1, we've created amigration guide for you.

Documentation

For full documentation, check out the README.md for each package or thedocs page here:

Core Repo

Injected Wallets

SDK Wallets

Hardware Wallets

Frameworks

Test out the demo app

If you would like to test out the current functionality of V2 in a small browser demo, then:

  • Clone the repo:git clone git@github.com:blocknative/onboard.git
  • Change in to the onboard directory:cd onboard
  • Checkout the V2 feature branch:git checkout main
  • Install the dependencies:yarn (if running a M1 mac -yarn install-m1-mac)
  • Run all packages in dev mode:yarn dev
  • To view the demo app in the browser after running the above steps navigate tohttp://localhost:8080

[8]ページ先頭

©2009-2025 Movatter.jp