deezy-inc / deezy-place

decentralized marketplace for bitcoin ordinal inscriptions
https://deezy.place
89 stars 40 forks source link

Add OneKey wallet into Deezy #324

Closed Jenny0115 closed 10 months ago

netlify[bot] commented 11 months ago

Deploy Preview for deezy-place ready!

Name Link
Latest commit 1713191d4534689d1c7c02d54bb1c65a511e78d2
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.

weatherstar commented 11 months ago

@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 commented 10 months ago

@weatherstar let me know what you think of this approach: https://github.com/deezy-inc/deezy-place/pull/326

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