Skip to content

Commit

Permalink
Add CHANGELOG; update README (#35)
Browse files Browse the repository at this point in the history
* Add CHANGELOG
* Update README
  • Loading branch information
rekmarks authored Apr 22, 2020
1 parent cfe9527 commit 4a85035
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [5.0.0] - 2020-04-22

### Added

- The [most recent EIP 1193 API](https://github.com/ethereum/EIPs/blob/89e373d5d3a62a28f2646830247579f323ef6b40/EIPS/eip-1193.md) ([#30](https://github.com/MetaMask/metamask-inpage-provider/pull/30))
- The method `request`
- The events `disconnect` and `message`
- A global initialization event, `ethereum#initialized`, for
asynchronous injection ([#31](https://github.com/MetaMask/metamask-inpage-provider/pull/31))
- Helper methods for initializing the provider ([#31](https://github.com/MetaMask/metamask-inpage-provider/pull/31))

### Changed

- **BREAKING:** Use named instead of default exports ([#31](https://github.com/MetaMask/metamask-inpage-provider/pull/31))
- **BREAKING:** `MetaMaskInpage` constructor now takes a `connectionStream` and an
options object ([#31](https://github.com/MetaMask/metamask-inpage-provider/pull/31))
- **BREAKING:** `_metamask.sendBatch` -> `_metamask.requestBatch` ([#30](https://github.com/MetaMask/metamask-inpage-provider/pull/30))
- **BREAKING:** Revert `send` to match provider in v7.7.8 of `metamask-extension` ([#29](https://github.com/MetaMask/metamask-inpage-provider/pull/29))
- The `connect` event now emits with a `ProviderConnectInfo` object per EIP 1193 ([#30](https://github.com/MetaMask/metamask-inpage-provider/pull/30))
- Deprecated the `send` method ([#30](https://github.com/MetaMask/metamask-inpage-provider/pull/30))
- Deprecated the events `close`, `networkChanged`, and `notification`, and
added deprecation warnings for them ([#30](https://github.com/MetaMask/metamask-inpage-provider/pull/30))
- Un-deprecated `sendAsync` ([#29](https://github.com/MetaMask/metamask-inpage-provider/pull/29))
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# MetaMask Inpage Provider

Used to initialize the inpage ethereum provider injected by MetaMask.
The inpage Ethereum provider object injected by MetaMask into web pages.
Contains a lot of implementation details specific to MetaMask, and is probably
not suitable for out-of-the-box use with other wallets.

## Installation

Expand All @@ -9,12 +11,18 @@ Used to initialize the inpage ethereum provider injected by MetaMask.
## Usage

```javascript
import { initProvider } from 'metamask-inpage-provider'

// Create a stream to a remote provider:
var metamaskStream = new LocalMessageDuplexStream({
const metamaskStream = new LocalMessageDuplexStream({
name: 'inpage',
target: 'contentscript',
})

// compose the inpage provider
var inpageProvider = new MetamaskInpageProvider(metamaskStream)
// this will initialize the provider and set it as window.ethereum
initProvider({
connectionStream: metamaskStream,
})

const { ethereum } = window
```

0 comments on commit 4a85035

Please sign in to comment.