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

Add OneKey wallet into Deezy #324

Closed
wants to merge 3 commits into from
Closed

Conversation

Jenny0115
Copy link

No description provided.

Copy link

netlify bot commented Nov 21, 2023

Deploy Preview for deezy-place ready!

Name Link
🔨 Latest commit 1713191
🔍 Latest deploy log https://app.netlify.com/sites/deezy-place/deploys/655c6efa5f4d730008627cdc
😎 Deploy Preview https://deploy-preview-324.test.deezy.place
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@habibitcoin habibitcoin left a comment

Choose a reason for hiding this comment

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

Thank you! The concept is clear, but I don't think this functionally works, and actually prompts the unisat wallet instead

Is Onekey compatible with WebLN or the web3/Metamask standard? What's the easiest way to prompt the extension?

Trying to figure out if this would be another WebLN provider (similar to Alby) or a Web3 provider, which would basically be a copy of the requirements for something like Generative.xyz

We'll need to create a follow up PR on nosft-core as well https://github.com/deezy-inc/nosft-core/blob/main/src/app/wallet.ts#L16 if Onekey is a Metamask provider, it shouldn't be too difficult, and just need to make sure the onekey ethereumProvider is selected

image: "/images/logo/onekey.png",
provider: "unisat",
onClick: () => {
onConnect("unisat.io", callback);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would need to be a new identifier

@weatherstar
Copy link

weatherstar commented Nov 27, 2023

@habibitcoin Thanks for your reply and suggestions.
Let me provide some more details hera:
Since OneKey is a multi-chain wallet, and we will inject the identifier of some other wallets to connect to OneKey when some DApps do not provide OneKey entry

For example, the OneKey plug-in will inject window.ethereum and window.unisat into the page and provide same method implementations as other wallets. And we also provide window.$onekey which contains all supported chain implementations, such as

window.$onekey = {
    btc,
    ethereum,
    webln,
    tron,
    ....
  };

And the contents provided by window.$onekey.btc and window.unisat, as well as window.ethereum and window.$onekey.ethereum are the same.

Since the implementation of onekey's internal btc provider is exactly the same as unisat, according to your code, here we want to set the domain to unisat.io. This is the simplest way to work.

Or we just set

{
      name: "OneKey",
      image: "/images/logo/onekey.png",
      provider: "onekey",

      onClick: () => {
        onConnect("onekey", callback);
      }
}

and you will update the code in nosft-core to adapt to window.$onekey.btc

Which way do you think is better?

@habibitcoin
Copy link
Collaborator

@weatherstar let me know what you think of this approach: #326

I think it accomplishes the same goal, and also encourages usage of the .btc provider as opposed to the .ethereum provider

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.

None yet

3 participants