Dero rpc command api

DERO RPC API:

The following RPC APIs have been implemented and are completely compatible(Except for few error codes/returned error messages):

Dero RPC pdf Dero_RPC_API_ENG.pdf (347.4 KB)

–DERO Daemon–:
getinfo : Return general network status
getheight : Return current block height

** DERO daemon RPC default port is 20206 on localhost.

–DERO Wallet–:
getaddress : Return wallet address
getbalance : Return wallet balance
transfer : To send Dero to another wallet-address
get_bulk_payments : Return payments with requested payment_IDs and filtered by height requested.
getheight : Return wallet height
query_key : Return seed/view key as requested
make_integrated_address : Generate Integrated_address with specified/random payment_IDs
split_integrated_address : Split Integrated_address into standard wallet address and payment_ID
get_transfer_by_txid (Only Incoming transactions supported)

** DERO wallet RPC default port is 20209 on localhost.

Notes: How to run rpc wallet.

  1. Download latest release from Dero github and start derod*.
  2. In another terminal, Run dero-wallet-cli* and restore wallet via old seed or create new wallet.
  3. Stop dero-wallet and restart wallet with following option to enable inbuilt wallet rpc-server:
    ./dero-wallet-cli* --rpc-server --wallet-file exchange-wallet1 --rpc-login “testlogin:testpassword”

Recovering wallet from old seed.

For more options and help, see command line help.

Also see: DERO Atlantis migration

1 Like

Examples of DERO RPC using curl:

curl -X POST http://127.0.0.1:20206/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'


curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getheight"}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000,"address":"dERO_address"}],"mixin":6,"get_tx_key": true}}' -H 'Content-Type: application/json'

curl --user x1:x -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["15e04b0e01bfccc0bed00f13e92ef2c17ee0b5443856e84f1f1792f597040faf"],"min_block_height":46261}}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"payment_id":"1111111122222222111111112222222211111111222222221111111122222222"}}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "dERigrYePW7F58wAs5Jn3d1N1oaJqwRxvarNJudUh95nVbZyigTja1W8Ljzp3j8VhxbB9gv3TBs4W5gnFa24cehz871i7ctYUeD2J2LeQhJib"}}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"out":true}}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true}}' -H 'Content-Type: application/json'

curl -X POST http://127.0.0.1:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json'

curl -u testlogin:testpassword -X POST http://localhost:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"15e04b0e01bfccc0bed00f13e92ef2c17ee0b5443856e84f1f1792f597040faf"}}' -H 'Content-Type: application/json'

curl -X POST http://localhost:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"15e04b0e01bfccc0bed00f13e92ef2c17ee0b5443856e84f1f1792f597040faf"}}' -H 'Content-Type: application/json'

Example of get_transfer_by_txid

curl -X POST http://localhost:20209/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"TXIDDDDDDDDDDDDDDDDDDDDDDDDDDDD"}}' -H 'Content-Type: application/json'

Output:

{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "payments": {
      "tx_hash": "TXIDDDDDDDDDDDDDDDDDDDDDDDDDDDD",
      "payment_id": "PAYMENT_IDDDDD",
      "block_height": 1836343,
      "amount": 1000000,
      "unlock_time": 0,
      "destinations": [
        {
          "amount": 90000,
          "address": "dERoADDRESS"
        },
        {
          "amount": 1000000,
          "address": "dERoADDRESS"
        }
      ],
      "type": "in"
    }
  }
}