harmony-one / chrome-extension-wallet

Harmony Chrome Extension Wallet
https://chrome.google.com/webstore/detail/harmony-one-wallet/fnnegphlobjdpkhecapkijjdkgcjhkib
60 stars 36 forks source link

DAPP Login #79

Closed newcodepusher closed 2 years ago

newcodepusher commented 3 years ago

Hi, login does not work, I tried your example from the documentation

var harmony = await new HarmonyExtension(window.onewallet);
const account = await hmyEx.login()
    .then((acc) => {
      console.log(acc);
    })
    .catch((err) => {
      console.error(err);
    });

but the same code works with MathWallet, for your wallet need a different approach?

And I tried using wallet in IDE Remix and also only MathWallet works

I trying Harmony One Wallet 1.0.6.1 on Google Chrome 86.0.4240.75 Ubuntu 18.04

deblanco commented 3 years ago

Hi, I'm facing the same issue, I tried to run the same login approach using the interface that the Wallet Plugin injects on window:

image

Seems that the promise never resolves.

imyugioh commented 3 years ago

@deblanco @alanwilhelm @newcodepusher can you install this extension? https://chrome.google.com/webstore/detail/harmony-one-wallet/fnnegphlobjdpkhecapkijjdkgcjhkib And this code should work. I've tested just now.

const { HarmonyExtension } = require("@harmony-js/core");
const harmonyExt = await new HarmonyExtension(window.onewallet);
await harmonyExt
        .login()
        .then((acc) => {
          //Todo with the account
        })
        .catch((err) => {
          console.error(err);
        });

Let me know if you have any questions

alanwilhelm commented 3 years ago

Let me know if you have any questions

I still have the same problem. The promise just hangs forever.

alanwilhelm commented 3 years ago

Removing the plugin and reinstalling it, even tho it appears to be the same version did indeed help.

deblanco commented 3 years ago

Removing the plugin and reinstalling it, even tho it appears to be the same version did indeed help.

I noticed with only disabling and enabling again the Plugin make it works 😩