mirror of
https://github.com/tornadocash/provider.git
synced 2024-11-21 17:26:51 +01:00
feat: injected request function
change version to 0.1.3
This commit is contained in:
parent
170d58e067
commit
8d7c3f9e34
@ -197,9 +197,13 @@ export default (ctx, inject) => {
|
|||||||
|
|
||||||
async _initProvider() {
|
async _initProvider() {
|
||||||
try {
|
try {
|
||||||
const request = () =>
|
let request = () =>
|
||||||
this.version === 'old' ? this.provider.enable() : this.sendRequest({ method: 'eth_requestAccounts' })
|
this.version === 'old' ? this.provider.enable() : this.sendRequest({ method: 'eth_requestAccounts' })
|
||||||
|
|
||||||
|
if (this.provider.injectedRequest && typeof this.provider.injectedRequest === 'function') {
|
||||||
|
request = () => this.provider.injectedRequest()
|
||||||
|
}
|
||||||
|
|
||||||
const [account] = await request()
|
const [account] = await request()
|
||||||
|
|
||||||
if (!account) {
|
if (!account) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxt-web3-provider",
|
"name": "nuxt-web3-provider",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"description": "Provider integration with Nuxt.js",
|
"description": "Provider integration with Nuxt.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
Reference in New Issue
Block a user