I have run the monero-wallet-rpc using the below command:

./monero-wallet-rpc --rpc-bind-port 8080--rpc-bind-ip --prompt-for-password --wallet-file sample-wallet --rpc-login walletuser:user1234 --confirm-external-bind

When I do the below curl command, it's working fine.

curl -X POST -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -u walletuser:user1234 --digest

But when I try to call the RPC from the below javascript code, I am getting 401 Unauthorized error.

var digestRequest  = require('request-digest')('walletuser', 'user1234');
  host: '',
  path: '/json_rpc',
  port: 8080,
  method: 'POST',
  json: true,
  body: {"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}},
  headers: { "Content-Type": "application/json" }
.then(function (response) {
.catch(function (error) {

Can any one please help me to resolve this issue. Thanks in advance.

1 Answer 1


You are trying to use digest authentication in your javascript but the wallet RPC uses basic authorization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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