I'm looking to build a Monero web wallet, but I'm not sure how to go about querying the remote Monero nodes to get an updated balance of an address. Let's say I have the Monero private keys, how do I get the balance from a remote RPC API Monero node? What is the API call I need to make? Is there an example of how this is done?

You'll want to use the monero-wallet-rpc. Documentation for the API methods are here.

Note, this is a different application than the main Monero daemon monerod.

UPDATE based on comments:

If you don't want to work with wallet files you will need to implement something like this. You'll see it invokes a daemon RPC method /get_address_info with parameters address and view_key.

  • which of those api calls do I pass my private key to do a rescan to get a balance? – Patoshi パトシ Jun 7 at 18:23
  • You would store the wallet on the same machine as the RPC and call open_wallet the getbalance – jtgrassie Jun 7 at 18:59
  • I don't want to store my wallet on the same machine. I want to make something like mymonero web wallet where I can just get the balance of a private key. Say I have 100 users on my web application and each one has their own monero private key. How would I update the balance for each of these users? What is the RPC api call where I can pass in the private key to do a scan to get the total balance like how monero mobile wallets do it now. – Patoshi パトシ Jun 7 at 20:01
  • If you are going to hold their private keys why not the wallet? – jtgrassie Jun 7 at 20:11
  • their private keys will be generated on their local device... – Patoshi パトシ Jun 7 at 20:15

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.