1

I want to transfer money using the transfer method.

I run the method and get JSON:

{
  "error": {
    "code": -17,
    "message": "not enough money"
  },
  "id": "0",
  "jsonrpc": "2.0"
}

This is very strange, since the money went anyway.

Why after calling the transfer method I don't get a JSON response according to the monero documentation? After all, the JSON response should be something like this:

{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "amount": 300000000000,
    "fee": 86897600000,
    "multisig_txset": "",
    "tx_blob": "",
    "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9",
    "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803",
    "tx_metadata": "",
    "unsigned_txset": ""
  }
}

My operating system is Win10, and to run monero-wallet-rpc, I use this

monero-wallet-rpc.exe --prompt-for-password --wallet-file expo.keys --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18081 --log-level 2 --daemon-address 127.0.0.1:18080 --disable-rpc-login

В итоге ответы JSON приходят от всех методов кроме transfer. Помогите пожалуйста!

As a result, JSON responses come from all methods except transfer. Please help me!

1 Answer 1

2

All the JSON responses are formatted in that way if the JSON RPC calls are successful. In case of any problems (wrong method, invalid parameters) the Monero Wallet RPC returns a JSON error which contains the error code and the message.

In this case, Wallet RPC sent you an error since the balance was not enough to make the transfer. Are you sure you did not asked a wrong value of XMR? Please note that the amount should be defined without fees.

Another case would be sending two requests of transfer very close together. The wallet might have executed the first one, and then the second one returning the error.

Your Answer

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

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