0.7.28 • Published 7 years ago
walletconnect-web3-provider v0.7.28
WalletConnect Web3 Provider
This implements provider for walletconnect standard.
You can read more about WalletConnect standard here: http://walletconnect.org/
Example
import Web3 from 'web3'
import WalletConnectProvider from 'walletconnect-web3-provider'
/**
* Create WalletConnect Provider
*/
const provider = new WalletConnectProvider({
bridgeUrl: 'https://test-bridge.walletconnect.org', // Required
dappName: 'INSERT_DAPP_NAME', // Required
rpcUrl:'http://localhost:8545' // Required
}
/**
* Create Web3
*/
const web3 = new Web3(provider)
/**
* Initiate WalletConnect Session
*/
const session = await web3.currentProvider.walletconnect.initSession()
/**
* Get Accounts
*/
const accounts = await web3.eth.getAccounts()
if (!accounts.length) {
// Display QR Code URI
const uri = web3.currentProvider.walletconnect.uri
// Listen for session status
await web3.currentProvider.walletconnect.listenSessionStatus()
// Get Accounts Again
accounts = await web3.eth.getAccounts()
}
/**
* Send Transaction
*/
const txHash = await web3.eth.sendTransaction(tx)
/**
* Sign Transaction
*/
const signedTx = await web3.eth.signTransaction(tx)
/**
* Sign Message
*/
const signedMessage = await web3.eth.sign(msg)
/**
* Sign Typed Data
*/
const signedTypedData = await web3.eth.signTypedData(msg)
0.7.28
7 years ago
0.7.27
7 years ago
0.7.26
7 years ago
0.7.25
7 years ago
0.7.24
7 years ago
0.7.22
7 years ago
0.7.21
7 years ago
0.7.17
7 years ago
0.7.16
7 years ago
0.7.14
7 years ago
0.7.13
7 years ago
0.7.12
7 years ago
0.7.11
7 years ago
0.7.10
7 years ago
0.7.9
7 years ago
0.7.8
7 years ago
0.7.7
7 years ago
0.7.6
7 years ago
0.7.5
7 years ago
0.7.4
7 years ago
0.7.3
7 years ago
0.7.2
7 years ago
0.0.1-beta6
7 years ago