feat: add stub rpc request types to provider - #237
Merged
Conversation
fbwoolf
approved these changes
Jun 3, 2022
fbwoolf
left a comment
There was a problem hiding this comment.
I don't know what the right answer is here either. The relationship does seem a bit odd. I wouldn't be opposed to moving it into the wallet for now.
Contributor
|
I think having a separate package for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the loosely-typed provider method needed for leather-io/extension#2378
I reckon there's a design problem here, though. The wallet itself is responsible for the definition its provider, so it's problematic that we first need to modify connect, before being able to modify the wallet. Conceptually, the way I see it, connect consumes the wallet. Yet, this dependency means they consume each other.
Note on direction/SIPs
Eventually, when there are many wallet providers, we may have a full SIP with a provider spec, that might also include tooling such as a distributed provider type package. This would be great. But until then, it's a headache to keep the provider implementation and corresponding types in a separate package.
Any suggestions on the best way to handle this? Metamask has the provider in a separate package. Should we do the same, or just move it to the wallet for now?