mirror of
https://github.com/status-im/EIPs.git
synced 2025-03-04 00:20:54 +00:00
Automatically merged updates to draft EIP(s) 1102
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
This commit is contained in:
parent
7c9b9d89e6
commit
63e0929de7
@ -39,14 +39,6 @@ This proposal outlines a protocol in which DOM environments expose a read-only p
|
||||
ethereum.enable(): Promise<any>
|
||||
```
|
||||
|
||||
4. **`Provider#isEnabled`**
|
||||
|
||||
Providers exposed by DOM environments define a new `isEnabled` property that is set to `true` if the user approves full provider access or `false` if the user denies full provider access.
|
||||
|
||||
```js
|
||||
ethereum.isEnabled: boolean
|
||||
```
|
||||
|
||||
### Protocol
|
||||
|
||||
DOM environments expose a read-only provider globally at `window.ethereum` by default. Before initiating any RPC request that requires an account, like `eth_sendTransaction`, dapps must request a full provider by calling a new provider method, `ethereum.enable()`. This method triggers a user interface that allows the user to approve or deny full provider access for a given dapp. If the user approves full provider access, the provider at `window.ethereum` is populated with accounts and fully-enabled; if the user denies full provider access, the provider at `window.ethereum` is left unchanged.
|
||||
@ -83,11 +75,11 @@ Dapps MUST request a full provider by calling the `enable` method on the default
|
||||
|
||||
##### `[2] RESOLVE`
|
||||
|
||||
If a user approves full provider access, DOM environments MUST expose a fully-enabled provider at `window.ethereum` that is populated with accounts. The Promise returned when calling the `enable` method MUST be resolved with an array of the user's public addresses. `Provider#isEnabled` MUST be set to `true`.
|
||||
If a user approves full provider access, DOM environments MUST expose a fully-enabled provider at `window.ethereum` that is populated with accounts. The Promise returned when calling the `enable` method MUST be resolved with an array of the user's public addresses.
|
||||
|
||||
##### `[3] REJECT`
|
||||
|
||||
If a user denies full provider access, the Promise returned when calling the `enable` method MUST be rejected with an informative Error. `Provider#isEnabled` MUST be set to `false`.
|
||||
If a user denies full provider access, the Promise returned when calling the `enable` method MUST be rejected with an informative Error.
|
||||
|
||||
### Example initialization
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user