Skip to content

Commit 8564ace

Browse files
pedrouidBelfordZ
authored andcommitted
Automatically merged updates to draft EIP(s) 1193 (ethereum#2057)
Hi, I'm a bot! This change was automatically merged because: - It only modifies existing Draft or Last Call EIP(s) - The PR was approved or written by at least one author of each modified EIP - The build is passing
1 parent f149400 commit 8564ace

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

EIPS/eip-1193.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ status: Draft
77
type: Standards Track
88
category: Interface
99
created: 2018-06-30
10+
requires: 155, 695, 1102, 1474
1011
---
1112

1213
## Summary
@@ -68,6 +69,16 @@ ethereum.on('close', listener: (code: Number, reason: String) => void): this;
6869

6970
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).
7071

72+
#### chainChanged
73+
74+
The provider emits `chainChanged` on connect to a new chain.
75+
76+
```js
77+
ethereum.on('chainChanged', listener: (chainId: String) => void): this;
78+
```
79+
80+
The event emits with `chainId`, the new chain returned from `eth_chainId`.
81+
7182
#### networkChanged
7283

7384
The provider emits `networkChanged` on connect to a new network.
@@ -195,6 +206,10 @@ If the network connects, the Ethereum Provider **MUST** emit an event named `con
195206

196207
If the network connection closes, the Ethereum Provider **MUST** emit an event named `close` with args `code: Number, reason: String` following the [status codes for `CloseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes).
197208

209+
#### chainChanged
210+
211+
If the chain the provider is connected to changes, the provider **MUST** emit an event named `chainChanged` with args `chainId: String` containing the ID of the new chain (using the Ethereum JSON-RPC call `eth_chainId`).
212+
198213
#### networkChanged
199214

200215
If the network the provider is connected to changes, the provider **MUST** emit an event named `networkChanged` with args `networkId: String` containing the ID of the new network (using the Ethereum JSON-RPC call `net_version`).

0 commit comments

Comments
 (0)