Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Connect multiple web3 wallets to your dapp easily

License

NotificationsYou must be signed in to change notification settings

viaprotocol/web3-wallets

Repository files navigation

Via Protocol is the most advanced cross-chain aggregation protocol

Web3 wallets

Universal adapter to Ethereum and Solana

NPM VersionDownloads StatsDiscordGitmoji support

Features

  • 🚀 Built-in functions for working with signatures, connecting wallets, tracking the status of transactions, ENS names, and more.
  • 💼 Built-in wallet connectors for MetaMask, WalletConnect, Coinbase Wallet, Keplr, xDefi, Phantom (Solana) and Injected wallets.
  • 🌀 Auto-refresh data on wallet, block, and network changes
  • 🦄 TypeScript ready
  • 🌏 All supported networks are innetworks.ts

Supported wallets

  • MetaMask
  • WalletConnect (all WalletConnect-compatible wallets are supported,>100 wallets!)
  • Coinbase Wallet
  • Phantom (Solana)
  • Keplr (Cosmos, Osmosis, Astar)
  • xDeFi (EVM networks, Bitcoin, Bitcoin Cash, Litecoin)
  • Safe (aka Gnosis Safe Multisig Wallet)

Installation

yarn add @viaprotocol/web3-wallets

Quick start

import{useContext}from'react'import{WalletContext,WalletProvider}from'@viaprotocol/web3-wallets'functionApp(){return(<WalletProvider><NestedComponent/></WalletProvider>)}functionNestedComponent(){const{ connect, isConnected, address}=useContext(WalletContext)if(!isConnected){return(// Select MetaMask and connect to ETH Mainnet<buttontype="button"onClick={()=>connect({name:'MetaMask',chainId:1})}>Connect wallet</button>)}return(<p>{address}</p>)}

Local development

Unfortunately, there is no playground in the library at the moment, so local development is done withyalc.

  1. First, install the library:
yarn global add yalc
  1. Make changes to theweb3-wallets code

  2. Run the following command to build the library:

yarn publish:yalc
  1. In the project you are going to test your functionality, initialize the package fetch fromyalc
yalc add @viaprotocol/web3-wallets
  1. Installyalc version of web3-wallets
yarn add @viaprotocol/web3-wallets
  1. After the library is installed, you can use it in your project.

(if you are using vite, you need to run it with--force param)

  1. Run the following command to remove the library, after you are done with testing:
yalc remove @viaprotocol/web3-wallets && yarn

Contributing

We useConventional Commits in our project to name commits. And we would be very grateful if you would also follow this convention.

Scope is optional.

✌🏻 Additionally, it would be cool to put emoji according toGitmoji's guide (VSCode plugin,WebStorm plugin)

  1. Fork it (https://github.com/viaprotocol/web3-wallets/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am '✨ feat: add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Any questions?

You can write us inDiscord with any questions about usage, integrations, adding new wallets, etc.


[8]ページ先頭

©2009-2025 Movatter.jp