0.2.16 • Published 3 years ago
@kabbouchi/vue-web3 v0.2.16
@kabbouchi/vue-web3 - experimental
Vue 2/3 wrapper for web3 built on top of react-web3.
🚀 Quick Start
Install:
# npm
npm i @kabbouchi/vue-web3
# yarn
yarn add @kabbouchi/vue-web3
Usage:
import { useWeb3, setWeb3LibraryCallback } from '@kabbouchi/vue-web3'
import { InjectedConnector } from '@web3-react/injected-connector'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import Web3 from 'web3'
const injected = new InjectedConnector({
supportedChainIds: [1, 137],
})
const walletconnect = new WalletConnectConnector({
rpc: { 1: 'https://mainnet.infura.io/v3/YOUR_API_KEY' },
qrcode: true,
})
setWeb3LibraryCallback((provider) => new Web3(provider))
defineComponent({
setup() {
const { active, activate, account, library } = useWeb3()
const connectUsingMetamask = async () => {
await activate(injected)
}
const connectUsingWalletConnect = async () => {
await activate(walletconnect)
}
return {
active,
connect,
connectUsingMetamask,
connectUsingWalletConnect,
}
},
})
0.2.16
3 years ago
0.2.15
3 years ago
0.2.14
3 years ago
0.2.13
3 years ago
0.2.12
3 years ago
0.2.11
3 years ago
0.2.10
3 years ago
0.2.9
3 years ago
0.2.8
3 years ago
0.2.7
3 years ago
0.2.6
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago