Skip to content

feat: add stub rpc request types to provider - #237

Merged
kyranjamie merged 1 commit into
mainfrom
feat/request-accounts
Jun 6, 2022
Merged

feat: add stub rpc request types to provider#237
kyranjamie merged 1 commit into
mainfrom
feat/request-accounts

Conversation

@kyranjamie

@kyranjamie kyranjamie commented Jun 3, 2022

Copy link
Copy Markdown
Contributor

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?

@kyranjamie
kyranjamie requested review from fbwoolf and janniks June 3, 2022 10:24

@fbwoolf fbwoolf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@aulneau

aulneau commented Jun 3, 2022

Copy link
Copy Markdown
Contributor

I think having a separate package for StacksProvider makes sense. Xverse and other wallets need to use the same thing to hook into existing apps. The sooner it can become something not directly related to any single wallet, the better imo

@janniks janniks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 for separate package

@kyranjamie
kyranjamie merged commit 0dd9ea6 into main Jun 6, 2022
@kyranjamie
kyranjamie deleted the feat/request-accounts branch June 6, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants