Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate connect to RPC based APIs #399

Open
kyranjamie opened this issue Jan 7, 2025 · 10 comments
Open

Migrate connect to RPC based APIs #399

kyranjamie opened this issue Jan 7, 2025 · 10 comments
Assignees

Comments

@kyranjamie
Copy link
Contributor

@stacks/connect continues to wrap the JWT-based calls used by Leather, Xverse etc.

These wallets now support RPC specs for Bitcoin requests, and the direction proposed in @janniks SIP is that Stacks follows suit stacksgov/sips#166

Developers are finding it difficult to migrate to the new APIs, and would rather continue to use @stacks/connect. This is easier than interacting with wallets directly via their injected provider.

It should be considered what is involved to upgrade @stacks/connect to the new RPC-based APIs. Perhaps it's best to just push a new breaking version, and prompt developers to update their apps. Another option would be to run both in parallel during, so that developers can incrementally opt-in during the transitionary phase.

This change would also be a motivating factor for wallets to prioritise the new Stacks APIs.

@janniks janniks added this to DevTools Jan 14, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Jan 14, 2025
@janniks janniks moved this from 🆕 New to 🏗 In Progress in DevTools Jan 14, 2025
@janniks janniks self-assigned this Jan 14, 2025
@friedger
Copy link
Contributor

The minimum would be a UI where users can choose the Wallet from when getAddresses is called. It would be nice to have a consistent UX across all apps.

@markmhendrickson
Copy link
Contributor

@friedger we have this in Leather now

Image Image

@friedger
Copy link
Contributor

@markmhendrickson My request is about choosing the wallet provider (leather, xverse, asigna, ...) not the account, sorry.

Arkadiko is showing this screen:

Image

@markmhendrickson
Copy link
Contributor

Ah I presume the current Connect dialog would still work?

Image

@friedger
Copy link
Contributor

How can I open it and what do I get back? The result should be stored by the app and reused for the rpc calls.

@markmhendrickson
Copy link
Contributor

I presume the showConnect method these days, but others can confirm.

@friedger
Copy link
Contributor

showConnect shows the dialog AND calls authenticate (with wrapping in JWT). Connect does not use rpc calls as far as I can see.

@friedger
Copy link
Contributor

I missed the ongoing work here: #403
Then showConnect makes sense.

@janniks
Copy link
Collaborator

janniks commented Jan 21, 2025

Yes, to make it easier to switch we'll have a version of connect which is almost the same as the JWT flow for most apps.

Let me know if there's an open-source app you have that I can update to test if everything works as expected, happy to add those changes in a PR.

For the raw request flow, connect will also have helpers which are like a "ui request" call where we first pick a wallet if non is selected before the request is routed to the wallet. Will update the .md files in the mentioned PR today.

@friedger
Copy link
Contributor

@janniks This one is the most used: sendstx.com: https://github.com/friedger/stacks-send-many
This is that I want to publish soon: https://github.com/friedger/stacks-swaps/tree/sbtc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

4 participants