Introduce Ethereum Wallet SDK
Connect your Dapp to all wallets in one line of code!
Why there are so many Ethereum wallets? If you have this question and you feel exhausted from integrating and testing many wallets when building Dapp, Ethereum Wallet SDK can help you! It provides the same web3 interface API that could work with many wallets, and it just needs one-line of code to install.
Contents✨Get Started
▪️ Install
▪️ Request user to choose a wallet🔧API
▪️ Connect User's Wallet
▪️ Sign Message
▪️ Send Transaction
▪️ Other API🔨Wallet Specific API
▪️ Wallet SDK
▪️ MetaMask
▪️ Dapper
▪️ Torus
▪️ Portis
▪️ Ledger
▪️ Mobile Wallets🛠Testnet📱Support Mobile
✨Get Started
Install
Simply put this line of script on your website (Dapp):
Connect User’s Wallet
You can use the familiar web3 interface API:
Result
After users select a wallet, a web3 object that connected to the user’s wallet is set!
Note: window.ethereum.enable() is based on EIP-1102 and designed by MetaMask.
🔧API
Web3 is the common API for Ethereum Blockchain. You can always access web3 throughwindow.web3
.
Every web3 instance will connect to an Ethereum Node (also called Provider). You can always get the current provider in window.ethereum
.
Get User Ethereum Account
Example 1:
or
Example 2:
Sign Message
Example:
Send Transaction
Example:
Other API
You can check the Web3 Official Document for more APIs.
🛎Notice: If the version of web3 provides by certain wallet is older (e.g. 0.2.x), it might not supports promise, so you need to use callback for the asynchronous calls.
🔨Wallet Specific API
Check the official documents of MetaMask, Torus, and Portis here.
Ledger
Ledger is a hardware crypto wallet. It connects with your computer with USB. You can get one from their website.
The SDK supports 2 paths of HD wallet, each path will create a different Ethereum account. Users can choose which one they want to use.
Trezor
Trezor is also a hardware crypto wallet. It connects with your computer with USB. You can get one from their website.
User will need to install Trezor Bridge before using Trezor to connect PC/MAC.
Mobile Wallets
Crypto Wallet SDK uses the Wallet Connect protocol to connect with mobile wallets
- To login, the SDK will show a QR Code and the user needs to use supported mobile wallets e.g. Trust Wallet or Dapp Pocket to scan it.
- After a user is connected to your Dapp, you can use the logout API to let the user log out.
Example:
⚒Testnet
You can use Testnet to test your Dapp!
For now, we recommend MetaMask. You can change the network in settings of MetaMask.
It will work fine with our SDK.👌
📱Support Mobile
The SDK supports RWD and it will only show the wallets available on your phone.
Users can use cloud wallets like Torus to login and use your Dapp in any mobile browser like Chrome!
Also, users can use mobile wallets that provide a Web3 browser like Dapp Pocket to open your Dapp and connect to it easily.
Please check our official website to see a Demo!
Welcome to join our Telegram to chat with us.
Also, it’s Open Source now!
Buidl with ❤️ by Dapp Pocket Team.