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-1102: update injected provider variable name #1243

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions EIPS/eip-1102.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Dapps MUST request an Ethereum provider API by sending a message using the [`win

#### `[2] INJECT`

Ethereum-enabled DOM environments MUST expose an Ethereum provider API as a global `ETHEREUM_PROVIDER` variable on the `window` object.
Ethereum-enabled DOM environments MUST expose an Ethereum provider API as a global `ethereum` variable on the `window` object.

#### `[3] NOTIFY`

Expand All @@ -71,7 +71,7 @@ window.addEventListener('message', function (event) {
if (!event.data || !event.data.type) { return; }
if (event.data.type === 'ETHEREUM_PROVIDER_SUCCESS') {
// Provider API exposed, continue
const networkVersion = await ETHEREUM_PROVIDER.send('net_version', []);
const networkVersion = await ethereum.send('net_version', []);
console.log(networkVersion);
}
});
Expand Down