Skip to content

Not getting metamask prompt when interacting with smart contract when provider is JsonRPC #2184

Answered by ricmoo
redigaffi asked this question in Q&A
Discussion options

You must be logged in to vote

The MetaMask operates as an EIP-1193 provider. You cannot connect to a local socket on a users machine (which is what 127.0.0.1 refers to).

You must use MetaMask (window.Ethereum) if you want to access MetaMask itself.

I believe you can specify the chain ID if you wish, to individual methods and you should check the chain ID of the provider to make sure it matches.

But localhost is not going to work for most users. Does that make sense?

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@redigaffi
Comment options

Answer selected by redigaffi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2182 on October 18, 2021 16:58.