@metamask/onboarding
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -2133,2 +2133,3 @@ var MetamaskOnboarding = (function () { | ||
class Onboarding { | ||
/** | ||
@@ -2149,3 +2150,3 @@ * | ||
} else { | ||
this.downloadUrl = EXTENSION_DOWNLOAD_URL['DEFAULT']; | ||
this.downloadUrl = EXTENSION_DOWNLOAD_URL.DEFAULT; | ||
} | ||
@@ -2167,6 +2168,6 @@ | ||
async _onMessage (event) { | ||
_onMessage (event) { | ||
if (event.origin !== this.forwarderOrigin) { | ||
// Ignoring non-forwarder message | ||
return | ||
return undefined | ||
} | ||
@@ -2176,5 +2177,6 @@ | ||
return this._onMessageFromForwarder(event) | ||
} else { | ||
console.debug(`Unknown message from '${event.origin}' with data ${JSON.stringify(event.data)}`); | ||
} | ||
console.debug(`Unknown message from '${event.origin}' with data ${JSON.stringify(event.data)}`); | ||
return undefined | ||
} | ||
@@ -2203,2 +2205,3 @@ | ||
} | ||
return undefined | ||
} | ||
@@ -2252,4 +2255,6 @@ | ||
static async _register () { | ||
return window.ethereum.send('wallet_registerOnboarding') | ||
static _register () { | ||
return window.ethereum.request({ | ||
method: 'wallet_registerOnboarding', | ||
}) | ||
} | ||
@@ -2256,0 +2261,0 @@ |
@@ -43,2 +43,3 @@ 'use strict'; | ||
class Onboarding { | ||
/** | ||
@@ -59,3 +60,3 @@ * | ||
} else { | ||
this.downloadUrl = EXTENSION_DOWNLOAD_URL['DEFAULT']; | ||
this.downloadUrl = EXTENSION_DOWNLOAD_URL.DEFAULT; | ||
} | ||
@@ -77,6 +78,6 @@ | ||
async _onMessage (event) { | ||
_onMessage (event) { | ||
if (event.origin !== this.forwarderOrigin) { | ||
// Ignoring non-forwarder message | ||
return | ||
return undefined | ||
} | ||
@@ -86,5 +87,6 @@ | ||
return this._onMessageFromForwarder(event) | ||
} else { | ||
console.debug(`Unknown message from '${event.origin}' with data ${JSON.stringify(event.data)}`); | ||
} | ||
console.debug(`Unknown message from '${event.origin}' with data ${JSON.stringify(event.data)}`); | ||
return undefined | ||
} | ||
@@ -113,2 +115,3 @@ | ||
} | ||
return undefined | ||
} | ||
@@ -162,4 +165,6 @@ | ||
static async _register () { | ||
return window.ethereum.send('wallet_registerOnboarding') | ||
static _register () { | ||
return window.ethereum.request({ | ||
method: 'wallet_registerOnboarding', | ||
}) | ||
} | ||
@@ -166,0 +171,0 @@ |
{ | ||
"name": "@metamask/onboarding", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Tools to support MetaMask one-click onboarding", | ||
@@ -26,2 +26,3 @@ "main": "dist/metamask-onboarding.cjs.js", | ||
"prepublishOnly": "npm run build", | ||
"lint": "eslint .", | ||
"build": "rollup --config && rollup --config rollup.config.standalone.js" | ||
@@ -33,2 +34,5 @@ }, | ||
"devDependencies": { | ||
"@metamask/eslint-config": "^2.0.0", | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-import": "^2.20.1", | ||
"rollup": "^1.20.3", | ||
@@ -35,0 +39,0 @@ "rollup-plugin-commonjs": "^10.1.0", |
@@ -55,3 +55,5 @@ # MetaMask Onboarding | ||
onboardButton.onclick = async () => { | ||
await window.ethereum.enable() | ||
await window.ethereum.request({ | ||
method: 'eth_requestAccounts' | ||
}) | ||
} | ||
@@ -58,0 +60,0 @@ } |
@@ -39,2 +39,3 @@ import Bowser from 'bowser/src/bowser' | ||
class Onboarding { | ||
/** | ||
@@ -55,3 +56,3 @@ * | ||
} else { | ||
this.downloadUrl = EXTENSION_DOWNLOAD_URL['DEFAULT'] | ||
this.downloadUrl = EXTENSION_DOWNLOAD_URL.DEFAULT | ||
} | ||
@@ -73,6 +74,6 @@ | ||
async _onMessage (event) { | ||
_onMessage (event) { | ||
if (event.origin !== this.forwarderOrigin) { | ||
// Ignoring non-forwarder message | ||
return | ||
return undefined | ||
} | ||
@@ -82,5 +83,6 @@ | ||
return this._onMessageFromForwarder(event) | ||
} else { | ||
console.debug(`Unknown message from '${event.origin}' with data ${JSON.stringify(event.data)}`) | ||
} | ||
console.debug(`Unknown message from '${event.origin}' with data ${JSON.stringify(event.data)}`) | ||
return undefined | ||
} | ||
@@ -109,2 +111,3 @@ | ||
} | ||
return undefined | ||
} | ||
@@ -158,4 +161,6 @@ | ||
static async _register () { | ||
return window.ethereum.send('wallet_registerOnboarding') | ||
static _register () { | ||
return window.ethereum.request({ | ||
method: 'wallet_registerOnboarding', | ||
}) | ||
} | ||
@@ -162,0 +167,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
74685
2323
74
0
7