From 8564ace64aaa9c2d38d47dba3bed7f4a7122ab5d Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 27 Jun 2019 07:45:08 +0200 Subject: [PATCH] Automatically merged updates to draft EIP(s) 1193 (#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 --- EIPS/eip-1193.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/EIPS/eip-1193.md b/EIPS/eip-1193.md index e2e51a4827d254..06e387c57c61b4 100644 --- a/EIPS/eip-1193.md +++ b/EIPS/eip-1193.md @@ -7,6 +7,7 @@ status: Draft type: Standards Track category: Interface created: 2018-06-30 +requires: 155, 695, 1102, 1474 --- ## Summary @@ -68,6 +69,16 @@ 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). +#### chainChanged + +The provider emits `chainChanged` on connect to a new chain. + +```js +ethereum.on('chainChanged', listener: (chainId: String) => void): this; +``` + +The event emits with `chainId`, the new chain returned from `eth_chainId`. + #### networkChanged 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 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). +#### chainChanged + +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`). + #### networkChanged 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`).