-
Notifications
You must be signed in to change notification settings - Fork 110
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
Wallet Standard Remote Wallet #957
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we wait with merging this until we build WebBluetooth connections end-to-end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
#disconnect: StandardDisconnectMethod = async () => { | ||
// TODO: figure out why this call throws "TypeError: _a.terminateSession is not a function" | ||
// even though the session termination is actually executed (websocket closes). | ||
try { this.#wallet?.terminateSession(); } catch (e) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could stem from the remote proxy implementation of the TerminateSessionAPI interface assigning an 'any' property instead of a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm good thought, let me investigate 🦺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
I still don't love this solution of using the wallet proxy request handler to handle what is not an MWA RPC request (terminateSession
). But for now I think its the best way to add this functionality - I am thinking about a big refactor to the js impl to clean this up. the terminate session API is not exposed directly to consumers so it will be safe to refactor the implementation later on.
try { | ||
const cachedAuthorizationResult = await this.#authorizationResultCache.get(); | ||
if (cachedAuthorizationResult) { | ||
// TODO: Evaluate whether there's any threat to not `awaiting` this expression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the assumption that pubkey / cachedAuthorizationResult.accounts
shouldn't have changed at this point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, that is my understanding. this comment + logic are a hold over from the original implementation. So I left as much of the original logic as possible - for now. I basically wanted to re-wrap everything as-is into a wallet-standard lib. Once we know that is working I plan to refactor some stuff and clean up TODOs like this,
No description provided.