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

Announce the injected provider #227

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Announce the injected provider #227

merged 1 commit into from
Nov 19, 2024

Conversation

Lbqds
Copy link
Member

@Lbqds Lbqds commented Nov 18, 2024

Since the window.alephiumProviders is set by different wallets, when both the onekey extension wallet and the alephium extension wallet are enabled at the same time, window.alephiumProviders.alephium becomes undefined (possibly because in the onekey, window.alephiumProviders is set to non-configurable, and in the alephium wallet, window.alephiumProviders.alephium is set to non-writable). This PR adopts the EIP6963 approach to make it easier for dApps to detect injected providers.

@@ -116,12 +116,6 @@ export const alephiumWindowObject: AlephiumWindowObject =
throw Error("User aborted")
}

const { alephiumProviders } = window
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since window.alephiumProviders.alephium may be undefined, and we will detect injected providers in the dApp, we need to remove the code.

Copy link
Member

@polarker polarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@h0ngcha0 h0ngcha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Lbqds Lbqds merged commit f16a74d into master Nov 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants