harmony-one / sdk

Javascript SDK of Harmony protocol.
MIT License
91 stars 44 forks source link

How to get a specific token off of the harmony blockchain #92

Closed Tailchakra closed 3 years ago

Tailchakra commented 3 years ago

Sorry for the - maybe obvious - question, but I seem to not be able to find how to address this in the documentation.

Currently I'm able to get the ONE balance off of my wallet using

      const account = new Account(
          privateKey,
          customHTTPMessenger
      );
      account.getBalance().then(response => {
          console.log(fromWei(response.balance, Units.one));
      });

Is it possible to retrieve the balance of a specific token on my wallet?

neeboo commented 3 years ago

Sorry for the - maybe obvious - question, but I seem to not be able to find how to address this in the documentation.

Currently I'm able to get the ONE balance off of my wallet using

      const account = new Account(
          privateKey,
          customHTTPMessenger
      );
      account.getBalance().then(response => {
          console.log(fromWei(response.balance, Units.one));
      });

Is it possible to retrieve the balance of a specific token on my wallet?

Specific tokens are to be fetched through contract methods. Not account class here