MetaMask / providers

An Ethereum Provider that connects over a stream, as injected into websites by MetaMask
MIT License
217 stars 123 forks source link

Implement EIP-6963 #263

Closed rekmarks closed 9 months ago

rekmarks commented 1 year ago

Implements EIP-6963 according to the current state of the specification. Adds two new top-level imports, eip6963AnnounceProvider and eip6963RequestProvider, used by us and the dapp, respectively.

For reference, here are some EIP6963ProviderInfo values that would work for us:

export const MetaMaskEIP6963ProviderInfo: EIP6963ProviderInfo = {
  uuid: uuid(),
  name: 'MetaMask', // Update depending on the build, probably
  icon: 'https://raw.githubusercontent.com/MetaMask/brand-resources/cb6fd847f3a9cc5e231c749383c3898935e62eab/SVG/metamask-fox.svg', // TODO: Find a shorter URL
};

The purpose of the uuid field is to help dapps notice if multiple wallets are claiming the same name. It needs to be a valid v4 UUID. IMO we should create a UUID at the point where we call announceProvider (i.e. the content script for the extension). We could also send it from the background.

socket-security[bot] commented 1 year ago

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

socket-security[bot] commented 1 year ago

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

jiexi commented 9 months ago

This should be caught up to spec now