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

Update EIP-6963: Editorial changes #7134

Merged
merged 9 commits into from
Jun 5, 2023

Conversation

kdenhartog
Copy link
Contributor

Just some editorial updates mainly so far, still making changes as I go. Wanted to get this published so others can provide feedback as I'm finishing up.

@kdenhartog kdenhartog changed the title EIP-6963: EIP-6963: Editorial changes Jun 3, 2023
@github-actions github-actions bot added c-update Modifies an existing proposal s-draft This EIP is a Draft t-interface labels Jun 3, 2023
@eth-bot
Copy link
Collaborator

eth-bot commented Jun 3, 2023

✅ All reviewers have approved.

@eth-bot eth-bot changed the title EIP-6963: Editorial changes Update EIP-6963: Editorial changes Jun 3, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jun 3, 2023
### Provider Info

Each wallet provider will be announced with the following interface `EIP6963ProviderInfo` that will be used to display to the user:
Each wallet provider will be announced with the following interface `EIP6963ProviderInfo`. The values in the `EIP6963ProviderInfo` MUST be used as follows:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, I dropped the walletId property here because UUIDv4 + Wallet Display Name effectively achieves the same goal to uniquely identify the providers I believe. Curious to get some feedback on this change which is the only technical change in this PR at this point. I can split it out into a separate PR as well if it's a bit more controversial.

@@ -296,3 +229,100 @@ The use of SVG images introduces a cross-site scripting risk as they can include
## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).


[^rfc4122]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrouid do you care how we end up citing these RFCs? With #7113 incoming I think we can do this more easily now using the usual markdown linking normally used.


```typescript
function onPageLoad() {
const providers: EIP6963ProviderDetail[] = [];
function onPageLoad(): EIP6963ProviderDetail[] => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function onPageLoad(): EIP6963ProviderDetail[] => {
function onPageLoad() => {

Return types are inferred in TypeScript.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Shouldn’t it ideally return a cleanup function if anything though? To clean up the addEventListener

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially, but it's not required so that would be up to an implementer to decide if they want to take that approach. My goal with these changes is to rely upon the text to decide what should be done not the examples. The examples, are there more to make the text a bit more clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@jxom
Copy link
Contributor

jxom commented Jun 3, 2023

Looking good!

@kdenhartog kdenhartog marked this pull request as ready for review June 5, 2023 03:30
@kdenhartog kdenhartog requested a review from eth-bot as a code owner June 5, 2023 03:30
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

The commit 30c0d5f (as a parent of b01fb07) contains errors.
Please inspect the Run Summary for details.

### Window Event

Different wallet providers might inject their scripts at different times, plus there is no guarantees that the Ethereum library in the web page will be loaded before all injected scripts are present in the page.
In order to prevent provider collisions, the DApp and the Wallet are expected to emit an event and instantiate an eventListener to discover the various Wallet's. This forms an Event concurrency loop.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While "Wallet" is used as a term, I don't think an apostrophe is needed for pluralizing it

@eth-bot eth-bot enabled auto-merge (squash) June 5, 2023 08:24
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit 6153bfa into ethereum:master Jun 5, 2023
### Interfaces

Standardizing a provider info interface (`EIP6963ProviderInfo`) allows determining the necessary information to populate a wallet selection popup. This is particularly useful for Ethereum libraries such as Web3Modal, RainbowKit, Web3-Onboard, ConnectKit, etc.
The DApp MUST listen for the `CustomEvent` dispatched by the Wallet via a `window.dispatchEvent()` function call. In order for the DApp to discover the `EIP6963AnnounceProviderEvent` this EventListener MUST have a `type` property with the string `eip6963:requestProvider`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DApp actually listens to the "announce" event:

Suggested change
The DApp MUST listen for the `CustomEvent` dispatched by the Wallet via a `window.dispatchEvent()` function call. In order for the DApp to discover the `EIP6963AnnounceProviderEvent` this EventListener MUST have a `type` property with the string `eip6963:requestProvider`.
The DApp MUST listen for the `CustomEvent` dispatched by the Wallet via a `window.dispatchEvent()` function call. In order for the DApp to discover the `EIP6963AnnounceProviderEvent` this EventListener MUST have a `type` property with the string `eip6963:announceProvider`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-update Modifies an existing proposal s-draft This EIP is a Draft t-interface w-ci Waiting on CI to pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants