-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix/not changing the switched chain id in in app browser #288
Fix/not changing the switched chain id in in app browser #288
Conversation
|
@@ -872,7 +876,7 @@ export default class EthereumProvider | |||
async handleDisconnect(): Promise<void> { | |||
const existedSDK = (window as any).ethereum; | |||
if (existedSDK && existedSDK.isBlocto) { | |||
return existedSDK.disconnect(); | |||
return existedSDK.request({ method: 'wallet_disconnect' }); |
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.
It seems that the disconnect
function is not declared in the in-app-browser existedSDK, so I replaced it using request({ method: 'wallet_disconnect' })
@@ -907,4 +911,20 @@ export default class EthereumProvider | |||
throw ethErrors.rpc.invalidParams('Empty networkList'); | |||
} | |||
} | |||
|
|||
override on(event: string, listener: (arg: any) => void): void { | |||
if (this.existedSDK?.isBlocto) |
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 the condition if (this.existedSDK?.isBlocto)
is more concise and achieves the same effect as const existedSDK = (window as any).ethereum; if (existedSDK && existedSDK.isBlocto)
. If there are no issues, I'll replace const existedSDK = (window as any).ethereum; if (existedSDK && existedSDK.isBlocto)
with it.
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 replaced all the const existedSDK = (window as any).ethereum; if (existedSDK && existedSDK.isBlocto)
with if (this.existedSDK?.isBlocto)
in this commit refactor: enhance existedSDK check condition
0651bcd
to
484d367
Compare
e8155e5
to
44c70c7
Compare
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.
這個 proxy event 的操作可以也幫我加到 aptos provider 嗎?
solved here feat: enable aptos's existedSDK event |
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.
如果 local 測完都沒問題(adapters 也試試看) 就可以幫我 merge 然後發一版 beta 版給 @scottphc 用用看ㄛ
…in-id-in-in-app-browser chore: add changeset for #288
Summary
by adding eventListeners to the
bloctoSDK
and also adding it in the in-app browser's existedSDK,it allows invoking event functions in the in-app-browser as well.
Related Links
Asana: https://app.asana.com/0/1201812548509877/1205706441564006/f
Checklist
Prerequisite/Related Pull Requests