Closed kyranjamie closed 2 years ago
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
This PR adds the loosely-typed provider method needed for https://github.com/hirosystems/stacks-wallet-web/pull/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?