@metamask/inpage-provider
Advanced tools
Comparing version 5.2.1 to 6.0.0
@@ -10,2 +10,22 @@ # Changelog | ||
## [6.0.0] - 2020-07-04 | ||
### Added | ||
- The `data` event | ||
- This event was removed in `4.0.0`, as it was thought to only be used internally. | ||
This assumption was incorrect, and the event is now restored. | ||
### Changed | ||
- Restore the `notification` event value to its pre-`4.0.0` state | ||
- Prior to `4.0.0` this event was emitted by code in the MetaMask extension. | ||
Its value was inadvertently changed when it was moved to this package. | ||
## [5.2.1] - 2020-06-29 | ||
### Changed | ||
- Un-deprecate `isConnected` method. | ||
## [5.2.0] - 2020-06-24 | ||
@@ -33,3 +53,3 @@ | ||
- Reverted to pre-`4.0.0` state | ||
- Stop protecting overwrites of the following properties, that existing pre-`4.0.0`: | ||
- Stop protecting overwrites of the following properties, that existed prior to `4.0.0`: | ||
- `ethereum.isMetaMask` | ||
@@ -36,0 +56,0 @@ - `ethereum._metamask` |
{ | ||
"name": "@metamask/inpage-provider", | ||
"version": "5.2.1", | ||
"version": "6.0.0", | ||
"description": "A JavaScript Ethereum provider that connects over a WebExtension port.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,2 +59,3 @@ const pump = require('pump') | ||
close: false, | ||
data: false, | ||
networkChanged: false, | ||
@@ -172,10 +173,20 @@ notification: false, | ||
jsonRpcConnection.events.on('notification', (payload) => { | ||
if (payload.method === 'wallet_accountsChanged') { | ||
this._handleAccountsChanged(payload.result) | ||
} else if (EMITTED_NOTIFICATIONS.includes(payload.method)) { | ||
this.emit('notification', payload) // deprecated | ||
this.emit('data', payload) // deprecated | ||
const { method, params, result } = payload | ||
if (method === 'wallet_accountsChanged') { | ||
this._handleAccountsChanged(result) | ||
} else if (EMITTED_NOTIFICATIONS.includes(method)) { | ||
this.emit('message', { | ||
type: payload.method, | ||
data: payload.params, | ||
type: method, | ||
data: params, | ||
}) | ||
// deprecated | ||
if (params) { | ||
this.emit('notification', params.result) | ||
} | ||
} | ||
@@ -182,0 +193,0 @@ }) |
33706
779