|
|
@ -33,8 +33,8 @@ inpageProvider.setMaxListeners(100) |
|
|
|
inpageProvider.enable = function ({ force } = {}) { |
|
|
|
inpageProvider.enable = function ({ force } = {}) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
inpageProvider.sendAsync({ method: 'eth_requestAccounts', params: [force] }, (error, response) => { |
|
|
|
inpageProvider.sendAsync({ method: 'eth_requestAccounts', params: [force] }, (error, response) => { |
|
|
|
if (error) { |
|
|
|
if (error || response.error) { |
|
|
|
reject(error) |
|
|
|
reject(error || response.error) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
resolve(response.result) |
|
|
|
resolve(response.result) |
|
|
|
} |
|
|
|
} |
|
|
|