mirror of
https://github.com/tornadocash/provider.git
synced 2024-11-22 01:36:51 +01:00
fix: check version
This commit is contained in:
parent
cf186e3f2b
commit
11ff298672
@ -2,7 +2,7 @@ const Web3 = require('web3')
|
||||
const { hexToNumberString, toChecksumAddress, numberToHex } = require('web3-utils')
|
||||
|
||||
export default (ctx, inject) => {
|
||||
const moduleOptions = <%= JSON.stringify(options) %>
|
||||
// const moduleOptions = <%= JSON.stringify(options) %>
|
||||
|
||||
const instance = class Provider {
|
||||
constructor(options) {
|
||||
@ -16,7 +16,7 @@ export default (ctx, inject) => {
|
||||
async initProvider(provider) {
|
||||
try {
|
||||
this.provider = provider
|
||||
this.web3 = new Web3(provider)
|
||||
// this.web3 = new Web3(provider)
|
||||
|
||||
await this._checkVersion()
|
||||
return await this._initProvider()
|
||||
@ -180,7 +180,7 @@ export default (ctx, inject) => {
|
||||
async _initProvider() {
|
||||
try {
|
||||
const request = () =>
|
||||
this.version ? this.provider.enable() : this.sendRequest({ method: 'eth_requestAccounts' })
|
||||
this.version === 'old' ? this.provider.enable() : this.sendRequest({ method: 'eth_requestAccounts' })
|
||||
|
||||
const [account] = await request('')
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nuxtjs/provider",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"description": "Provider integration with Nuxt.js",
|
||||
"repository": "provider-module",
|
||||
"license": "MIT",
|
||||
|
Loading…
Reference in New Issue
Block a user