Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-1193: Add chainChanged event #2057

Merged
merged 5 commits into from
Jun 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions EIPS/eip-1193.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ status: Draft
type: Standards Track
category: Interface
created: 2018-06-30
requires: 155, 695, 1474
pedrouid marked this conversation as resolved.
Show resolved Hide resolved
---

## Summary
Expand Down Expand Up @@ -85,15 +86,15 @@ ethereum.on('close', listener: (code: Number, reason: String) => void): this;

The event emits with `code` and `reason`. The code follows the table of [`CloseEvent` status codes](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes).

#### networkChanged
#### chainChanged

The provider emits `networkChanged` on connect to a new network.
The provider emits `chainChanged` on connect to a new chain.

```js
ethereum.on('networkChanged', listener: (networkId: String) => void): this;
ethereum.on('chainChanged', listener: (chainId: String) => void): this;
```

The event emits with `networkId`, the new network returned from `net_version`.
The event emits with `chainId`, the new chain returned from `eth_chainId`.

#### accountsChanged

Expand Down