Improve connector abstraction
See original GitHub issueAt the moment the connector abstraction is very bare bone, consisting only of the InjectedConnector
class (and the proposed testing connector in #54). Now we have a new wallet (see #77) and so it makes sense to improve what is available.
As a React library we have a few of design goals:
- Give maximum control to developers when it comes to the UI and UX of their application. Embedding a modal is sub-optimal IMHO, ready-made wallet pickers should be developed on top of this library and not the other way round.
- Support future non-injected wallets like Wallet Connect.
- Improve discoverability, so for example show wallets that the user has not installed but the developer wants to push.
- Support all kind of injected wallets, without the developer having to manually add them.
Point 3 and 4 are at odds so there’s going to be tradeoffs.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to Implement Software Connectors? A Reusable ...
The goal of this paper is to propose a better way to implement abstract connectors. In the remainder of this article, section 2...
Read more >How to Implement Software Connectors? A ... - ResearchGate
For a better reuse of design effort, and to avoid using only simple connectors when realizing applications, we propose to define connectors as ......
Read more >How to Implement Software Connectors? A ... - Springer Link
In this article, we propose a means to fill the gap between connector specification and implementation. For a better reuse of design effort,...
Read more >Increasing the Level of Abstraction as a Strategy for ...
In this paper, we propose increasing levels of abstraction as a strategy for speeding the adoption of new technologies.
Read more >Ports, Components, and Connectors: the next great abstraction?
Agilest will argue that feedback from actual running code is the best way to battle complexity and scale. Tighten the feedback loop with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think the best way forward is to continue improving on the connectors interface we have. There should be a way to list StarkNet wallets installed by the user (for example, have a global dictionary
window.starknetWallet[id] => wallet
) that we can leverage when building connectors. Then we would add:ArgentConnector
,BraavosConnector
, etc).Then we can update the current API to something like:
The modal component would use the available connectors as follows:
I think having a global injected registry of wallets would also be beneficial to the wallets since they can control branding by providing an icon and homepage url.
I believe that refactoring get-starknet “core” APIs into a dedicated package under the same repo (i.e.
get-starknet/core
) will answer most of the points raised above. flexibility, no UI, lookup installed wallets, discovery for available (non-installed) wallets, wallets order/include/exclude options for dapps, aligning wallet APIs for easier dapps<->wallet integrations, unified types, etc.