Skip to content
Home » Dynex RPC & cURL Commands

Dynex RPC & cURL Commands

Blockchain Explorer API

curl https://dynex.dyndns.org/api_supply.php

EXPECTED OUTPUT:

{"already_generated_coins":"30124726.211981790"}
curl https://dynex.dyndns.org/api_header.php

EXPECTED OUTPUT:

{"block_header":{"already_generated_coins":"30125030.911970300","alt_blocks_count":28,"block_major_version":1,"contact":"","cumulative_difficulty":980016519259027,"difficulty":187887033,"fee_address":"","grey_peerlist_size":398,"height":83913,"incoming_connections_count":0,"last_known_block_index":83912,"min_tx_fee":1000000,"next_reward":304698826171,"outgoing_connections_count":7,"readable_tx_fee":"0.001000000","rpc_connections_count":2,"start_time":1671429654,"status":"OK","top_block_hash":"d26b675c9f924c12c918a0b0c04c83ecea72f7d85c94a367b85e1a38e24e6923","tx_count":162682,"tx_pool_size":24,"version":"2.2.2-20221218 (#mandatory)","version_build":"20221218","version_num":"2.2.2","version_remark":"#mandatory","white_peerlist_size":77,"hashrate":1565725.275,"max_supply":100000000000000000}}

Daemon (dynexd)

getheight

getheight() returns the height of the daemon and the network

curl http://localhost:PORT/getheight

EXPECTED OUTPUT:

{
    "height":614214,
    "network_height":614218,
    "status":"OK"
}

getinfo

getinfo() returns information related to the network and daemon connection

curl http://localhost:PORT/getinfo

EXPECTED OUTPUT:

{
    "alt_blocks_count":1,
    "difficulty":250340644,
    "grey_peerlist_size":493,
    "hashrate":8344688,
    "height":614321,
    "incoming_connections_count":28,
    "last_known_block_index":614319,
    "major_version":4,
    "minor_version":0,
    "network_height":614321,
    "outgoing_connections_count":8,
    "start_time":1531403048,
    "status":"OK",
    "supported_height":620000,
    "synced":true,
    "testnet":false,
    "tx_count":720189,
    "tx_pool_size":0,
    "upgrade_heights":[
        187000,
        350000,
        440000,
        620000,
        .....
    ],
    "version":"0.6.3",
    "white_peerlist_size":43
}

gettransactions

gettransactions() method returns list of missed transactions. “Missed transactions” are invalid transactions in the sense that they do not exist in the blockchain. Input should include the transaction hashes to check.

curl http://localhost:PORT/gettransactions

EXPECTED OUTPUT:

{
    "missed_tx":[],
    "status":"OK",
    "txs_as_hex":[]
}

getpeers

getpeers() method returns the list of peers connected to the daemon

curl http://localhost:PORT/getpeers

EXPECTED OUTPUT:

{
    "peers":[
        "192.222.157.172:11897",
        "94.23.49.75:11897",
        "112.78.10.43:11897",
        .....
    ],
    "status":"OK"
}

feeinfo

feeinfo() method returns information about the fee set for the remote node.

curl http://localhost:PORT/feeinfo

EXPECTED OUTPUT:

{
    "address":"",
    "amount":0,
    "status":"Node's fee address is not set"
}

Wallet Daemon (walletd)

reset

reset() method allows you to re-sync your wallet.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"reset","params":{"scanHeight":100000}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

save

save() method allows you to save your wallet by request.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"save","params":{}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

getViewKey

getViewKey() method returns your view key.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getViewKey","params":{}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "viewSecretKey":"xxxxx..."
  }
}

getSpendKeys

getSpendKeys() method returns your spend keys.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getSpendKeys","params":{"address":"xxxx..."}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "spendSecretKey":"xxxxx...",
    "spendPublicKey":"xxxxx..."
  }
}

getMnemonicSeed

getMnemonicSeed() method returns the mnemonic seed for the given deterministic address. A mnemonic seed is a list of words which can be used to recover a wallet.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getMnemonicSeed","params":{"address":"xxxx..."}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "mnemonicSeed":"..."
  }
}

getStatus

getStatus() method returns information about the current RPC Wallet state: block count, known block count, last block hash and peer count.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getStatus","params":{}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "blockCount":455956,
    "knownBlockCount":455955,
    "lastBlockHash":"8d6f8...",
    "peerCount":8
  }
}

getAddresses

getAddresses() method returns an array of your RPC Wallet’s addresses.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getAddresses","params":{}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "addresses":[
      "xxxx...",
      "xxxx..."
    ]
  }
}

createAddress

createAddress() method creates an additional address in your wallet.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"createAddress","params":{}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "address":"xxxx..."
  }
}

deleteAddress

deleteAddress() method deletes a specified address.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"deleteAddress","params":{"address":"xxxx..."}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

getBalance

getBalance() method returns a balance for a specified address.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getBalance","params":{"address":"xxxx..."}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "availableBalance":10000,
    "lockedAmount":0
  }
}

getBlockHashes

getBlockHashes() method returns an array of block hashes for a specified block range.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getBlockHashes","params":{"firstBlockIndex":0,"blockCount":3}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "blockHashes":[
      "7fb97...",
      "8c973...",
      "2ef06..."
    ]
  }
}

getTransactionHashes

getTransactionHashes() method returns an array of block and transaction hashes. A transaction consists of transfers. A transfer is an amount-address pair. There could be several transfers in a single transaction.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getTransactionHashes","params":{"firstBlockIndex":400000,"blockCount":100000}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "items":[
      {
        "blockHash":"f0d8c...",
        "transactionHashes":["529ea..."]
      },
      {
        "blockHash":"4a1ae...",
        "transactionHashes":["2e709..."]
      }
    ]
  }
}

getTransactions

getTransactions() method returns an array of block and transaction hashes. A transaction consists of transfers. A transfer is an amount-address pair. There could be several transfers in a single transaction.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getTransactions","params":{"firstBlockIndex":400000,"blockCount":100000}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "items":[
      {
        "blockHash":"f0d8c...",
        "transactions":[
          {
            "amount":10000,
            "blockIndex":456018,
            "extra":"01bd0...",
            "fee":10,
            "isBase":false,
            "paymentId":"b6fc6...",
            "state":0,
            "timestamp":1526458339,
            "transactionHash":"529ea...",
            "transfers":[
              {"address":"xxxx...","amount":10000,"type":0},
              {"address":"","amount":-100000,"type":0},
              {"address":"","amount":89990,"type":0}
            ],
            "unlockTime":0
          }
        ]
      },
      {
        "blockHash":"4a1ae...",
        "transactions":[
          {
            "amount":5000,
            "blockIndex":456076,
            "extra":"018c1...",
            "fee":10,
            "isBase":false,
            "paymentId":"55255...",
            "state":0,
            "timestamp":1526460243,
            "transactionHash":"2e709...",
            "transfers":[
              {"address":"xxxx...","amount":5000,"type":0},
              {"address":"","amount":-8000,"type":0},
              {"address":"","amount":2990,"type":0}
            ],
            "unlockTime":0
          }
        ]
      }
    ]
  }
}

getTransaction

getTransaction() method returns information about a particular transaction.

Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getTransaction","params":{"transactionHash":"55a23..."}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transaction":{
      "amount":5000,
      "blockIndex":456635,
      "extra":"0134b...",
      "fee":10,
      "isBase":false,
      "paymentId":"ac9c5...",
      "state":0,
      "timestamp":1526477499,
      "transactionHash":"55a23...",
      "transfers":[
        {"address":"xxxx...","amount":5000,"type":0},
        {"address":"","amount":-10000,"type":0},
        {"address":"","amount":4990,"type":0}
      ],
      "unlockTime":0
    }
  }
}

sendTransaction

sendTransaction() method allows you to send transaction(s) to one or several addresses. Also, it allows you to use a payment ID for a transaction to a single address.

curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"sendTransaction","params":{"transfers":[{"address":"xxxx...","amount":5000}],"anonymity":3,"changeAddress":"yyyy..."}}' http://localhost:8070/json_rpc

EXPECTED OUTPUT:

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transactionHash":"ae57e...",
    "fee": 4500
  }
}