-
Notifications
You must be signed in to change notification settings - Fork 158
Wallet JSON RPC API, Request Accounts #2378
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
0a0a0f9 to
6a19a6f
Compare
6cc06f5 to
ee98fb4
Compare
beb2a51 to
1ac52ae
Compare
1ac52ae to
a8fc798
Compare
a8fc798 to
36374e9
Compare
5db9f56 to
89f3b43
Compare
89f3b43 to
dcab63c
Compare
dcab63c to
6fe32b4
Compare
6fe32b4 to
bcc40ab
Compare
bcc40ab to
59683e7
Compare
59683e7 to
ec36132
Compare
|
@kyranjamie this is wonderful, any expected ETA for this PR? to do something like stacksgov/sips#70 we'll want to have this kind of request accounts functionality |
f073b3c to
de8377e
Compare
de8377e to
cbd6c86
Compare
cbd6c86 to
bfc6ecb
Compare
|
I'll be picking this up as soon as I'm done with ledger bugs/issues |
bfc6ecb to
ab8a9f3
Compare
ab8a9f3 to
dd4b1a4
Compare
dd4b1a4 to
5cf51a9
Compare
8f519f5 to
93a8122
Compare
93a8122 to
bb2c367
Compare
|
came her from #2371 This functionality would be amazing for allowing development of simple apps that require hiro wallet authentication and don't have a need for nodejs other than stacks. |
bb2c367 to
b6f788c
Compare
Adds a new `request` mechanism through which dApps can interact with the wallet with a JSON RPC API. Initially, this only supports: `stx_requestAccounts`, a method that requests public key information from the wallet. chore: tidy test app, adding request accounts chore: move request account logic to new file
b6f788c to
a0edbf1
Compare
WIP.
This PR refactors the communication mechanism dApps can use to interact with the wallet. It is inspired by EIP-1102, and relates to an ongoing Wallet Protocol SIP proposal.
Rather than adding a new method to the
StacksProviderobject for each possible operation, a singlerequestmethod should be called, which sends arguments complaint with the JSON RPC Specification. This has some benefits, such as creating a universal API that can work outside of this wallet's specific context, and also simplifies the implementation, which currently requires work across multiple script contexts to add a single action.A uuid is created using
crypto.randomUUID();in the inpage script, which maps to the RPC specidfield, helping to map responses to their given request.requestmethodrequestmethodThis screencast shows the behaviour of how transaction verification works. First, we request a transaction on a clean account before we've ever given it permissions for that app:
localhost:3000. When we try again after allowingstx_requestAccounts, the transaction no longer throws an error. The exact UX/copy tbd.Kapture.2022-04-26.at.14.18.49.mp4