-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Test] Patch in EIP-6963 support #19320
Conversation
@@ -55,9 +58,21 @@ if (shouldInjectProvider()) { | |||
target: CONTENT_SCRIPT, | |||
}); | |||
|
|||
initializeProvider({ | |||
const MetaMaskEIP6963ProviderInfo = { | |||
walletId: 'io.metamask', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be based on the build type. io.metamask
for stable, io.metamask.flask
for Flask etc.
walletId: 'io.metamask', | ||
uuid: uuid(), | ||
name: 'MetaMask', | ||
icon: 'https://raw.githubusercontent.com/MetaMask/brand-resources/cb6fd847f3a9cc5e231c749383c3898935e62eab/SVG/metamask-fox.svg', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to find a better URL for this, but this works.
announceProvider({ | ||
info: MetaMaskEIP6963ProviderInfo, | ||
provider, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Announce immediately after instantiating the provider object and setting it as window.ethereum
.
@@ -34,7 +34,10 @@ cleanContextForImports(); | |||
import log from 'loglevel'; | |||
import { WindowPostMessageStream } from '@metamask/post-message-stream'; | |||
import { initializeProvider } from '@metamask/providers/dist/initializeInpageProvider'; | |||
import { v4 as uuid } from 'uuid'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will increase the size of the injected script by <12kb unless we tree shake.
This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions. |
This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions. |
Do not merge