From f7e7b5f607059f3b441228a2c48593a8222a7867 Mon Sep 17 00:00:00 2001 From: erciccione Date: Fri, 1 May 2020 11:09:04 +0200 Subject: [PATCH] Remove translations of developer guides and remove the possibility to translate them. The 2 dev guides ('wallet RPC' and 'Daemon RPC') are now available only in English --- README.md | 2 +- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- _i18n/en.yml | 4 +- .../resources/developer-guides/daemon-rpc.md | 2376 ------------- .../resources/developer-guides/wallet-rpc.md | 2960 ---------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2732 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 834 ----- .../resources/developer-guides/wallet-rpc.md | 1217 ------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2378 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- .../resources/developer-guides/daemon-rpc.md | 2377 ------------- .../resources/developer-guides/wallet-rpc.md | 2734 --------------- resources/developer-guides/daemon-rpc.md | 2384 ++++++++++++- resources/developer-guides/index.md | 4 +- resources/developer-guides/wallet-rpc.md | 2969 ++++++++++++++++- 31 files changed, 5342 insertions(+), 63637 deletions(-) delete mode 100644 _i18n/ar/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/ar/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/de/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/de/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/en/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/en/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/es/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/es/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/fr/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/fr/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/it/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/it/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/nl/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/nl/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/pl/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/pl/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/pt-br/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/pt-br/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/ru/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/ru/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/tr/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/tr/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/zh-cn/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/zh-cn/resources/developer-guides/wallet-rpc.md delete mode 100644 _i18n/zh-tw/resources/developer-guides/daemon-rpc.md delete mode 100644 _i18n/zh-tw/resources/developer-guides/wallet-rpc.md diff --git a/README.md b/README.md index 2c637a9c..970aa00b 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ We ask that if you open an issue on the site that you remain available for clari ## Updates on User Guides User guides and developer guides may need regular updates, either to fix typos, to add explanations regarding new features, to update screenshots, and so on. As those guides are translated in several languages, it could be hard to keep all languages version up to date with the English version. -To keep track of those changes, guides are versioned using a snippet at the top of each localized (\_i18n/en/resources/\*-guides) file: +To keep track of those changes, the user guides (but not the developer guides) are versioned using a snippet at the top of each localized (\_i18n/en/resources/\*-guides) file: ``` {% assign version = '1.1.0' | split: '.' %} ``` diff --git a/_i18n/ar/resources/developer-guides/daemon-rpc.md b/_i18n/ar/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/ar/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/ar/resources/developer-guides/wallet-rpc.md b/_i18n/ar/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/ar/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/de/resources/developer-guides/daemon-rpc.md b/_i18n/de/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/de/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/de/resources/developer-guides/wallet-rpc.md b/_i18n/de/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/de/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/en.yml b/_i18n/en.yml index ee8dc5c2..d7caab50 100644 --- a/_i18n/en.yml +++ b/_i18n/en.yml @@ -482,9 +482,9 @@ developer-guides: outdated: "Methods are often added / removed / updated and may not be accurately described." rpc: RPC Documentation daemonrpc: Daemon RPC - daemonrpc_descr: RPC calls for the daemon. Including input, outputs and examples. + daemonrpc_descr: RPC calls for the daemon. Including input, outputs and examples. In English. walletrpc: Wallet RPC - walletrpc_descr: monero-wallet-rpc calls. Including input, outputs and examples. + walletrpc_descr: monero-wallet-rpc calls. Including input, outputs and examples. In English. external: External resources external_head: Useful docs and resources maintained by community members. monerodocs: Comprehensive resource which aims to organize the technical knowledge about Monero. Some sections might be outdated. diff --git a/_i18n/en/resources/developer-guides/daemon-rpc.md b/_i18n/en/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 6e602451..00000000 --- a/_i18n/en/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2376 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/en/resources/developer-guides/wallet-rpc.md b/_i18n/en/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index ee713990..00000000 --- a/_i18n/en/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2960 +0,0 @@ -{% assign version = '2.4.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [set_daemon](#set_daemon) -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [validate_address](#validate_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [describe_transfer](#describe_transfer) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [edit_address_book](#edit_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [auto_refresh](#auto_refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [restore_deterministic_wallet](#restore_deterministic_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **set_daemon** - -Connect the RPC server to a Monero daemon. - -Inputs: - -* *address* - string; (Optional; Default: "") The URL of the daemon to connect to. -* *trusted* - boolean; (Optional; Default: false) If false, some RPC wallet methods will be disabled. -* *ssl_support* - string; (Optional; Default: autodetect; Accepts: disabled, enabled, autodetect) Specifies whether the Daemon uses SSL encryption. -* *ssl_private_key_path* - string; (Optional) The file path location of the SSL key. -* *ssl_certificate_path* - string; (Optional) The file path location of the SSL certificate. -* *ssl_ca_file* - string; (Optional) The file path location of the certificate authority file. -* *ssl_allowed_fingerprints* - array of string; (Optional) The SHA1 fingerprints accepted by the SSL certificate. -* *ssl_allow_any_cert* - boolean; (Optional; Default: false) If false, the certificate must be signed by a trusted certificate authority. - -Outputs: -* *None* - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_daemon","params": {"address":"http://localhost:18081","trusted":true,"ssl_support":"enabled","ssl_private_key_path":"path/to/ssl/key","ssl_certificate_path":"path/to/ssl/certificate","ssl_ca_file":"path/to/ssl/ca/file","ssl_allowed_fingerprints":["85:A7:68:29:BE:73:49:80:84:91:7A:BB:1F:F1:AD:7E:43:FE:CC:B8"],"ssl_allow_any_cert":true}},' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### validate_address - -Analyzes a string to determine whether it is a valid monero wallet address and returns the result and the address specifications. - -Inputs: - -* *address* - string; The address to validate. -* *any_net_type* - boolean (Optional); If true, consider addresses belonging to any of the three Monero networks (mainnet, stagenet, and testnet) valid. Otherwise, only consider an address valid if it belongs to the network on which the rpc-wallet's current daemon is running (Defaults to false). -* *allow_openalias* - boolean (Optional); If true, consider [OpenAlias-formatted addresses](https://web.getmonero.org/resources/moneropedia/openalias.html) valid (Defaults to false). - -Outputs: -* *valid* - boolean; True if the input address is a valid Monero address. -* *integrated* - boolean; True if the given address is an [integrated address](https://web.getmonero.org/resources/moneropedia/address.html). -* *subaddress* - boolean; True if the given address is a [subaddress](https://github.com/monero-project/monero/pull/2056) -* *nettype* - string; Specifies which of the three Monero networks (mainnet, stagenet, and testnet) the address belongs to. -* *openalias_address* - boolean; True if the address is [OpenAlias-formatted](https://web.getmonero.org/resources/moneropedia/openalias.html). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"validate_address", params={"address":"42go2d3XqA9Mx4HjZoqr93BHspcMxwAUBivs3yJKV1FyTycEcbgjNyEaGNEcgnUE9DDDAXNanzB16YgMt88Sa8cFSm2QcHK","any_net_type":"true","allow_openalias":"true"},' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "valid": true, - "integrated": false, - "subaddress": false, - "nettype": "mainnet", - "openalias_address": false - } -} -``` - - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (defaults to false) Include incoming transfers. -* *out* - boolean; (defaults to false) Include outgoing transfers. -* *pending* - boolean; (defaults to false) Include pending transfers. -* *failed* - boolean; (defaults to false) Include failed transfers. -* *pool* - boolean; (defaults to false) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Optional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **describe_transfer** - -Returns details for each transaction in an unsigned or multisig transaction set. Transaction sets are obtained as return values from one of the following RPC methods: -* transfer -* transfer_split -* sweep_all -* sweep_single -* sweep_dust - -These methods return unsigned transaction sets if the wallet is view-only (i.e. the wallet was created without the private spend key). - -Inputs: - -* *unsigned_txset* - string; (Optional) A hexadecimal string representing a set of unsigned transactions (empty for multisig transactions; non-multisig signed transactions are not supported). -* *multisig_txset* - string; (Optional) A hexadecimal string representing the set of signing keys used in a multisig transaction (empty for unsigned transactions; non-multisig signed transactions are not supported). - -Outputs: -* *desc* - The description of the transfer as a list of: - * *amount_in* - unsigned int (64 bit); The sum of the inputs spent by the transaction in @atomic-units. - * *amount_out* - unsigned int (64 bit); The sum of the outputs created by the transaction in @atomic-units. - * *recipients* - list of: - * *address* - string; The public address of the recipient. - * *amount* - unsigned int; The amount sent to the recipient in @atomic-units. - * *change_address* - string; The address of the change recipient. - * *change_amount* - unsigned int; The amount sent to the change address in @atomic-units. - * *fee* - unsigned int; The fee charged for the transaction in @atomic-units. - * *payment_id* - string; payment ID for this transfer (empty if not provided. - * *ring_size* - unsigned int; The number of inputs in the ring (1 real output + the number of decoys from the blockchain). - * *unlock_time* - unsigned int; The number of blocks before the monero can be spent (0 for no lock). - * *dummy_outputs* - unsigned int; The number of fake outputs added to single-output transactions. Fake outputs have 0 amount and are sent to a random address. - * *extra* - string; Arbitrary transaction data in hexadecimal format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"describe_transfer","params":{"unsigned_txset":"...long hex..."}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "desc": [{ - "amount_in": 886489038634812, - "amount_out": 886455352051344, - "change_address": "5BqWeZrK944YesCy5VdmBneWeaSZutEijFVAKjpVHeVd4unsCSM55CjgViQsK9WFNHK1eZgcCuZ3fRqYpzKDokqSUmQfJzvswQs13AAidJ", - "change_amount": 4976287087263, - "dummy_outputs": 0, - "extra": 01b998f16459bcbac9c92074d3128d10724f10b74f5a7b1ec8e5a1e7f1150544020209010000000000000000", - "fee": 33686583468, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000", - "recipients": [{ - "address": "0b057f69acc1552014cb157138e5c4dd495347d333f68ff0af70494b979aed10", - "amount": 881479064964081 - }], - "ring_size": 11, - "unlock_time": 0 - ]} - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **edit_address_book** - -Edit an existing address book entry. - -Alias: *None* - -Inputs: - -* *index* - unsigned_int; Index of the address book entry to edit. -* *set_address* - boolean; If true, set the address for this entry to the value of "address". -* *address* - string; (Optional) The 95-character public address to set. -* *set_description* - boolean; If true, set the description for this entry to the value of "description". -* *description* - string; (Optional) Human-readable description for this entry. -* *set_payment_id* - boolean; If true, set the payment ID for this entry to the value of "payment_id". -* *payment_id* - string; (Optional) Payment ID for this address. - -Outputs: *none*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"edit_address_book","params":{"index":0, "set_address":true, "address":"0b057f69acc1552014cb157138e5c4dd495347d333f68ff0af70494b979aed10", "set_payment_id":true, "payment_id":"60900e5603bf96e3", "set_description":true, "description":"Example description."}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **auto_refresh** - -Set whether and how often to automatically refresh the current wallet. - -Inputs: - -* *enable* - boolean; (Optional) Enable or disable automatic refreshing (default = true). -* *period* - unsigned integer; (Optional) The period of the wallet refresh cycle (i.e. time between refreshes) in seconds. - -Outputs: *none*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"auto_refresh","params":{"enable":true, "period":10}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **restore_deterministic_wallet** - -Create and open a wallet on the RPC server from an existing mnemonic phrase and close the currently open wallet. - -Alias: *None*. - -Inputs: - -* *name* - string; Name of the wallet. -* *password* - string; Password of the wallet. -* *seed* - string; Mnemonic phrase of the wallet to restore. -* *restore_height* - integer; (Optional) Block height to restore the wallet from (default = 0). -* *language* - string; (Optional) Language of the mnemonic phrase in case the old language is invalid. -* *seed_offset* - string; (Optional) Offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase. -* *autosave_current* - boolean; Whether to save the currently open RPC wallet before closing it (Defaults to true). - -Outputs: - -* *address* - string; 95-character hexadecimal address of the restored wallet as a string. -* *info* - string; Message describing the success or failure of the attempt to restore the wallet. -* *seed* - string; Mnemonic phrase of the restored wallet, which is updated if the wallet was restored from a deprecated-style mnemonic phrase. -* *was_deprecated* - boolean; Indicates if the restored wallet was created from a deprecated-style mnemonic phrase. - -Example: - -``` -$ curl -X POST http://localhost:38083/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"restore_deterministic_wallet","params":{"filename":"My Wallet","password":"mypassword123","seed":"awkward vogue odometer amply bagpipe kisses poker aspire slug eluded hydrogen selfish later toolbox enigma wolf tweezers eluded gnome soprano ladder broken jukebox lordship aspire","restore_height":0, "language":"English","seed_offset":"","autosave_current":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "9wB1Jc5fy5hjTkFBnv4UNY3WfhUswhx8M7uWjZrwRBzH2uatJcn8AqiKEHWuSNrnapApCzzTxP4iSiV3y3pqYcRbDHNboJK", - "info": "Wallet has been restored successfully.", - "seed": "awkward vogue odometer amply bagpipe kisses poker aspire slug eluded hydrogen selfish later toolbox enigma wolf tweezers eluded gnome soprano ladder broken jukebox lordship aspire", - "was_deprecated": false - } -} - -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` diff --git a/_i18n/es/resources/developer-guides/daemon-rpc.md b/_i18n/es/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/es/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/es/resources/developer-guides/wallet-rpc.md b/_i18n/es/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/es/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/fr/resources/developer-guides/daemon-rpc.md b/_i18n/fr/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 260f1bae..00000000 --- a/_i18n/fr/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Introduction - -Voici une liste des appels de procédures distantes (RPC) du démon, leurs entrées et sorties, et des exemples pour chacun d'eux. - -De nombreux appels RPC utilisent l'interface JSON RPC du démon, alors que d'autres utilisent leurs propres interfaces, comme démontré plus bas. - -Remarque : "@unité-atomique" réfère à la plus petite fraction de 1 XMR selon l'implémentation monerod. **1 XMR = 1e12 unités atomiques** - -Remarque 2 : Guide mis à jour à la hauteur du réseau 1562465. - -### [Méthodes JSON RPC](#methodes-json-rpc) : - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Autres Méthodes RPC](#autres-appels-rpc-du-demon) : - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## Méthodes JSON RPC - -La majorité des appels RPC de monerod utilisent l'interface `json_rpc` du démon pour demander des bribes d'information. Ces méthodes suivent toutes une structure similaire, par exemple : - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Certaines méthodes comportent des paramètres, alors que d'autres non. Chaque méthode JSON RPC est suivit d'exemple(s). - -### **get_block_count** - -Cherche combien de blocs sont contenus dans la plus longue chaîne connue du nœud. - -Alias : *getblockcount*. - -Entrées : *Aucune*. - -Sorties : - -* *count* - entier non signé; Nombre de blocs dans la plus longue chaîne vue par le nœud. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Cherche le hachage d'un bloc par sa hauteur de bloc. - -Alias : *on_getblockhash*. - -Entrées : - -* *block height* - tableau d'entiers de longueur 1; Hauteur(s) de bloc à rechercher. - -Sorties : - -* *block hash* - chaîne de caractères; Hachage du bloc correspondant. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Obtenir un modèle de bloc à partir duquel miner un nouveau bloc. - -Alias : *getblocktemplate*. - -Entrées : - -* *wallet_address* - chaîne de caractères; Adresse du portefeuille à laquelle recevoir la transaction de la base de la pièce si le bloc est miné avec succès. -* *reserve_size* - entier non signé; Taille de réserve. - -Sorties : - -* *blocktemplate_blob* - chaîne de caractères; Forme sur laquelle essayer de miner un nouveau bloc. -* *blockhashing_blob* - chaîne de caractères; Forme sur laquelle essayer de trouver un nonce valide. -* *difficulty* - entier non signé; Difficulté du bloc suivant. -* *expected_reward* - entier non signé; Récompense de la base de la pièce à espérer si le bloc est miné avec succès. -* *height* - entier non signé; Hauteur à laquelle miner. -* *prev_hash* - chaîne de caractères; Hachage du bloc le plus récent sur lequel miner le bloc suivant. -* *reserved_offset* - entier non signé; Déport réservé. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Soumettre un bloc miné au réseau. - -Alias : *submitblock*. - -Entrées : - -* *Block blob data* - liste de chaînes de caractères; Liste des formes de blocs qui ont été minées. Voir [get_block_template](#get_block_template) pour obtenir une forme sur laquelle miner. - -Sorties : - -* *status* - chaîne de caractères; Statut de la soumission du bloc. - -Dans cet exemple, un bloc qui n'a pas été miné est soumis : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Les informations d'entête du bloc le plus récent sont facilement récupérées avec cette méthode. Aucune entrée n'est nécessaire. - -Alias : *getlastblockheader*. - -Entrées : *Aucune*. - -Sorties : - -* *block_header* - Une structure contenant les informations d'entête du bloc. - * *block_size* - entier non signé; La taille du bloc en octets. - * *depth* - entier non signé; Le nombre de blocs succédant à ce bloc dans la chaîne de blocs. Un plus grand nombre signifie un bloc plus ancien. - * *difficulty* - entier non signé; La robustesse du réseau Monero basé sur la puissance d'extraction minière. - * *hash* - chaîne de caractères; Le hachage de ce bloc. - * *height* - entier non signé; Le nombre de blocs précédant ce bloc sur la chaîne de blocs. - * *major_version* - entier non signé; La version majeure du protocole Monero à cette hauteur de bloc. - * *minor_version* - entier non signé; La version mineure du protocole Monero à cette hauteur de bloc. - * *nonce* - entier non signé; Un nombre cryptographique aléatoire à usage unique utilisé dans l'extraction minière d'un bloc Monero. - * *num_txes* - entier non signé; Nombre de transactions dans le bloc, sans compter la transaction de la base de la pièce. - * *orphan_status* - booléen; Habituellement `false`. Si `true`, ce bloc ne fait pas partie de la chaîne la plus longue. - * *prev_hash* - chaîne de caractères; Le hachage du bloc précédent immédiatement ce bloc dans la chaîne de blocs. - * *reward* - entier non signé; Le montant de nouvelles @unités-atomiques généré dans ce bloc et fournies en récompense au mineur. Remarque : 1 XMR = 1e12 @unités-atomiques. - * *timestamp* - entier non signé; Le temps Unix auquel ce bloc à été enregistré dans la chaîne de blocs. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Dans cette exmemple, le bloc le plus récent (1562023 à ce moment-là) est retourné : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Les informations d'entête de bloc peuvent être récupérées en utilisant soit un hachage, soit une hauteur de bloc. Cette méthode inclue un hachage de bloc comme paramètre d'entrée pour récupérer les informations basiques du bloc. - -Alias : *getblockheaderbyhash*. - -Entrées : - -* *hash* - chaîne de caractères; Le hachage sha256 du bloc. - -Sorties : - -* *block_header* - Une structure contenant les informations d'entête du bloc. Voir [get_last_block_header](#get_last_block_header). -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Dans cet exemple, le bloc 912345 est recherché par son hachage : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similaire à [get_block_header_by_hash](#get_block_header_by_hash) ci-dessus, cette méthode prend la hauteur de bloc comme paramètre d'entrée pour récupérer les informations basiques du bloc. - -Alias : *getblockheaderbyheight*. - -Entrées : - -* *height* - entier non signé; La hauteur du bloc. - -Sorties : - -* *block_header* - Une structure contenant les informations d'entête du bloc. Voir [get_last_block_header](#get_last_block_header). -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Dans cet exemple, le bloc 912345 est recherché par sa hauteur (remarquez que les informations renvoyées sont les mêmes que dans l'exemple précédent) : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similaire à [get_block_header_by_height](#get_block_header_by_height) ci-dessus, mais pour une plage de blocs. Cette méthode nécessite une hauteur de bloc de départ et une hauteur de bloc de fin comme paramètres pour récupérer les informations basiques de la plage de blocs. - -Alias : *getblockheadersrange*. - -Entrées : - -* *start_height* - entier non signé; La hauteur de bloc de départ. -* *end_height* - entier non signé; La hauteur de bloc de fin. - -Sorties : - -* *headers* - liste de `block_header` (Une structure contenant les informations d'entête du bloc. Voir [get_last_block_header](#get_last_block_header)). -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Dans cet exemple, la plage de bloc de la hauteur 1545999 à la hauteur 1546000 est recherchée (remarquez que les informations renvoyées sont dans l'ordre ascendant et qu'il s'agit du moment de la mise à jour réseau d'Avril 2018) : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Les informations complètes d'un bloc peuvent être récupérées soit par sa hauteur, soit par son hachage, comme pour les appels précédents. Pour les informations complètes du bloc, les deux recherches utilisent la même méthode, mais avec des paramètres d'entrées différents. - -Alias : *getblock*. - -Entrées (choisir l'un des suivant) : - -* *height* - entier non signé; La hauteur du bloc. -* *hash* - chaîne de caractères; Le hachage du bloc. - -Sorties : - -* *blob* - chaîne de caractères; Forme au format hexadécimal des informations du bloc. -* *block_header* - Une structure contenant les informations d'entête du bloc. Voir [get_last_block_header](#get_last_block_header). -* *json* - chaîne de caractères json; détail du bloc au format JSON : - * *major_version* - Comme dans l'entête du bloc. - * *minor_version* - Comme dans l'entête du bloc. - * *timestamp* - Comme dans l'entête du bloc. - * *prev_id* - Comme `prev_hash` dans l'entête du bloc. - * *nonce* - Comme dans l'entête du bloc. - * *miner_tx* - Information de la transaction du mineur. - * *version* - Numéro de version de la transaction. - * *unlock_time* - La hauteur de bloc à laquelle la transaction de la base de la pièce peut être dépensée. - * *vin* - Liste des entrées de la transaction : - * *gen* - Les transactions du mineur sont des transactions de la base de la pièce, ou "gen". - * *height* - Cette hauteur de bloc, c.a.d lorsque la transaction de la base de la pièce est générée. - * *vout* - Liste des sorties de la transaction. Chaque sortie contient : - * *amount* - Le montant de la sortie, en @unités-atomiques. - * *target* - - * *key* - - * *extra* - Habituellement appelé "ID de transaction" mais peut inclure n'importe quelle chaîne de 32 octets ou 64 caractères hexadécimaux. - * *signatures* - Contient les signatures des signataires de la transaction. Les transactions de la base de la pièce n'ont pas de signatures. - * *tx_hashes* - Liste des hachages des transactions autres que la transaction de la base de la pièce. S'il n'y a pas d'autre transaction, cette liste sera vide. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -**Recherche par hauteur :** - -Dans l'exemple ci-desous, le bloc 912345 est recherché par sa hauteur. Remarquez que le bloc 912345 n'a pas de transactions autre que la transaction de la base de la pièce. (voir l'exemple suivant pour un bloc avec d'autres transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Recherche par hachage :** - -Dans cet exemple, le bloc 993056 est recherché par son hachage. Remarquez que le bloc 993056 a 3 transactions autres que la transaction de la base de la pièce : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Récupère les informations des connexions entrantes et sortantes de votre nœud. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *connections* - Liste de toutes les connexions et leurs infos : - * *address* - chaîne de caractères; L'adresse de l'homologue, actuellement IPv4 & port - * *avg_download* - entier non signé; Moyenne des octets de données téléchargés par le nœud. - * *avg_upload* - entier non signé; Moyenne des octets de données téléversés par le nœud. - * *connection_id* - chaîne de caractères; L'ID de connexion - * *current_download* - entier non signé; Octets actuellement téléchargés par le nœud. - * *current_upload* - entier non signé; Octets actuellement téléversés par le nœud. - * *height*- entier non signé; La hauteur de bloc de l'homologue. - * *host* - chaîne de caractères; L'hôte de l'homologue. - * *incoming* - booléen; Est-ce que l'homologue récupère des informations depuis votre nœud ? - * *ip* - chaîne de caractères; L'adresse IP du nœud. - * *live_time* - entier non signé - * *local_ip* - booléen - * *localhost* - booléen - * *peer_id* - chaîne de caractères; L'ID du nœud sur le réseau. - * *port* - chaîne de caractères; Le port utilisé par le nœud pour se connecter au réseau. - * *recv_count* - entier non signé - * *recv_idle_time* - entier non signé - * *send_count* - entier non signé - * *send_idle_time* - entier non signé - * *state* - chaîne de caractères - * *support_flags* - entier non signé - -Ci-dessous un exemple de `get_connections` et son retour : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Récupère les informations générales à propos de l'état de votre nœud et du réseau. - -Alias : - -* */get_info* -* */getinfo* - -Voir l'autre appel RPC du démon [/get_info (not JSON)](#get_info-not-json) - -Entrées : *Aucune*. - -Sorties : - -* *alt_blocks_count* - entier non signé; Nombre de bloc alternatifs jusqu'à la chaîne principale. -* *block_size_limit* - entier non signé; Taille de bloc maximale autorisée. -* *block_size_median* - entier non signé; Taille de bloc médiane des 100 derniers blocs. -* *bootstrap_daemon_address* - chaîne de caractères; @nœud-d'amorce permettant d'utiliser immédiatement des portefeuilles durant la synchronisation en proxyfiant le RPC vers celui-ci. (Remarque : les réponses pourraient ne pas être digne de confiance). -* *cumulative_difficulty* - entier non signé; Cumule de difficulté de tous les blocs de la chaîne de blocs. -* *difficulty* - entier non signé; Difficulté du réseau (analogue à la robustesse du réseau) -* *free_space* - entier non signé; Espace disque disponible sur le nœud. -* *grey_peerlist_size* - entier non signé; Taille de la liste grise d'homologues. -* *height* - entier non signé; Longueur actuelle de la plus longue chaîne connue du démon. -* *height_without_bootstrap* - entier non signé; Longueur actuelle de la chaîne locale du démon. -* *incoming_connections_count* - entier non signé; Nombre d'homologue connectés et se synchronisant depuis notre nœud. -* *mainnet* - booléen; Indique si le nœud est sur le mainnet (`true`) ou non (`false`). -* *offline* - booléen; Indique si le nœud est hors ligne (`true`) ou en ligne (`false`). -* *outgoing_connections_count* - entier non signé; Nombre d'homologues auxquels vous êtes connectés et auprès desquels cous récupérez des informations. -* *rpc_connections_count* - entier non signé; Nombre de client RPC connectés au démon (cette requête RPC comprise). -* *stagenet* - booléen; Indique si le nœud est sur le stagenet (`true`) ou non (`false`). -* *start_time* - entier non signé; Heure de démarage du démon, au format UNIX. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *target* - entier non signé; Cible actuel pour la prochaine preuve de travail. -* *target_height* - entier non signé; La hauteur du prochain bloc dans la chaîne. -* *testnet* - booléen; Indique si le nœud est sur le testnet (`true`) ou non (`false`). -* *top_block_hash* - chaîne de caractères; Hachage du plus haut bloc dans la chaîne. -* *tx_count* - entier non signé; Nombre total de transactions (hors transactions de la base de la pièce) dans la chaîne. -* *tx_pool_size* - entier non signé; Nombre de transactions qui ont été diffusées mais pas incluses dans un bloc. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). -* *was_bootstrap_ever_used* - booléen; Indique si un nœud d'amorce à jamais été utilisé depuis le démarrage du démon. -* *white_peerlist_size* - entier non signé; Taille de la liste blanche d'homologues. - -Ci-dessous un exemple d'appel `get_info` et de son retour : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Recherche des informations concernant le vote et la disponibilité d'une mise à jour réseau. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *earliest_height* - entier non signé; Hauteur de bloc à laquelle la mise à jour réseau sera activée si elle est votée. -* *enabled* - booléen; Indique si la mise à jour réseau est appliquée. -* *state* - entier non signé; Statut actuel de mise à jour réseau : 0 (il semble y avoir une mise à jour du réseau), 1 (une mise à jour logicielle est nécessaire pour suivre la mise à jour du réseau) ou 2 (tout va bien). -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *threshold* - entier non signé; Pourcentage de vote minimum nécessaire pour déclencher la mise à jour du réseau. 80 par défaut. -* *version* - entier non signé; La verion de bloc majeure pour cette mise mise à jour réseau. -* *votes* - entier non signé; Nombre de votes en faveur de la mise à jour réseau. -* *voting* - entier non signé; Statut du vote de la mise à jour réseau -* *window* - entier non signé; Nombre de blocs sur lesquels les votes actuels sont diffusés. 10080 blocs par défaut. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Bannir un autre nœud par son IP. - -Alias : *Aucun*. - -Entrées : - -* *bans* - Une liste de nœuds à bannir : - * *host* - chaîne de caractères; Hôte à bannir (IP au format A.B.C.D - supportera des adresses I2P à l'avenir). - * *ip* - entier non signé; Adresse IP à bannir, sous forme d'entier. - * *ban* - booléen; Spécifier `true` pour bannir. - * *seconds* - entier non signé; Nombre de secondes pendant lesquelles bannir le nœud. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Examples: - -**bannir par hôte** - -Dans l'exemple ci-dessous, un hôte est banni avec son adresse IP sous la forme d'une chaîne de caractères A.B.C.D : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**bannir par ip** - -Dans l'exemple ci-dessous, une adresse IP au format entier est bannie : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Obtenir la liste des IPs bannies. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *bans* - Liste des nœuds bannis : - * *host* - chaîne de caractères; Hôte banni (IP au format A.B.C.D). - * *ip* - entier non signé; Adresse IP bannie, au format entier. - * *seconds* - entier non signé; Temps Unix local jusqu'auquel cette IP est bannie. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Vide le pool de transactions de certains ids de tx. - -Alias : *Aucun*. - -Entrées : - -* *txids* - liste de chaînes de caractères; Optionnel, liste d'IDs de transactions à vider du pool (tous les ids de tx sont vidés si vide). - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Obtenir un histogramme des montant des sorties. Pour tous les montants (pouvant être filtrés par les paramètres), fournit le nombre de sorties sur la chaîne pour chaque montant. -Les sorties des transactions confidentielles de cercle comptent comme un montant de 0. - -Entrées : - -* *amounts* - liste d'entiers non signés -* *min_count* - entier non signé -* *max_count* - entier non signé -* *unlocked* - booléen -* *recent_cutoff* - entier non signé - -Sorties : - -* *histogram* - liste d'entrées de l'histogramme, avec la structure suivante : - * *amount* - entier non signé; Montant des sorties en @unités-atomiques - * *total_instances* - entier non signé; - * *unlocked_instances* - entier non signé; - * *recent_instances* - entier non signé; -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Obtenir la somme des montants des transactions de la base de la pièce et des frais des n derniers blocs en débutant à une certaine hauteur. - -Alias : *Aucun*. - -Entrées : - -* *height* - entier non signé; Hauteur de bloc à partir de laquelle récupérer les montants. -* *count* - entier non signé; Nombre de bloc à inclure dans la somme. - -Sorties : - -* *emission_amount* - entier non signé; Montant des récompenses de la base de la pièce en @unités-atomiques -* *fee_amount* - entier non signé; Montant des frais en @unités-atomiques -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Indique la version actuelle du nœud - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). -* *version* - entier non signé; - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Donne une estimation des frais par octet. - -Alias : *Aucun*. - -Entrées : - -* *grace_blocks* - entier non signé; Optionnel - -Sorties : - -* *fee* - entier non signé; Montant estimé des frais par octet en @unités-atomiques -* *quantization_mask* - entier non signé; Les frais finaux doivent être arrondis à un multiple de cette valeur -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Affiche les chaînes alternatives vues par le nœud - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *chains* - liste de chains, La structure suivante : - * *block_hash* - chaîne de caractères; Le hachage de bloc du premier bloc divergeant de cette chaîne alternative. - * *difficulty* - entier non signé; La difficulté cumulée de tous les blocs de cette chaîne alternative. - * *height* - entier non signé; La hauteur de bloc du premier bloc divergeant de cette chaîne alternative. - * *length* - entier non signé; La longueur en blocs de cette chaîne alternative, après divergence. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relaye une liste d'IDs de transactions. - -Alias : *Aucun*. - -Entrées : - -* *txids* - Liste de chaîne de caractères; Liste d'IDs de transactions à relayer. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Obtenir les informations de synchronisation. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *height* - entier non signé; -* *peers* - liste de structures d'homologues, définies comme suit : - * *info* - structure d'information de connexion, comme définit dans [get_connections](#get_connections) -* *spans* - liste de structure de plages, définies comme suit (optionnelle, absente si le nœud est totalement synchronisé) : - * *connection_id* - chaîne de caractères; ID de connexion. - * *nblocks* - entier non signé; Nombre de blocs dans cette plage. - * *rate* - entier non signé; Débit de connexion. - * *remote_address* - chaîne de caractères; Adresse de l'homologue à partir duquel le nœud télécharge (ou a téléchargé) cette plage. - * *size* - entier non signé; Nombre total d'octets dans les blocs de cette plage (comprenant les transactions). - * *speed* - entier non signé; Vitesse de la connexion. - * *start_block_height* - entier non signé; Hauteur de bloc du premier bloc de cette plage. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *target_height* - entier non signé; Hauteur de bloc cible vers laquelle le nœud se synchronise (optionnel, absent si le nœud est totalement synchronisé). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Obtenir toutes les transactions en retard du pool. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *backlog*: liste de structures *tx_backlog_entry* (au format binaire) : - * *blob_size* - entier non signé (au format binaire) - * *fee* - entier non signé (au format binaire) - * *time_in_pool* - entier non signé (au format binaire) -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias : *Aucun*. - -Entrées : - -* *amounts* - liste d'entier non signé; Montants à rechercher. -* *cumulative* - booléen; (optionnel, `false` par défaut) Indique si le résultat doit être cumulatif (`true`) ou non (`false`). -* *from_height* - entier non signé; (optionnel, 0 par défaut) Hauteur de bloc de départ à partir de laquelle vérifier. -* *to_height* - entier non signé; (optionnel, 0 par défaut) Hauteur de bloc de fin jusqu'à laquelle vérifier. - -Sorties : - -* *distributions* - liste de structure distribution comme suit : - * *amount* - entier non signé - * *base* - entier non signé - * *distribution* - liste d'entier non signé - * *start_height* - entier non signé -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Autres appels RPC du Démon - -Tous les appels RPC du démon n'utilisent pas l'interface JSON. Cette rubrique donne des exemples de ces appels. - -La structure de données pour ces appels diffère de celle des appels JSON RPC. Alors que les méthodes JSON RPC sont appellées en utilisant l'extension `/json_rpc` et en spécifiant une méthode, ces méthodes sont appelées avec leurs propres extensions. Par exemple : - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Remarque : Il est recommandé d'utiliser JSON RPC lorsque l'alternative existe, plutôt que les méthodes suivantes. Par exemple, la méthode recommandée pour obtenir la hauteur d'un nœud est via la méthode JSON RPC [get_info](#getinfo) ou [get_last_block_header](#get_last_block_header), plutôt que [getheight](#getheight) ci-dessous. - -Pour les appels qui se terminent par **.bin**, les données sont échangées sous forme d'objets sérialisés binaire, comme définit dans le [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Obtenir la hauteur actuelle du nœud. - -Alias : */getheight*. - -Entrées : *Aucune*. - -Sorties : - -* *height* - entier non signé; Longueur actuelle de la plus longue chaîne connue du démon. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Récupère toutes les infos des blocs. Requête binaire. - -Alias : */getblocks.bin*. - -Entrées : - -* *block_ids* - liste binaire de hashes; Les 10 premiers blocs sont attendus séquentiellement, les suivant par décalage de puissance de 2, comme 2, 4, 8, 16, 32, 64 et ainsi de suite, et le dernier est toujours le bloc de genèse. -* *start_height* - entier non signé -* *prune* - booléen - -Sorties : - -* *blocks* - liste d'entrées de bloc complets -* *current_height* - entier non signé -* *output_indices* - structure comme suit : - * *indices* - liste d'indice de sorties de transactions, structure comme suit : - * *indices* - liste d'entier non signé -* *start_height* - entier non signé -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - - -### **/get_blocks_by_height.bin** - -Obtenir des blocs par leur heuteur. Requête binaire. - -Alias : */getblocks_by_height.bin*. - -Entrées : - -* *heights* - liste d'entier non signé; Liste de hauteurs de blocs. - -Sorties : - -* *blocks* - liste d'entrées de bloc complets -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - - - -### **/get_hashes.bin** - -Récupérer des hachages. Requête binaire. - -Alias : */gethashes.bin*. - -Entrées : - -* *block_ids* - liste binaire de hachages; Les 10 premiers blocs sont attendus séquentiellement, les suivant par décalage de puissance de 2, comme 2, 4, 8, 16, 32, 64 et ainsi de suite, et le dernier est toujours le bloc de genèse. -* *start_height* - entier non signé - -Sorties : - -* *current_height* - entier non signé -* *m_block_ids* - liste binaire de hachages; Voir *block_ids* ci-dessus. -* *start_height* - entier non signé -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - - - -### **/get_o_indexes.bin** - -Obtenir les sorties de transactions. Requête binaire. - -Alias : *Aucun*. - -Entrées : - -* *txid* - ID de transaction binaire - -Sorties : - -* *o_indexes* - liste d'entier non signé; Liste d'indexes de sorties -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - - - -### **/get_outs.bin** - -Obtenir des sorties. Requête binaire. - -Alias : *Aucun*. - -Entrées : - -* *outputs* - liste de structure *get_outputs_out* comme suit : - * *amount* - entier non signé; - * *index* - entier non signé; - -Sorties : - -* *outs* - liste de structure *outkey* comme suit : - * *amount* - entier non signé; Montant. - * *height* - entier non signé; Hauteur de bloc pour la sortie. - * *key* - La clef publique de la sortie. - * *mask* - * *txid* - ID de transaction. - * *unlocked* - booléen; Indique si la sortie est verrouillée (`false`) ou non (`true`) -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - - - -### **/get_transactions** - -Recherche une ou plusieurs transactions par hachage. - -Alias : */gettransactions*. - -Entrées : - -* *txs_hashes* - chaîne de caractères list; Liste de hachages de transactions à rechercher. -* *decode_as_json* - booléen; Optionnel (`false` par défaut). Si positionné à `true`, les informations de transactions retournées seront décodées plutôt que binaires. -* *prune* - booléen; Optionnel (`false` par défaut). - -Sorties : - -* *missed_tx* - liste de chaîne de caractères. (Optionnel - retourné si non vide) Hachages de transactions qui sont introuvables. -* *status* - Code erreur général RPC. "OK" signifie que tout va bien. -* *txs* - liste de structure *entry* comme suit : - * *as_hex* - chaîne de caractères; Information de transaction complète sous forme de chaîne de caractères hexadécimale. - * *as_json* - chaîne de caractères json; Liste d'informations de transaction : - * *version* - Version de la transaction. - * *unlock_time* - Si différent de 0, indique quand la sortie de la transaction pourra être dépensée. - * *vin* - Liste d'entrées de la transaction : - * *key* - La clef publique de la précédente sortie dépensée dans cette transaction. - * *amount* - Le montant de cette entrée, en @unités-atomiques. - * *key_offsets* - Une liste de décalage d'entiers pour cette entrée. - * *k_image* - L'image clef de cette entrée. - * *vout* - Liste de sorties de la transaction : - * *amount* - Montant de la sortie, en @unités-atomiques. - * *target* - Informations de destination de la sortie : - * *key* - La clef furtive du destinataire. Quiconque possède la clef privée associée à cette clef contrôle cette sortie de transaction. - * *extra* - Habituellement appelé "ID de paiement", mais peut être utiliser pour inclure n'importe quelle valeur de 32 octets. - * *signatures* - Liste de signatures utilisés dans les signatures de cercle pour masquer l'origine réelle de la transaction. - * *block_height* - entier non signé; Hauteur de bloc incluant cette transaction. - * *block_timestamp* - entier non signé; Temps Unix auquel ce bloc a été ajouté à la chaîne de blocs. - * *double_spend_seen* - booléen; Indique si la transaction est une double-dépense (`true`) ou non (`false`) - * *in_pool* - booléen; indique si la transaction est dans le pool (`true`) ou incluse dans un bloc (`false`) - * *output_indices* - liste d'entier non signé; Indexes de transactions. - * *tx_hash* - chaîne de caractères; Hachage de la transaction -* *txs_as_hex* - chaîne de caractères; Informations complètes de transactions sous forme de chaîne de caractères hexadécimale (ancien paramètre de compatibilité). -* *txs_as_json* - json chaîne de caractères; (Optionnel - retourné si définit en entré. Ancien paramètre de compatibilité) Liste de transactions comme dans *as_json* ci-dessus. - -Exemple 1 : Renvoyer les informations de transaction au format binaire. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Exemple 2 : Décoder les informations de transaction renvoyées au format JSON. Remarque : les liste "vin", "vout" et "signatures" sont tronquées dans la réponse présenté par soucis d'espace. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Exemple 3 : Renvoie une transaction manquante (inexistante). - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Obtenir les hachages de blocs connus qui ne sont pas sur la chaîne principale. - -Alias : *Aucun*. - -Entrées : *Aucune* - -Sorties : - -* *blks_hashes* - liste de chaînes de caractères; liste des hachages de blocs alternatifs à la chaîne principale. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Vérifie si des sorties ont été dépensées en utilisant l'image clef associé à la sortie. - -Alias : *Aucun*. - -Entrées : - -* *key_images* - liste de chaîne de caractères; Liste de chaîne de caractères hexadécimales d'image clef à vérifier. - -Sorties : - -* *spent_status* - entier non signé list; Liste des statut pour chaque image vérifiée. Les statut sont les suivants : 0 = non dépensé, 1 = dépensé sur la chaîne de blocs, 2 = dépensé dans le pool de transactions. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Transmettre une transaction brute sur le réseau. - -Alias : */sendrawtransaction*. - -Entrées : - -* *tx_as_hex* - chaîne de caractères; Information complète de transaction sous forme de chaîne de caractères hexadécimale. -* *do_not_relay* - booléen; Empêche de relayer la transaction aux autres nœuds (`false` par défaut). - -Sorties : - -* *double_spend* - booléen; La transaction est une double dépense (`true`) ou non (`false`). -* *fee_too_low* - booléen; Les frais sont trop faibles (`true`) ou OK (`false`). -* *invalid_input* - booléen; L'entrée est invalide (`true`) ou valide (`false`). -* *invalid_output* - booléen; La sortie est invalide (`true`) ou valide (`false`). -* *low_mixin* - booléen; Le nombre de mixage est trop faible (`true`) ou OK (`false`). -* *not_rct* - booléen; La transaction est une transaction de cercle standard (`true`) ou une transaction confidentielle de cercle (`false`). -* *not_relayed* - booléen; La transaction n'a pas été relayée (`true`) ou relayée (`false`). -* *overspend* - booléen; La transaction utilise plus d'argent que disponible (`true`) ou non (`false`). -* *reason* - chaîne de caractères; Informations complémentaires. Actuellement vide, ou "Non relayée" si la transaction a été acceptée mais pas relayée. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. -* *too_big* - booléen; La taille de la transaction est trop importante (`true`) ou OK (`false`). -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - -Exemple (Pas de retour d'informations inclus ici.) : - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Démarrer l'extraction minière sur le démon. - -Alias : *Aucun*. - -Entrées : - -* *do_background_mining* - booléen; Indique si l'extraction minière doit avoir lieux en arrière plan (`true`) ou au premier plan (`false`). -* *ignore_battery* - booléen; Indique si l'état de la batterie (sur PC portable) doit être ignorée (`true`) ou non (`false`). -* *miner_address* - chaîne de caractères; Adresse de compte sur laquelle miner. -* *threads_count* - entier non signé; Nombre de processus d'extraction minière à lancer. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Arrête l'extraction minière sur le démon. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Obtenir l'état de l'extraction minière du démon. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *active* - booléen; Indique si l'extraction minière est activée (`true`) ou désactivée (`false`). -* *address* - chaîne de caractères; Adresse de compte sur laquelle le démon mine. Vide en l'abscence d'extraction minière. -* *is_background_mining_enabled* - booléen; Indique si l'extraction minière fonctionne en arrière plan (`true`) ou au premier plan (`false`). -* *speed* - entier non signé; Puissance d'extraction minière en hachages par secondes. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. -* *threads_count* - entier non signé; Nombre de processus d'extraction minière actifs. - -Exemple pendant l'extraction minière : - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Exemple hors extraction minière : - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Sauvegarde la chaîne de bloc. La chaîne de bloc n'a pas besoin d'être sauvegardée et est toujours sauvegardée lorsqu'elle est modifiée, mais cela force à vider le cache du système de fichier sur le disque pour des besoins de sécurité lors de défaillances du système d'exploitation ou du matériel. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Obtenir la liste des homologues connus. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *gray_list* - liste d'homologues hors-ligne (structure *peer*) comme suit : - * *host* - entier non signé; Adresse IP sous forme d'entier. - * *id* - chaîne de caractères; ID de l'homologue - * *ip* - entier non signé; Adresse IP sous forme d'entier. - * *last_seen* - entier non signé; Temps Unix auquel l'homologue a été vu pour la dernière fois. - * *port* - entier non signé; Port TCP que l'homologue utilise pour se connecter au réseau Monero. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. -* *white_list* - liste d'homologues en ligne (structure *peer*), comme ci-dessus. - -Exemple (listes tronquées): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Définir le mode d'affichage du taux de hachage dans les journaux. - -Alias : *Aucun*. - -Entrées : - -* *visible* - booléen; Indique si le taux de hachage doit être visible (`true`) ou masqué (`false`) dans les journaux. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. - -Exemple pendant l'extraction minière : - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Erreur en l'absence d'extraction minière: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Définir le niveau de journalisation du démon. -Par défaut, le niveau de journalisation est définit à `0`. - -Alias : *Aucun*. - -Entrées : - -* *level* - integer; Niveau de journalisation du démon à positionner de `0` (le moins verbeux) à `4` (le plus verbeux) - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Définir les catégories de journalisation du démon. -Les catégories sont présentées sous forme d'une liste séparé par des virgules de `:` (de manière analogue au standard syslog `:`), où : -* *Categorie* est l'une des suivantes : - * *\** - Toutes catégories - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *niveau* est l'un des suivants : - * *FATAL* - niveau le plus élevé - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - niveau le plus faible -Un niveau contient automatiquement les niveaux les plus élevés. -Par défaut, les catégories sont définies à `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Définir les catégories à "" empêche toute journalisation de logs. - -Alias : *Aucun*. - -Entrées : - -* *categories* - chaîne de caractères; Optionnelle, Catégories de journalisation du démon à activer. - -Sorties : - -* *categories* - chaîne de caractères; Catégories de journalisation du démon activées. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. Any other value means that something went wrong. - -Example pour activer toutes les catégories au niveau `Info` : - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Exemple sans entrée pour définir les catégories par défaut : - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Montre les informations à propos des transactions valides vue par le nœud mais pas encore minées dans un bloc, de même que les informations d'images clefs pour le pool de transaction en mémoire dans le nœud. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *spent_key_images* - Liste d'images clefs de sorties dépensées : - * *id_hash* - chaîne de caractères; Image clef. - * *txs_hashes* - liste de chaîne de caractères; Hachages de transaction des transactions (Habituellement une) dépensant cette image clef. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *transactions* - Liste des transaction en mémoire dans le pool qui ne sont pas encore dans un bloc sur la chaîne principale : - * *blob_size* - entier non signé; La taille de la forme de la transaction complète. - * *double_spend_seen* - booléen; Indique si cette transaction a été vue comme double dépense. - * *do_not_relay*; booléen; Indique si la transaction doit être relayée. - * *fee* - entier non signé; Le montant des frais d'extraction minière inclus dans la transaction, en @unités-atomiques. - * *id_hash* - chaîne de caractères; Le hachage d'ID de transaction. - * *kept_by_block* - booléen; Indique si la transaction a été incluse dans un bloc au moins une fois (`true`) ou non (`false`). - * *last_failed_height* - entier non signé; Si la validation de la transaction à déjà échouée, cela indique à quelle hauteur cela c'est produit. - * *last_failed_id_hash* - chaîne de caractères; Comme précédemment, cela indique le hachage d'ID de la précédente transaction. - * *last_relayed_time* - entier non signé; Dernier temps Unix auquel la transaction a été relayé. - * *max_used_block_height* - entier non signé; Indique la hauteur du bloc le plus récent avec une sortie utilisé dans cette transaction. - * *max_used_block_hash* - chaîne de caractères; Indique le hachage du bloc le plus récent avec une sortie utilisé dans cette transaction. - * *receive_time* - entier non signé; Le temps Unix auquel la transaction a été vue pour la première fois sur le réseau par le nœud. - * *relayed* - booléen; Indique si la transaction a été relayée. - * *tx_blob* - entier non signé; Forme hexadécimale représentant la transaction. - * *tx_json* - chaîne de caractères json; Structure JSON de toutes les informations dans la transaction : - * *version* - Version de la transaction - * *unlock_time* - Si différent de 0, indique quand la sortie de la transaction pourra être dépensée. - * *vin* - Liste d'entrées de la transaction : - * *key* - La clef publique de la précédente sortie dépensée dans cette transaction. - * *amount* - Le montant de cette entrée, en @unités-atomiques. - * *key_offsets* - Une liste de décalage d'entiers pour cette entrée. - * *k_image* - L'image clef de cette entrée. - * *vout* - Liste de sorties de la transaction : - * *amount* - Montant de la sortie, en @unités-atomiques. - * *target* - Informations de destination de la sortie : - * *key* - La clef furtive du destinataire. Quiconque possède la clef privée associée à cette clef contrôle cette sortie de transaction. - * *extra* - Habituellement appelé "ID de paiement", mais peut être utiliser pour inclure n'importe quelle valeur de 32 octets. - * *rct_signatures* - Signatures de cercle : - * *type* - * *txnFee* - * *ecdhInfo* - liste de structures de courbes elliptiques Diffie Helman comme suit : - * *mask* - Chaîne de caractères - * *amount* - Chaîne de caractères - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - liste de structures comme suit : - * *asig* - * *Ci* - * *MGs* - liste de structures comme suit : - * *ss* - liste de listes de deux chaines de caractères. - * *cc* - Chaîne de caractères - -Exemple (Remarque : Certaines listes dans les informations renvoyées ont été tronquées par soucis d'espace) : - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Obtenir les hachages depuis le pool de transactions. Requête binaire. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *tx_hashes* - liste binaire de hachages de transactions. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Obtenir les statistiques du pool de transactions. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *pool_stats* - Structure comme suit : - * *bytes_max* - entier non signé; Taille de la plus grande transaction dans le pool. - * *bytes_med* - entier non signé; Taille médiane des transactions dans le pool. - * *bytes_min* - entier non signé; Taille de la plus petite transaction dans le pool. - * *bytes_total* - entier non signé; Taille totale de toutes les transactions dans le pool. - * *histo* - structure *txpool_histo* comme suit : - * *txs* - entier non signé; Nombre de transactions. - * *bytes* - entier non signé; Taille en octets. - * *histo_98pc* entier non signé; Le moment auquel 98% des transactions sont plus récentes. - * *num_10m* entier non signé; Nombre de transactions dans le pool depuis plus de 10 minutes. - * *num_double_spends* entier non signé; Nombre de transaction de double dépenses. - * *num_failing* entier non signé; Nombre de transactions en échec. - * *num_not_relayed* entier non signé; Nombre de transactions non-relayées. - * *oldest* entier non signé; Temps Unix de la plus ancienne transaction dans le pool. - * *txs_total* entier non signé; Nombre total de transactions. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Envoie une commande au démon pour le déconnecter et l'arrêter proprement. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -Cette méthode est fournie pour des raisons de compatibilité historique et ne doit plus être utilisée. Voir la méthode RPC JSON [get_info](#get_info) pour plus de détails. - -Alias : - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Obtenir les limites de bande passante du démon. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *limit_down* - entier non signé; Limite de téléchargement en kilo-octets par secondes. -* *limit_up* - entier non signé; Limite de téléversement en kilo-octets par secondes. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Définir les limites de bande passante du démon. - -Alias : *Aucun*. - -Entrées : - -* *limit_down* - signed int; Limite de téléchargement en kilo-octets par secondes (-1 rétablit la valeur par défaut, 0 ne change pas la limite actuelle). -* *limit_up* - signed int; Limite de téléversement en kilo-octets par secondes (-1 rétablit la valeur par défaut, 0 ne change pas la limite actuelle). - -Sorties : - -* *limit_down* - entier non signé; Limite de téléchargement en kilo-octets par secondes. -* *limit_up* - entier non signé; Limite de téléversement en kilo-octets par secondes. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limite le nombre d'homologues sortants. - -Alias : *Aucun*. - -Entrées : - -* *out_peers* - entier non signé; Nombre maximum d'homologues sortants. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limite le nombre d'homologues entrants. - -Alias : *Aucun*. - -Entrées : - -* *in_peers* - entier non signé; ombre maximum d'homologues entrants. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conservé ici pour référence. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conservé ici pour référence. - -Alias : *Aucun*. - -Entrées : *Aucune*. - -Sorties : - -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Obtenir des sorties. - -Alias : *Aucun*. - -Entrées : - -* *outputs* liste de *get_outputs_out* structure comme suit : - * *amount* - entier non signé; - * *index* - entier non signé; - -Sorties : - -* *outs* - liste de structure *outkey* comme suit : - * *height* - entier non signé; hauteur de bloc de la sortie. - * *key* - chaîne de caractères; La clef publique de la sortie. - * *mask* - chaîne de caractères - * *txid* - chaîne de caractères; ID de transaction - * *unlocked* - booléen; Indique si la sortie est verrouillée (`false`) ou non (`true`) -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *untrusted* - booléen; Indique si le résultat est obtenu en utilisant un nœud d'amorce, auquel il ne faudrait pas faire confiance (`true`), ou si le démon est totalement synchronisé (`false`). - - -### **/update** - -Met à jour le démon. - -Alias : *Aucun*. - -Entrées : - -* *command* - chaîne de caractères; Commande à utiliser, soit `check`, soit `download` -* *path* - chaîne de caractères; Optionnel, chemin où télécharger la mise à jour. - -Sorties : - -* *auto_uri* - chaîne de caractères; -* *hash* - chaîne de caractères; -* *path* - chaîne de caractères; Chemin où télécharger la mise à jour. -* *status* - chaîne de caractères; Code erreur général RPC. "OK" signifie que tout va bien. -* *update* - booléen; States if an update is available to download (`true`) ou non (`false`) -* *user_uri* - chaîne de caractères; -* *version* - chaîne de caractères; Version available for download. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/fr/resources/developer-guides/wallet-rpc.md b/_i18n/fr/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index 92446229..00000000 --- a/_i18n/fr/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2732 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Introduction - -Voici une liste des appels de monero-wallet-rpc, leurs entrées et sorties, et des exemples pour chacun d'eux. Le logiciel monero-wallet-rpc remplace l'interface rpc qui était présenter dans simplewallet puis monero-wallet-cli. - -Toutes les méthodes monero-wallet-rpc utilisent la même interface JSON RPC. Par exemple : - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Si monero-wallet-rpc était exécuté avec l'option `--rpc-login` configuré à `username:password`, alors suivez cet exemple : - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Remarque : "@atomic-units" réfère à la plus petite fraction de 1 XMR selon l'implémentation monerod. **1 XMR = 1e12 unités atomiques** - -Cette liste à été mise à jour sur un code gelé le 14/09/2018 après la fusion du commit bb30a7236725e456138f055f96a634c75ce2b491 (version Wallet RPC 1.3), et à la hauteur de bloc 1643308. - -### Index des méthodes JSON RPC : - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## Méthodes JSON RPC : - -### **get_balance** - -Retourne le solde du portefeuille. - -Alias : *getbalance*. - -Entrées : - -* *account_index* - entier non signé; Retourne le solde pour ce compte. -* *address_indices* - liste d'entier non signé; (Optionnel) Retourne le détail du solde pour ces sous-adresses. - -Sorties : - -* *balance* - entier non signé; Le solde total du monero-wallet-rpc actuellement en session. -* *unlocked_balance* - entier non signé; Les fonds débloqués sont ces fonds qui sont suffisamment profonds sur la chaîne de bloc Monero pour être considérés sûres à dépenser. -* *multisig_import_needed* - booléen; `True` si l'import de données de multisignatures est nécessaire pour retourner le solde correct. -* *per_subaddress* - liste d'informations `subaddress`; Informations de solde pour chaque sous-adresses du compte. - * *address_index* - entier non signé; Index des sous-addresses du compte. - * *address* - chaîne de caractères; Adresse à cet index. Représentation Base58 des clefs publiques. - * *balance* - entier non signé; Solde de la sous-adresse (bloqué ou débloqué). - * *unlocked_balance* - entier non signé; Solde débloqué pour la sous-adresse. - * *label* - chaîne de caractères; Libellé de la sous-adresse. - * *num_unspent_outputs* - entier non signé; Nombre de sorties non dépensées disponibles pour la sous-adresse. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Retourne l'adresse de portefeuille pour ce compte. Filtre optionnellement sur un lot de sous-adresses. - -Alias : *getaddress*. - -Entrées : - -* *account_index* - entier non signé; Le compte dont retourner les sous-adresses. -* *address_index* - liste d'entier non signé; (Optionnel) Liste de sous-adresses à retourner pour un compte. - -Sorties : - -* *address* - chaîne de caractères; La chaîne de 95 caractères de l'adresse du portefeuille RPC ouvert. -* *addresses* Liste d'informations `addresses` - * *address* chaîne de caractères; La chaîne de 95 caractères de (sous-)adresse. - * *label* chaîne de caractères; Libélé de la (sous-)adresse. - * *address_index* entier non signé; Index de la sous-adresse. - * *used* booléen; Indique si la (sous-)adresse à déjà reçu des fonds. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Obtenir les index de compte et d'adresse pour uns (sous-)adresse spécifique. - -Alias : *Aucun*. - -Entrées : - -* *address* - String; (Sous)-adresse à rechercher. - -Sorties : - -* *index* - Informations de sous-adresse - * *major* entier non signé; Index de compte. - * *minor* entier non signé; Index d'adresse. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Créer une nouvelle adresse sur un compte. Optionnellement, libeller la nouvelle adresse. - -Alias : *Aucun*. - -Entrées : - -* *account_index* - entier non signé; Compte pour lequel créer une nouvelle adresse. -* *label* - chaîne de caractères; (Optionnel) Libellé pour la nouvelle adresse. - -Sorties : - -* *address* - chaîne de caractères; Nouvelle adresse créée. Représentation Base58 des clefs publiques. -* *address_index* - entier non signé; Index de la nouvelle adresse dans le compte indiqué. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Libeller une adresse. - -Alias : *Aucun*. - -Entrées : - -* *index* - Index de sous-adresse; Objet JSON contenant les Index d'adresse majeur et mineur: - * *major* - entier non signé; Index de compte pour la sous-adresse. - * *minor* - entier non signé; Index de la sous-adresse de ce compte. -* *label* - chaîne de caractères; Libellé de cette adresse. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Obtenir tous les comptes d'un portefeuille. Optionnellement filtrer par étiquette de comptes. - -Alias : *Aucun*. - -Entrées : - -* *tag* - chaîne de caractères; (Optionnel) Étiquette pour filtrer les comptes. - -Sorties : - -* *subaddress_accounts* - liste d'informations de sous-adresses de compte : - * *account_index* - entier non signé; Index du compte. - * *balance* - entier non signé; Solde du compte (bloqué ou débloqué). - * *base_address* - chaîne de caractères; Représentation Base64 de la première sous-adresse de ce compte. - * *label* - chaîne de caractères; (Optionnel) Libellé du compte. - * *tag* - chaîne de caractères; (Optionnel) Étiquette pour filtrer les comptes. - * *unlocked_balance* - entier non signé; Solde débloqué pour le compte. -* *total_balance* - entier non signé; Solde total des comptes sélectionnés (bloqué ou débloqué). -* *total_unlocked_balance* - entier non signé; Solde total débloqué des comptes sélectionnés. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Créer un nouveau compte avec un libellé optionnel. - -Alias : *Aucun*. - -Entrées : - -* *label* - chaîne de caractères; (Optionnel) Libellé pour le compte. - -Sorties : - -* *account_index* - entier non signé; Index du nouveau compte. -* *address* - chaîne de caractères; Adresse de ce compte. Représentation Base58 des clefs publiques. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Libeller un compte. - -Alias : *Aucun*. - -Entrées : - -* *account_index* - entier non signé; Appliquer un libellé au compte à cet index. -* *label* - chaîne de caractères; Libellé pour le compte. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Obtenir la liste des étiquettes de compte personnalisées. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *account_tags* - liste d'informations d'étiquette de compte : - * *tag* - chaîne de caractères; Étiquette de filtrage. - * *label* - chaîne de caractères; Libellé de l'étiquette. - * *accounts* - liste de int; Liste d'index de comptes étiquetés. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Appliquer une étiquette de filtrage à une liste de comptes. - -Alias : *Aucun*. - -Entrées : - -* *tag* - chaîne de caractères; Étiquette pour le compte. -* *accounts* - liste d'entier non signé; Étiqueter cette liste de comptes. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Supprimer l'étiquette de filtrage d'une liste de comptes. - -Alias : *Aucun*. - -Entrées : - -* *accounts* - liste d'entier non signé; Supprimer l'étiquette de filtrage de cette liste de comptes. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Configurer une description pour une étiquette de compte. - -Alias : *Aucun*. - -Entrées : - -* *tag* - chaîne de caractères; Définir une description pour cette étiquette. -* *description* - chaîne de caractères; Description de l'étiquette. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Retourne la hauteur de bloc actuelle du portefeuille. - -Alias : *getheight*. - -Entrées : *Aucun*. - -Sorties : - -* *height* - entier non signé; La hauteur de bloc actuelle du portefeuille RPC. Si le portefeuille est resté fermé un long moment, il pourrait devoir rattraper le démon. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Envoyer des Moneroj à un certain nombre de destinataires. - -Alias : *Aucun*. - -Entrées : - -* *destinations* - liste de destinations devant recevoir des XMR : - * *amount* - entier non signé; Montant à envoyer à chaque destination, en @unités-atomiques. - * *address* - chaîne de caractères; Adresse publique de destination. -* *account_index* - entier non signé; (Optionnel) Transférer depuis cet index de compte. (0 par défaut) -* *subaddr_indices* - liste d'entier non signé; (Optionnel) Transférer depuis cette liste de sous-adresses. (vide par défaut - tous les indices) -* *priority* - entier non signé; Définir une priorité pour la transaction. Les valeurs acceptées sont de 0 à 3 respectivement pour les priorités par défaut, non-importante, normale et élevée. -* *mixin* - entier non signé; Nombre de sorties de la chaîne de blocs avec lesquelles se mélanger (0 signifie pas de mélange). -* *ring_size* - entier non signé; Nombre de sorties à mélanger dans la transaction (cette sortie + N leurres depuis la chaîne de blocs). -* *unlock_time* - entier non signé; Nombre de blocs avant que les Moneroj puissent être dépensés (0 pour ne pas ajouter de verrouillage). -* *payment_id* - chaîne de caractères; (Optionnel) Chaîne de 64 caractères hexadécimaux ou 32 octets aléatoires pour identifier la transaction. -* *get_tx_key* - booléen; (Optionnel) Retourne la clef de la transaction après l'envoi. -* *do_not_relay* - booléen; (Optionnel) Si `true`, la transaction nouvellement créée ne sera pas relayée sur le réseau Monero. (`false` par défaut) -* *get_tx_hex* - booléen; Retourne la transaction sous forme de chaîne de caractères hexadécimale après l'envoi. (`false` par défaut) -* *get_tx_metadata* - booléen; Retourne les métadonnées nécessaires pour relayer la transaction. (`false` par défaut) - -Sorties : - -* *amount* - Montant transféré dans la transaction. -* *fee* - Valeur en entier des frais facturés pour la transaction. -* *multisig_txset* - Lot de transaction multi-signatures en attente d'être signée (vide si non-multi-signatures). -* *tx_blob* - Transaction brut représenté par une chaîne de caractères hexadécimale, si `get_tx_hex` est `true`. -* *tx_hash* - Chaîne de caractère du hachage de transaction publiquement consultable. -* *tx_key* - Chaîne de caractère de la clef de transaction si `get_tx_key` est `true`, sinon chaîne de caractères vierge. -* *tx_metadata* - Lot de métadonnées de transactions nécessaires pour relayer ce transfert plus tard, si `get_tx_metadata` est `true`. -* *unsigned_txset* - String. Lot de transactions non-signée pour des besoins de signature à froid. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Comme `transfer`, mais peut être séparé en plus d'une transaction si nécessaire. - -Alias : *Aucun*. - -Entrées : - -* *destinations* - liste de destinations devant recevoir des XMR : - * *amount* - entier non signé; Montant à envoyer à chaque destination, en @unités-atomiques. - * *address* - chaîne de caractères; Adresse publique de destination. -* *account_index* - entier non signé; (Optionnel) Transférer depuis cet index de compte. (0 par défaut) -* *subaddr_indices* - liste d'entier non signé; (Optionnel) Transférer depuis cette liste de sous-adresses. (vide par défaut - tous les indices) -* *mixin* - entier non signé; Nombre de sorties de la chaîne de blocs avec lesquelles se mélanger (0 signifie pas de mélange). -* *ring_size* - entier non signé; Nombre de sorties à mélanger dans la transaction (cette sortie + N leurres depuis la chaîne de blocs). -* *unlock_time* - entier non signé; Nombre de blocs avant que les Moneroj puissent être dépensés (0 pour ne pas ajouter de verrouillage). -* *payment_id* - chaîne de caractères; (Optionnel) Chaîne de 64 caractères hexadécimaux ou 32 octets aléatoires pour identifier la transaction. -* *get_tx_key* - booléen; (Optionnel) Retourne la clef de la transaction après l'envoi. -* *priority* - entier non signé; Définir une priorité pour la transaction. Les valeurs acceptées sont de 0 à 3 respectivement pour les priorités par défaut, non-importante, normale et élevée. -* *do_not_relay* - booléen; (Optionnel) Si `true`, la transaction nouvellement créée ne sera pas relayée sur le réseau Monero. (`false` par défaut) -* *get_tx_hex* - booléen; Retourne la transaction sous forme de chaîne de caractères hexadécimale après l'envoi. (`false` par défaut) -* *new_algorithm* - booléen; `True` pour utiliser le nouvel algorithme de construction de transaction, `false` par défaut. -* *get_tx_metadata* - booléen; Retourne les métadonnées nécessaires pour relayer la transaction. (`false` par défaut) - -Sorties : - -* *tx_hash_list* - liste de : chaîne de caractères. Le hachage de transaction de chaque transaction. -* *tx_key_list* - liste de : chaîne de caractères. La clef de transaction de chaque transaction. -* *amount_list* - liste de : integer. Le montant transféré dans chaque transaction. -* *fee_list* - liste de : integer. Le montant des frais payés pour chaque transaction. -* *tx_blob_list* - liste de : chaîne de caractères. La transaction sous forme de chaîne de caractères hexadécimale pour chaque transaction. -* *tx_metadata_list* - liste de : chaîne de caractères. Liste de métadonnées de transaction nécessaires pour relayer les transactions plus tard. -* *multisig_txset* - chaîne de caractères. Lot de transactions multi-signatures en attente d'être signées (vide si non-multi-signatures). -* *unsigned_txset* - chaîne de caractères. Lot de transactions non-signées pour des besoins de signatures à froid. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Signer une transaction créée sur un portefeuille d'audit (dans le processus de signature à froid). - -Alias : *Aucun*. - -Entrées : - -* *unsigned_txset* - chaîne de caractères. Lot de transaction non-signée retourné par les méthodes `transfer` ou `transfer_split`. -* *export_raw* - booléen; (Optionnel) Si `true`, retourne les données de transaction brut. (`false` par défaut) - -Sorties : - -* *signed_txset* - chaîne de caractères. Lot de transaction signée à utiliser pour soumettre le transfert. -* *tx_hash_list* - liste de : chaîne de caractères. Le hachage de transaction de chaque transaction. -* *tx_raw_list* - liste de : chaîne de caractères. Les données de transaction brutes de chaque transaction. - -Dans l'exemple ci-dessous, nous générons d'abord un `unsigned_txset` sur un portefeuille d'audit avant de le signer : - -Générer un `unsigned_txset` en utilisant la méthode `transfer` ci-dessus sur un portefeuille d'audit : -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Signer la transaction en utilisant le `unsigned_txset` précédemment généré : -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Soumettre une transaction préalablement signée sur un portefeuille d'audit (ans le processus de signature à froid). - -Alias : *Aucun*. - -Entrées : - -* *tx_data_hex* - chaîne de caractères; Lot de transaction signée renvoyé par `sign_transfer`. - -Sorties : - -* *tx_hash_list* - liste de : chaîne de caractères. Le hachage de transaction de chaque transaction. - -Dans l'exemple suivant, nous soumettons un transfert en utilisant le `signed_txset` généré plus haut : -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Renvoyer toutes les sorties résiduelles au portefeuille, pour les rendre plus facile à dépenser (et à mélanger). - -Alias : *sweep_unmixable*. - -Entrées : - -* *get_tx_keys* - booléen; (Optionnel) Retourne la clef de la transaction après l'envoi. -* *do_not_relay* - booléen; (Optionnel) Si `true`, la nouvelle transaction ne sera pas relayée sur le réseau Monero. (`false` par défaut) -* *get_tx_hex* - booléen; (Optionnel) Retourne les transactions sous forme de chaîne de caractères hexadécimales après l'envoi. (`false` par défaut) -* *get_tx_metadata* - booléen; (Optionnel) Retourne la liste des métadonnées de transaction nécessaires pour relayer le transfert ultérieurement. (`false` par défaut) - -Sorties : - -* *tx_hash_list* - liste de : chaîne de caractères. Le hachage de transaction de chaque transaction. -* *tx_key_list* - liste de : chaîne de caractères. Les clefs de transaction de chaque transaction. -* *amount_list* - liste de : integer. Le montant transféré dans chaque transaction. -* *fee_list* - liste de : integer. Le montant des frais payés pour chaque transaction. -* *tx_blob_list* - liste de : chaîne de caractères. La transaction sous forme de chaîne de caractères hexadécimale pour chaque transaction. -* *tx_metadata_list* - liste de : chaîne de caractères. Liste des métadonnées de transaction nécessaires pour relayer le transfert ultérieurement. -* *multisig_txset* - chaîne de caractères. Le lot de clefs de signature utilisé dans une transaction multi-signatures (vide si non-multi-signatures). -* *unsigned_txset* - chaîne de caractères. Lot de transactions non-signées pour des besoins de signatures à froid. - -Exemple (Dans cet exemple, `sweep_dust` ne retourne rien car il n'y a pas de fonds à ramoner) : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Envoyer tout le solde débloqué à une adresse. - -Alias : *Aucun*. - -Entrées : - -* *address* - chaîne de caractères; Adresse publique de destination. -* *account_index* - entier non signé; Ramoner les transaction de ce compte. -* *subaddr_indices* - liste d'entier non signé; (Optionnel) Ramoner depuis ce lot de sous-adresses de ce compte. -* *priority* - entier non signé; (Optionnel) Priorité pour envoyer ce transfert de ramonage, détermine en parti les frais. -* *mixin* - entier non signé; Nombre de sorties de la chaîne de blocs avec lesquelles se mélanger (0 signifie pas de mélange).. -* *ring_size* - entier non signé; Définit la taille de cercle à N (mixin + 1). -* *unlock_time* - entier non signé; Nombre de blocs avant que les Moneroj puissent être dépensés (0 pour ne pas ajouter de verrouillage). -* *payment_id* - chaîne de caractères; (Optionnel) Chaîne de 64 caractères hexadécimaux ou 32 octets aléatoires pour identifier la transaction. -* *get_tx_keys* - booléen; (Optionnel) Retourne la clef de la transaction après l'envoi. -* *below_amount* - entier non signé; (Optionnel) Inclure les sorties plus faibles que ce montant. -* *do_not_relay* - booléen; (Optionnel) Si `true`, ne pas relayer ce transfert de ramonage. (`false` par défaut) -* *get_tx_hex* - booléen; (Optionnel) Retourne les transactions sous forme de chaînes de caractères hexadécimales. (`false` par défaut) -* *get_tx_metadata* - booléen; (Optionnel) Retourne les métadonnées de transaction sous forme de chaîne de caractères. (`false` par défaut) - -Sorties : - -* *tx_hash_list* - liste de : chaîne de caractères. Le hachage de transaction de chaque transaction. -* *tx_key_list* - liste de : chaîne de caractères. Les clefs de transaction de chaque transaction. -* *amount_list* - liste de : integer. Le montant transféré dans chaque transaction. -* *fee_list* - liste de : integer. Le montant des frais payés pour chaque transaction. -* *tx_blob_list* - liste de : chaîne de caractères. La transaction sous forme de chaîne de caractères hexadécimale pour chaque transaction. -* *tx_metadata_list* - liste de : chaîne de caractères. Liste des métadonnées de transaction nécessaires pour relayer le transfert ultérieurement. -* *multisig_txset* - chaîne de caractères. Le lot de clefs de signature utilisé dans une transaction multi-signatures (vide si non-multi-signatures). -* *unsigned_txset* - chaîne de caractères. Lot de transactions non-signées pour des besoins de signatures à froid. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Envoie la totalité d'une sortie spécifique à une adresse. - -Alias : *Aucun*. - -Entrées : - -* *address* - chaîne de caractères; Adresse publique de destination. -* *account_index* - entier non signé; Ramoner les transaction de ce compte. -* *subaddr_indices* - liste d'entier non signé; (Optionnel) Ramoner depuis ce lot de sous-adresses de ce compte. -* *priority* - entier non signé; (Optionnel) Priorité pour envoyer ce transfert de ramonage, détermine en parti les frais. -* *mixin* - entier non signé; Nombre de sorties de la chaîne de blocs avec lesquelles se mélanger (0 signifie pas de mélange).. -* *ring_size* - entier non signé; Définit la taille de cercle à N (mixin + 1). -* *unlock_time* - entier non signé; Nombre de blocs avant que les Moneroj puissent être dépensés (0 pour ne pas ajouter de verrouillage). -* *payment_id* - chaîne de caractères; (Optionnel) Chaîne de 64 caractères hexadécimaux ou 32 octets aléatoires pour identifier la transaction. -* *get_tx_keys* - booléen; (Optionnel) Retourne la clef de la transaction après l'envoi. -* *key_image* - chaîne de caractères; Key image of specific output to sweep. -* *below_amount* - entier non signé; (Optionnel) Inclure les sorties plus faibles que ce montant. -* *do_not_relay* - booléen; (Optionnel) Si `true`, ne pas relayer ce transfert de ramonage. (`false` par défaut) -* *get_tx_hex* - booléen; (Optionnel) retourne les transactions sous forme de chaînes de caractères hexadécimales. (`false` par défaut) -* *get_tx_metadata* - booléen; (Optionnel) Retourne les métadonnées de transaction sous forme de chaîne de caractères. (Defaults to false) - -Sorties : - -* *tx_hash_list* - liste de : chaîne de caractères. Le hachage de transaction de chaque transaction. -* *tx_key_list* - liste de : chaîne de caractères. Les clefs de transaction de chaque transaction. -* *amount_list* - liste de : integer. Le montant transféré dans chaque transaction. -* *fee_list* - liste de : integer. Le montant des frais payés pour chaque transaction. -* *tx_blob_list* - liste de : chaîne de caractères. La transaction sous forme de chaîne de caractères hexadécimale pour chaque transaction. -* *tx_metadata_list* - liste de : chaîne de caractères. Liste des métadonnées de transaction nécessaires pour relayer le transfert ultérieurement. -* *multisig_txset* - chaîne de caractères. Le lot de clefs de signature utilisé dans une transaction multi-signatures (vide si non-multi-signatures). -* *unsigned_txset* - chaîne de caractères. Lot de transactions non-signées pour des besoins de signatures à froid. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relayer une transaction préalablement créée avec `"do_not_relay":true`. - -Alias : *Aucun*. - -Entrées : - -* *hex* - chaîne de caractères; métadonnées de transaction retournées par une méthode `transfer` avec `get_tx_metadata` positionné à `true`. - -Sorties : - -* *tx_hash* - Chaîne de caractère du hachage de transaction publiquement consultable. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Sauvegarde le fichier de portefeuille. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Obtenir une liste de paiement entrant en utilisant un ID de paiement donné. - -Alias : *Aucun*. - -Entrées : - -* *payment_id* - chaîne de caractères; ID de paiement utilisé pour trouver les paiements (16 caractères hexadécimaux). - -Sorties : - -* *payments* - liste de : - * *payment_id* - chaîne de caractères; ID de paiement correspondant au paramètre d'entrée. - * *tx_hash* - chaîne de caractères; Hachage de transaction utilisé comme ID de transaction. - * *amount* - entier non signé; Montant de ce paiement. - * *block_height* - entier non signé; Hauteur du bloc qui a confirmé ce paiement en premier. - * *unlock_time* - entier non signé; Temps (en hauteur de bloc) avant que ce paiement ne soit sûr à dépenser. - * *subaddr_index* - Index de sous-adresse: - * *major* - entier non signé; Index de compte pour la sous-adresse. - * *minor* - entier non signé; Index de la sous-adresse de ce compte. - * *address* - chaîne de caractères; Adresse recevant ce paiement; Représentation Base58 des clefs publiques. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Obtenir une liste de paiement entrant en utilisant un ID de paiement ou une liste d'IDs de paiement, pour une hauteur donnée. Cette méthode est préférée à la methode `get_payments` car elle dispose des mêmes fonctionnalité et est plus extensible. Les deux sont parfaites pour vérifier des transactions avec un unique ID de paiement. - -Alias : *Aucun*. - -Entrées : - -* *payment_ids* - liste de : chaîne de caractères; IDs de paiements utilisé pour trouver les paiements (16 caractères hexadécimaux). -* *min_block_height* - entier non signé; La hauteur de bloc à partir de laquelle recherchr les paiements. - -Sorties : - -* *payments* - liste de : - * *payment_id* - chaîne de caractères; ID de paiement correspondant à un des IDs fournis en entrée. - * *tx_hash* - chaîne de caractères; Hachage de transaction utilisé comme ID de transaction. - * *amount* - entier non signé; Montant de ce paiement. - * *block_height* - entier non signé; Hauteur du bloc qui a confirmé ce paiement en premier. - * *unlock_time* - entier non signé; Temps (en hauteur de bloc) avant que ce paiement ne soit sûr à dépenser. - * *subaddr_index* - Index de sous-adresse: - * *major* - entier non signé; Index de compte pour la sous-adresse. - * *minor* - entier non signé; Index de la sous-adresse de ce compte. - * *address* - chaîne de caractères; Adresse recevant ce paiement; Représentation Base58 des clefs publiques. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Retourne une liste de transfert entrant sur le portefeuille. - -Entrées : - -* *transfer_type* - chaîne de caractères; "all": tous les transferts, "available": Uniquement les transferts qui ne sont pas encore dépensés, OR "unavailable": uniquement les transferts qui sont déjà dépensés. -* *account_index* - entier non signé; (Optionnel) Retourne les transferts pour ce compte. (0 par défaut) -* *subaddr_indices* - liste d'entier non signé; (Optionnel) Retourne les transferts envoyer à ces sous-adresses. -* *verbose* - booléen; (Optionnel) Active la sortie verbeuse, retourne l'image de clef si `true`. - -Sorties : - -* *transfers* - liste de : - * *amount* - entier non signé; Montant de ce transfert. - * *global_index* - entier non signé; Majoritairement pour usage interne, peut être ignoré par la plupart des utilisateurs. - * *key_image* - chaîne de caractères; Image de clef pour les sorties non dépensées de ce transfert entrant (vide sauf si `verbose` est `true`). - * *spent* - booléen; Indique si le transfert à été dépensé. - * *subaddr_index* - entier non signé; Index de sous-adresse for incoming transfer. - * *tx_hash* - chaîne de caractères; Plusieurs transferts entrant peuvent partager le même hachage s'ils faisaient parti de la même transaction. - * *tx_size* - entier non signé; Taille de la transaction en octets. - -Exemple, obtenir tous les transferts : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Exemple, obtenir les transferts disponibles : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Exemple, obtenir les transferts indisponibles : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Retourne la clef de dépense ou d'audit privée. - -Alias : *Aucun*. - -Entrées : - -* *key_type* - chaîne de caractères; Quelle clef récupérer : "mnemonic" - la phrase mnémonique (les plus ancien portefeuilles n'en ont pas) OU "view_key" - la clef d'audit - -Sorties : - -* *key* - chaîne de caractères; La clef d'audit sera sous forme hexadécimale, alors que la phrase mnémonique sera une suite de mots-clefs. - -Exemple (Récupérer la clef d'audit) : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Exemple (Récupérer la phrase mnémonique) : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Construire une adresse intégrée à partir d'une adresse de portefeuille et d'un ID de paiement. - -Alias : *Aucun*. - -Entrées : - -* *standard_address* - chaîne de caractères; (Optionnel, adresse principale par défaut) Adresse publique de destination. -* *payment_id* - chaîne de caractères; (Optionnel, ID aléatoire si non-fourni) 16 caractères encodés en hexadécimal. - -Sorties : - -* *integrated_address* - chaîne de caractères -* *payment_id* - chaîne de caractères; encodé en hexadécimal; - -Exemple (ID de paiement vide, utilise un ID aléatoire) : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Récupérer l'adresse standard et l'ID de paiement correspondant à une adresse intégrée. - -Alias : *Aucun*. - -Entrées : - -* *integrated_address* - chaîne de caractères - -Sorties : - -* *is_subaddress* - booléen; Indique si l'adresse est une sous-adresse. -* *payment* - chaîne de caractères; encodé en hexadécimal -* *standard_address* - chaîne de caractères - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Arrête le portefeuille, en enregistrant l'état actuel. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescanner la chaîne de blocs depuis le début, en perdant toutes les informations qui ne peuvent pas être récupérées depuis la chaîne de blocs elle-même. -Cela inclus les adresses de destination, les clefs privées des transactions, les notes des transactions, etc. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Définir des notes arbitraires aux transactions. - -Alias : *Aucun*. - -Entrées : - -* *txids* - liste de chaîne de caractères; IDs de transactions -* *notes* - liste de chaîne de caractères; Notes pour les transactions - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Obtenir les notes des transactions. - -Alias : *Aucun*. - -Entrées : - -* *txids* - liste de chaîne de caractères; IDs de transactions - -Sorties : - -* *notes* - liste de chaîne de caractères; Notes des transactions - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Définir un attribut arbitraire. - -Alias : *Aucun*. - -Entrées : - -* *key* - chaîne de caractères; Nom de l'attribut. -* *value* - chaîne de caractères; Valeur de l'attribut. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Obtenir la valeur d'un attribut par son nom. - -Alias : *Aucun*. - -Entrées : - -* *key* - chaîne de caractères; Nom de l'attribut. - -Sorties : - -* *value* - chaîne de caractères; Valeur de l'attribut. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Obtenir la clef privée d'une transaction depuis son ID de transaction. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction. - -Sorties : - -* *tx_key* - chaîne de caractères; Clef privée de la transaction. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Vérifier une transaction dans la chaîne de blocs avec sa clef privée. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction. -* *tx_key* - chaîne de caractères; Clef privée de transaction. -* *address* - chaîne de caractères; Adresse publique de destination de la transaction. - -Sorties : - -* *confirmations* - entier non signé; Nombre de blocs minés après celui contenant la transaction. -* *in_pool* - booléen; Indique si la transaction est toujours dans le pool ou si elle a été ajoutée à un bloc. -* *received* - entier non signé; Montant de la transaction. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Obtenir la signature d'une transaction pour la prouver. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction. -* *address* - chaîne de caractères; Adresse publique de destination de la transaction. -* *message* - chaîne de caractères; (Optionnel) ajoute un message à la signature pour améliorer l'authentification du processus de preuve. - -Sorties : - -* *signature* - chaîne de caractères; Signature de la transaction. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prouver une transaction en contrôlant sa signature. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction. -* *address* - chaîne de caractères; Adresse publique de destination de la transaction. -* *message* - chaîne de caractères; (Optionnel) Doit être le même message que celui utilisé dans `get_tx_proof`. -* *signature* - chaîne de caractères; Signature de la transaction à confirmer. - -Sorties : - -* *confirmations* - entier non signé; Nombre de blocs minés après celui contenant la transaction. -* *good* - booléen; Indique si les entrées prouvent la transaction. -* *in_pool* - booléen; Indique si la transaction est toujours dans le pool ou si elle a été ajoutée à un bloc. -* *received* - entier non signé; Montant de la transaction. - -Dans l'exemple ci-dessous, la transaction a été prouvée : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -Dans l'exemple ci-dessous, le message utilisé est mauvais, empêchant la preuve de la transaction : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Génère une signature pour prouver une dépense. Contrairement à la preuve d'une transaction, cela ne nécessite pas l'adresse publique de destination. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction. -* *message* - chaîne de caractères; (Optionnel) ajoute un message à la signature pour améliorer l'authentification du processus de vérification. - -Sorties : - -* *signature* - chaîne de caractères; Signature de la dépense. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prouver une dépense en utilisant une signature. Contrairement à la preuve d'une transaction, cela ne nécessite pas l'adresse publique de destination. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction. -* *message* - chaîne de caractères; (Optionnel) Doit être le même message que celui utilisé dans `get_spend_proof`. -* *signature* - chaîne de caractères; Signature de la dépense à confirmer. - -Sorties : - -* *good* - booléen; Indique si les entrées prouvent la dépense. - -Dans l'exemple ci-dessous, la dépense a été prouvée : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -Dans l'exemple ci-dessous, le message utilisé est mauvais, empêchant la preuve de la dépense : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Générer une signature prouvant d'un certain montant disponible dans un portefeuille. - -Alias : *Aucun*. - -Entrées : - -* *all* - booléen; Prouve que tout le solde du portefeuille est utilisable. -* *account_index* - entier non signé; Spécifie le compte pour lequel prouver une réserve. (ignoré si `all` positionné à `true`) -* *amount* - entier non signé; Montant (en @unités-atomiques) à prouver dont dispose le compte. (ignoré si `all` positionné à `true`) -* *message* - chaîne de caractères; (Optionnel) ajoute un message à la signature pour améliorer l'authentification du processus de vérification. - -Sorties : - -* *signature* - chaîne de caractères; Signature de la réserve. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Prouve qu'un portefeuille contient une réserve utilisable en utilisant une signature. - -Alias : *Aucun*. - -Entrées : - -* *address* - chaîne de caractères; Adresse publique du portefeuille. -* *message* - chaîne de caractères; (Optionnel) Doit être le même message que celui utilisé dans `get_reserve_proof`. -* *signature* - chaîne de caractères; Signature de la réserve à confirmer. - -Sorties : - -* *good* - booléen; Indique si les entrées prouvent la réserve. - -Dans l'exemple ci-dessous, la réserve a été prouvée : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -Dans l'exemple ci-dessous, toute la réserve du portefeuille a été prouvée : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -Dans l'exemple ci-dessous, le message utilisé est mauvais, empêchant la preuve de la réserve : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Retourne une liste de transferts. - -Alias : *Aucun*. - -Entrées : - -* *in* - booléen; (Optionnel) Inclure les transferts entrants. -* *out* - booléen; (Optionnel) Inclure les transferts sortants. -* *pending* - booléen; (Optionnel) Inclure les transferts en attente. -* *failed* - booléen; (Optionnel) Inclure les transferts échoués. -* *pool* - booléen; (Optionnel) Inclure les transferts du pool de transactions du démon. -* *filter_by_height* - booléen; (Optionnel) Filtrer les transferts par hauteur de bloc. -* *min_height* - entier non signé; (Optionnel) Hauteur de bloc minimale pour rechercher les transferts, si le filtrage par hauteur de bloc est activé. -* *max_height* - entier non signé; (Opional) Hauteur de bloc maximale pour rechercher les transferts, si le filtrage par hauteur de bloc est activé (Hauteur de bloc maximale par défaut). -* *account_index* - entier non signé; (Optionnel) Index du compte pour lequel rechercher les transferts. (0 par défaut) -* *subaddr_indices* - liste d'entier non signé; (Optionnel) Liste d'indices de sous-adresse pour lequel rechercher les transferts. (vide par défaut - tous les indices) - -Sorties : - -* *in* liste de transferts : - * *address* - chaîne de caractères; Adresse publique du transfert. - * *amount* - entier non signé; Montant transféré. - * *confirmations* - entier non signé; Nombre de blocs minés depuis le bloc contenant cette transaction (ou hauteur de bloc à laquelle la transaction devrait être ajoutée à un bloc si elle n'est pas encore confirmée). - * *double_spend_seen* - booléen; `True` si l(es) image(s) de clef du transfert ont été vues par le passé. - * *fee* - entier non signé; Frais de transaction pour ce transfert. - * *height* - entier non signé; Hauteur du premier bloc ayant confirmé ce transfert (0 si pas encore miné). - * *note* - chaîne de caractères; Remarque à propos de ce transfert. - * *payment_id* - chaîne de caractères; ID de paiement pour ce transfert. - * *subaddr_index* - Objet JSON contenant les index majeur & mineur de sous-adresse : - * *major* - entier non signé; Index de compte pour la sous-adresse. - * *minor* - entier non signé; Index de la sous-adresse under the account. - * *suggested_confirmations_threshold* - entier non signé; Estimation des confirmations nécessaires pour que ce transfert soit inclu dans un bloc. - * *timestamp* - entier non signé; Temps POSIX de la première confirmation dans un bloc de ce transfert (ou moment de la soumission s'il n'est pas encore miné). - * *txid* - chaîne de caractères; ID de transaction pour ce transfert. - * *type* - chaîne de caractères; Type de transfert : "in" - * *unlock_time* - entier non signé; Nombre de blocs avant que ce transfert puisse être dépensé en toute sécurité. -* *out* liste de transferts (voir ci-dessus). -* *pending* liste de transferts (voir ci-dessus). -* *failed* liste de transferts (voir ci-dessus). -* *pool* liste de transferts (voir ci-dessus). - - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Affiche les informations à propos d'un transfert depuis ou vers cette adresse. - -Alias : *Aucun*. - -Entrées : - -* *txid* - chaîne de caractères; ID de transaction utilisé pour trouver le transfert. -* *account_index* - entier non signé; (Optionnel) Index du compte pour lequel rechercher les transferts. - -Sorties : - -* *transfer* - Objet JSON contenant les informations de paiement : - * *address* - chaîne de caractères; Adresse ayant transféré les fonds. Représentation Base58 des clefs publiques. - * *amount* - entier non signé; Montant de ce transfert. - * *confirmations* - entier non signé; Nombre de blocs minés depuis le bloc contenant cette transaction (ou hauteur de bloc à laquelle la transaction devrait être ajoutée à un bloc si elle n'est pas encore confirmée). - * *destinations* - liste d'objets JSON contenant les destinations du transfert : - * *amount* - entier non signé; Montant transféré vers cette destination. - * *address* - chaîne de caractères; Address de cette destination. Représentation Base58 des clefs publiques. - * *double_spend_seen* - booléen; `True` si l(es) image(s) de clef du transfert ont été vues par le passé. - * *fee* - entier non signé; Frais de transaction pour ce transfert. - * *height* - entier non signé; Hauteur du premier bloc ayant confirmé ce transfert. - * *note* - chaîne de caractères; Remarque à propos de ce transfert. - * *payment_id* - chaîne de caractères; ID de paiement pour ce transfert. - * *subaddr_index* - Objet JSON contenant les index majeur & mineur de sous-adresse : - * *major* - entier non signé; Index de compte pour la sous-adresse. - * *minor* - entier non signé; Index de la sous-adresse under the account. - * *suggested_confirmations_threshold* - entier non signé; Estimation des confirmations nécessaires pour que ce transfert soit inclu dans un bloc. - * *timestamp* - entier non signé; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - chaîne de caractères; ID de transaction de ce transfert (identique à l'ID de transaction en entrée). - * *type* - chaîne de caractères; Type de transfert, l'un de : "in", "out", "pending", "failed", "pool" - * *unlock_time* - entier non signé; Nombre de blocs avant que ce transfert puisse être dépensé en toute sécurité. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Signer une chaîne de caractères. - -Alias : *Aucun*. - -Entrées : - -* *data* - chaîne de caractères; Tout ce que vous avez besoin de signer. - -Sorties : - -* *signature* - chaîne de caractères; Signature généré à partir de `data` et de l'adresse publique du compte. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verifier la signature d'une chaîne de caractères. - -Alias : *Aucun*. - -Entrées : - -* *data* - chaîne de caractères; Ce qui doit avoir été signé. -* *address* - chaîne de caractères; Adresse publique du portefeuille utilisé pour `signer` les données. -* *signature* - chaîne de caractères; Signature générée par la méthode `sign`. - -Sorties : - -* *good* - booléen; - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Exporte toutes les sorties au format hexadécimal. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *outputs_data_hex* - chaîne de caractères; Sortie du portefeuille au format hexadécimal. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Importer des sorties au format hexadécimal. - -Alias : *Aucun*. - -Entrées : - -* *outputs_data_hex* - chaîne de caractères; Sorties de portefeuille au format hexadecimal. - -Sorties : - -* *num_imported* - entier non signé; Nombre de sorties importées. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Exporter un lot signé d'images de clef. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *signed_key_images* - liste de d'images de clef signées : - * *key_image* - chaîne de caractères; - * *signature* - chaîne de caractères; - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Importer une liste d'images de clefs signées et vérifier leur état de dépense. - -Alias : *Aucun*. - -Entrées : - -* *signed_key_images* - liste d'images de clef signées : - * *key_image* - chaîne de caractères; - * *signature* - chaîne de caractères; - -Sorties : - -* *height* - entier non signé; -* *spent* - entier non signé; Montant (en @unités-atomiques) dépensé depuis ces images de clef. -* *unspent* - entier non signé; Montant (en @unités-atomiques) toujours disponible depuis ces images de clef. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Créer une URI de paiement utilisant les spécifications URI officielles. - -Alias : *Aucun*. - -Entrées : - -* *address* - chaîne de caractères; Adresse de portefeuille. -* *amount* - entier non signé; (optionnel) Le montant sous forme d'entier à recevoir, en **@unités-atomiques**. -* *payment_id* - chaîne de caractères; (optionnel) ID de paiement de 16 ou 64 caractères hexadécimaux. -* *recipient_name* - chaîne de caractères; (optionnel) Nom du destinataire du paiement. -* *tx_description* - chaîne de caractères; (optionnel) Description du motif de la transaction. - -Sorties : - -* *uri* - chaîne de caractères; Contient toutes les informations entrées sous forme d'une URI de paiement correctement formatée. - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Analyser une URI de paiement pour obtenir les informations de paiement. - -Alias : *Aucun*. - -Entrées : - -* *uri* - chaîne de caractères; Contient toutes les informations entrées sous forme d'une URI de paiement correctement formatée. - -Sorties : - -* *uri* - Objet JSON contenant les informations de paiement : - * *address* - chaîne de caractères; Adresse de portefeuille - * *amount* - entier non signé; Montant sous forme d'entier à recevoir, en @unités-atomiques (0 si non fourni) - * *payment_id* - chaîne de caractères; ID de paiement de 16 ou 64 caractères hexadécimaux (vide si non fourni) - * *recipient_name* - chaîne de caractères; Nom du destinataire du paiement (vide si non fourni) - * *tx_description* - chaîne de caractères; Description du motif de la transaction (vide si non fourni) - -Exemple : - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Récupère les entrées du carnet d'adresses. - -Alias : *Aucun*. - -Entrées : - -* *entries* - liste d'entier non signé; indices des entrées recherchées du carnet d'adresses. - -Sorties : - -* *entries* - liste d'entrées: - * *address* - chaîne de caractères; Adresse publique de l'entrée. - * *description* - chaîne de caractères; Description de cette entrée. - * *index* - entier non signé; - * *payment_id* - chaîne de caractères; - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Ajouter une entrée au carnet d'adresse. - -Alias : *Aucun*. - -Entrées : - -* *address* - chaîne de caractères; -* *payment_id* - (optionnel) chaîne de caractères, "0000000000000000000000000000000000000000000000000000000000000000" par défaut; -* *description* - (optionnel) chaîne de caractères, "" par défaut; - -Sorties : - -* *index* - entier non signé; L'index de l'entrée du carnet d'adresses. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Supprime une entrée du carnet d'adresses. - -Alias : *Aucun*. - -Entrées : - -* *index* - entier non signé; L'index de l'entrée du carnet d'adresses. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Rafraichit un portefeuille après son ouverture. - -Alias : *Aucun*. - -Entrées : - -* *start_height* - entier non signé; (Optionnel) La hauteur de bloc à partir de laquelle commencer le rafraichissement. - -Sorties : - -* *blocks_fetched* - entier non signé; Nombre de nouveaux blocs scannés. -* *received_money* - booléen; Indique si des transactions à destination du portefeuille ont été trouvées dans les blocs. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescanner la chaîne de bloc pour des sorties dépensées. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Démarrer l'extraction minière dans le démon Monero. - -Alias : *Aucun*. - -Entrées : - -* *threads_count* - entier non signé; Nombre de processus créés pour l'extraction minière. -* *do_background_mining* - booléen; Permet de démarrer le mineur en mode d'@Extraction-minière-intelligente -* *ignore_battery* - booléen; Ignore l'état de la batterie (pour l'@Extraction-minière-intelligente uniquement) - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Arrête l'extraction minière sur le démon Monero. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Obtenir la listes des langues disponibles pour la phrase mnémonique de votre portefeuille. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *languages* - liste de chaîne de caractères; Liste des langues disponibles. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Créer un nouveau portefeuille. Vous devez avoir utiliser l'option "--wallet-dir" lors du lancement de monero-wallet-rpc pour que cela fonctionne. - -Alias : *Aucun*. - -Entrées : - -* *filename* - chaîne de caractères; Nom du fichier du portefeuille. -* *password* - chaîne de caractères; (Optionnel) mot de passe pour protéger le portefeuille. -* *language* - chaîne de caractères; Langue de la phrase mnémonique du portefeuille. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Ouvrir un portefeuille. Vous devez avoir utiliser l'option "--wallet-dir" lors du lancement de monero-wallet-rpc pour que cela fonctionne. - -Alias : *Aucun*. - -Entrées : - -* *filename* - chaîne de caractères; Nom du portefeuille stocké dans --wallet-dir. -* *password* - chaîne de caractères; (Optionnel) uniquement nécessaire si le portefeuille a un mot de passe défini. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Ferme le portefeuille actuel, après avoir essayé de le sauvegarder. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Changer le mot de passe d'un portefeuille. - -Alias : *Aucun*. - -Entrées : - -* *old_password* - chaîne de caractères; (Optionnel) Mot de passe actuel du portefeuille, si défini. -* *new_password* - chaîne de caractères; (Optionnel) Nouveau mot de passe du portefeuille, si non vide. - -Sorties : *Aucun*. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Vérifie si un portefeuille est un portefeuille multi-signatures. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *multisig* - booléen; Indique si le portefeuille est multi-signatures. -* *ready* - booléen; -* *threshold* - entier non signé; Nombre de signatures nécessaires pour signer un transfert. -* *total* - entier non signé; Nombre total de signature dans le portefeuille multi-signatures. - -Exemple pour un portefeuille non-multi-signatures : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Exemple pour un portefeuille multi-signatures : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare un portefeuille pour les multi-signatures en générant une chaîne de caractères de multi-signatures à partager avec les homologues. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *multisig_info* - chaîne de caractères; Chaîne de caractères de multi-signatures à partager avec des homologues pour créer le portefeuille multi-signatures. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Rendre un portefeuille multi-Signatures en important les chaînes de caractères de multi-signatures des homologues. - -Alias : *Aucun*. - -Entrées : - -* *multisig_info* - liste de chaîne de caractères; Liste des chaînes de caractères de multi-signatures des homologues. -* *threshold* - entier non signé; Nombres de signatures nécessaires pour signer un transfert. Doit être plus petit ou égal au nombre de signatures dans `multisig_info`. -* *password* - chaîne de caractères; Mot de passe du portefeuille. - -Sorties : - -* *address* - chaîne de caractères; Adresse du portefeuille multi-signatures. -* *multisig_info* - chaîne de caractères; Chaîne de caractères multi-signatures à partager avec les homologues pour créer le portefeuille multi-signatures (étape supplémentaire pour les portefeuilles N-1/N). - -Exemple pour un portefeuille multi-Signatures 2/2 : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Exemple pour un portefeuille multi-Signatures 2/3 : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Exporter les informations multi-signatures pour les autres participants. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *info* - chaîne de caractères; Informations multi-signatures au format hexadécimal pour les autres participants. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Imporer les informations multi-signatures provenant des autres participants. - -Alias : *Aucun*. - -Entrées : - -* *info* - liste de chaîne de caractères; Liste d'informations multi-signatures au format hexadécimal provenant des autres participants. - -Sorties : - -* *n_outputs* - entier non signé; Nombre de sorties signées avec ces informations multi-signatures. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Changer ce portefeuille en portefeuille multi-signature, étape supplémentaire pour les portefeuilles N-1/N. - -Alias : *Aucun*. - -Entrées : - -* *multisig_info* - liste de chaîne de caractères; Liste des chaînes de caractères de multi-signatures des homologues. -* *password* - chaîne de caractères; Mot de passe du portefeuille. - -Sorties : - -* *address* - chaîne de caractères; Adresse du portefeuille multi-signatures. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Signer une transaction en multi-signatures. - -Alias : *Aucun*. - -Entrées : - -* *tx_data_hex* - chaîne de caractères; Transaction multi-signature au format hexadécimal, telle que renvoyé par la méthode `transfer` via `multisig_txset`. - -Sorties : - -* *tx_data_hex* - chaîne de caractères; Transaction multi-signatures au format hexadécimal. -* *tx_hash_list* - liste de chaîne de caractères; Liste de hachages de transaction. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Soumettre une transaction mutli-signatures signée. - -Alias : *Aucun*. - -Entrées : - -* *tx_data_hex* - chaîne de caractères; Transaction multi-signatures au format hexadécimal, telle que renvoyé par la méthode `sign_multisig` via `tx_data_hex`. - -Sorties : - -* *tx_hash_list* - liste de chaîne de caractères; Liste de hachages de transaction. - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Obtenir les versions RPC majeures et mineures au format entier, ou la version majeure constitue les 16 premiers bits, et la version mineure les 16 derniers bits. - -Alias : *Aucun*. - -Entrées : *Aucun*. - -Sorties : - -* *version* - entier non signé; version RPC, formatté avec `Majeure * 2^16 + Mineure` (Majeure encodée sur les 16 premiers bits, et Mineure sur les 16 derniers bits). - -Exemple : - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/it/resources/developer-guides/daemon-rpc.md b/_i18n/it/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/it/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/it/resources/developer-guides/wallet-rpc.md b/_i18n/it/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/it/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/nl/resources/developer-guides/daemon-rpc.md b/_i18n/nl/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/nl/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/nl/resources/developer-guides/wallet-rpc.md b/_i18n/nl/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/nl/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/pl/resources/developer-guides/daemon-rpc.md b/_i18n/pl/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 1a1ac7c7..00000000 --- a/_i18n/pl/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,834 +0,0 @@ -{% assign version = '1.1.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Wprowadzenie - -Poniżej znajduje się lista funkcji RPC demona monerod, ich wejścia i wyników oraz przykłady. - -Wiele funkcji RPC korzysta z interfejsu demona JSON RPC, podczas gdy inne używają własnego interfejsu, jak przedstawiono poniżej. - -Uwaga: "jednostki atomowe (@atomic-unit)" dotyczą najmniejszego ułamka 1 XMR, zgodnie z implementacją monerod. **1 XMR = 1e12 jednostek atomowych.** - -### [Metody JSON RPC](#json-rpc-methods): - -* [getblockcount](#getblockcount) -* [on_getblockhash](#on_getblockhash) -* [getblocktemplate](#getblocktemplate) -* [submitblock](#submitblock) -* [getlastblockheader](#getlastblockheader) -* [getblockheaderbyhash](#getblockheaderbyhash) -* [getblockheaderbyheight](#getblockheaderbyheight) -* [getblock](#getblock) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [setbans](#setbans) -* [getbans](#getbans) - -### [Pozostałe metody RPC](#other-daemon-rpc-calls): - -* [/getheight](#getheight) -* [/gettransactions](#gettransactions) -* [/is_key_image_spent](#is_key_image_spent) -* [/sendrawtransaction](#sendrawtransaction) -* [/get_transaction_pool](#get_transaction_pool) -* [/stop_daemon](#stop_daemon) - - ---- - -## Metody JSON RPC - -Większość funkcji RPC monerod korzysta z interfejsu demona `json_rpc`, aby żądać różnych informacji. Wszystkie te metody mają podobną strukturę, na przykład: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Niektóre metody zawierają parametry, a inne nie. Poniżej znajdują się przykłady każdej z funkcji JSON RPC. - -### **getblockcount** - -Sprawdza ile bloków znajduje się w najdłuższym łańcuchu znanym węzłowi. - -Wejście: *brak*. - -Wynik: - -* *count* - niepodpisana liczba całkowita; liczba bloków w najdłuższym łańcuchu znanym węzłowi. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblockcount"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_getblockhash** - -Wyszukuje hasz bloku za pomocą jego wysokości. - -Wejście: - -* wysokość bloku (liczba całkowita szeregu o długości 1) - -Wynik: - -* hasz bloku (ciąg) - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_getblockhash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **getblocktemplate** - -Wejście: - -* *wallet_address* - ciąg; Adres portfela, który otrzyma transakcję coinbase, jeśli blok zostanie pomyślnie wydobyty. -* *reserve_size* - niepodpisana liczba całkwita; Wielkość rezerwy. - -Wynik: - -* *blocktemplate_blob* - ciąg; Blob, na którym próbuje się wydobyć nowy blok. -* *difficulty* - niepodpisana liczba całkowita; Trudność następnego bloku. -* *height* - niepodpisana liczba całkowita; Wysokość, na której się wydobywa. -* *prev_hash* - ciąg; Hasz ostatniego bloku, po którym wydobywa się następny blok. -* *reserved_offset* - niepodpisana liczba całkowita; Zarezerwowany offset. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblocktemplate","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocktemplate_blob": "01029af88cb70568b84a11dc9406ace9e635918ca03b008f7728b9726b327c1b482a98d81ed83000000000018bd03c01ffcfcf3c0493d7cec7020278dfc296544f139394e5e045fcda1ba2cca5b69b39c9ddc90b7e0de859fdebdc80e8eda1ba01029c5d518ce3cc4de26364059eadc8220a3f52edabdaf025a9bff4eec8b6b50e3d8080dd9da417021e642d07a8c33fbe497054cfea9c760ab4068d31532ff0fbb543a7856a9b78ee80c0f9decfae01023ef3a7182cb0c260732e7828606052a0645d3686d7a03ce3da091dbb2b75e5955f01ad2af83bce0d823bf3dbbed01ab219250eb36098c62cbb6aa2976936848bae53023c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f12d7c87346d6b84e17680082d9b4a1d84e36dd01bd2c7f3b3893478a8d88fb3", - "difficulty": 982540729, - "height": 993231, - "prev_hash": "68b84a11dc9406ace9e635918ca03b008f7728b9726b327c1b482a98d81ed830", - "reserved_offset": 246, - "status": "OK" - } -} -``` - - -### **submitblock** - -Zatwierdza wydobyty blok do sieci. - -Wejście: - -* Dane blobu bloku - ciąg - -Wynik: - -* *status* - ciąg; Status zatwierdzenia bloku. - - -### **getlastblockheader** - -Dzięki tej metodzie łatwo jest znaleźć informacje o nagłówku ostatniego bloku. Nie wymaga żadnych wejść. - -Wejście: *brak*. - -Wynik: - -* *block_header* - struktura zawierająca informacje o nagłówku bloku. - * *depth* - niepodpisana liczba całkowita; liczba bloków następujących po danym bloku w łańcuchu, większa liczba oznacza starszy blok. - * *difficulty* - niepodpisana liczba całkowita; siła sieci Monero na podstawie mocy wydobycia. - * *hash* - ciąg; hasz danego bloku. - * *height* - niepodpisana liczba całkowita; liczba bloków poprzedzających dany blok w łańcuchu. - * *major_version* - niepodpisana liczba całkowita; główna wersja protokołu Monero na danej wysokości bloku. - * *minor_version* - niepodpisana liczba całkowita; podrzędna wersja protokołu Monero na danej wysokości bloku. - * *nonce* - niepodpisana liczba całkowita; losowy i jednorazowy numer kryptograficzny użyty do wydobycia bloku Monero. - * *orphan_status* - logiczny typ danych; zazwyczaj `false`. Jeśli `true`, dany blok nie jest częścią najdłuższego łańcucha. - * *prev_hash* - ciąg; hasz bloku bezpośrednio poprzedzającego dany blok w łańcuchu. - * *reward* - niepodpisana liczba całkowita; liczba nowych jednostek atomowych wytworzonych w danym bloku i przyznanych górnikowi. Zauważ: 1 XMR = 1e12 jednostek atomowych. - * *timestamp* - niepodpisana liczba całkowita; czas, kiedy blok został zapisany w łańcuchu. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -W tym przypadku wynikiem jest ostatni blok (wtedy był to blok 990793): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getlastblockheader"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "depth": 0, - "difficulty": 746963928, - "hash": "ac0f1e226268d45c99a16202fdcb730d8f7b36ea5e5b4a565b1ba1a8fc252eb0", - "height": 990793, - "major_version": 1, - "minor_version": 1, - "nonce": 1550, - "orphan_status": false, - "prev_hash": "386575e3b0b004ed8d458dbd31bff0fe37b280339937f971e06df33f8589b75c", - "reward": 6856609225169, - "timestamp": 1457589942 - }, - "status": "OK" - } -} -``` - - -### **getblockheaderbyhash** - -Informacja o nagłówku bloku może zostać znaleziona przy użyciu haszu bloku lub jego wysokości. Ta metoda polega na wykorzystaniu bloku haszu jako parametru wejścia w celu uzyskania podstawowych informacji na temat bloku. - -Wejście: - -* *hash* - ciąg; hasz sha256 bloku. - -Wynik: - -* *block_header* - struktura zawierająca informacje o nagłówku bloku. Zobacz [getlastblockheader](#getlastblockheader). - -W tym przypadku wyszukano blok 912345 za pomocą jego haszu: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblockheaderbyhash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "depth": 78376, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK" - } -} -``` - - -### **getblockheaderbyheight** - -Podobnie do funkcji `getblockheaderbyhash` wspomnianej wcześniej, metoda ta bierze pod uwagę wysokość bloku jako parametr wejścia, aby otrzymać podstawowe informacje na temat bloku. - -Wejście: - -* *height* - niepodpisana liczba całkowita; wysokość bloku. - -Wynik: - -* *block_header* - Struktura zawierająca informacje na temat nagłówka bloku. Zobacz funkcję [getlastblockheader](#getlastblockheader). - -W tym przypadku wyszukano blok 912345 za pomocą jego wysokości (zauważ, że wyszukane informacje są takie same jak w poprzednim przykładzie): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblockheaderbyheight","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "depth": 78376, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK" - } -} -``` - - -### **getblock** - -Pełne informacje na temat bloku mogą być wyszukane za pomocą wysokości bloku lub jego hasza, podobnie do wcześniej opisanych funkcji wyszukania nagłówka bloku. Dla pełnych informacji na temat bloku, obydwa rodzaje wyszukiwania korzystają z tej samej metody, jednak z różnymi paramterami wejścia. - -Wejście (wybierz jedno z następujących): - -* *height* - niepodpisana liczba całkowita; wysokość bloku. -* *hash* - ciąg; hasz bloku. - -Wynik: - -* *blob* - ciąg; heksadecymalny blok zawierający informacje o bloku. -* *block_header* - struktura zwierająca informacje na temat nagłówka bloku. Zobacz [getlastblockheader](#getlastblockheader). -* *json* - ciąg json; szczegóły bloku w formacie JSON: - * *major_version* - to samo co w nagłówku bloku. - * *minor_version* - to samo co w nagłówku bloku. - * *timestamp* - to samo co w nagłówku bloku. - * *prev_id* - to samo co `prev_hash` w nagłówku bloku - * *nonce* - to samo co w nagłówku bloku. - * *miner_tx* - informacje na temat transakcji górnika. - * *version* - numer wersji transakcji. - * *unlock_time* - wysokość bloku gdy transakcja coinbase stanie się zdolna do wydania. - * *vin* - lista wejść transakcji: - * *gen* - transakcje górnika są transakcjami coinbase, inaczej "gen". - * *height* - wysokość danego bloku, czyli kiedy coinbase został wygenerowany. - * *vout* - lista wyjść transakcji. Każde wyjście zawiera: - * *amount* - kwotę wyjścia w jednostkach atomowych. - * *target* - - * *key* - - * *extra* - zazwyczaj nazywane "numerem identyfikacyjnym transakcji", może być użyte do zawarcia jakiegokolwiek ciągu 32- bajtowego/64-znakowego heksadecymalnego. - * *signatures* - zawiera podpisy uczestników transakcji. Transakcje coinbase nie posiadają podpisów. - * *tx_hashes* - lista haszy transakcji nie-coinbase w bloku. Jeśli nie było takich transakcji, lista będzie pusta. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -**Wyszukiwanie przy użyciu wysokości:** - -W poniższym przykładzie wyszukano blok 912345 za pomocą jego wysokości. Zauważ, że blok ten nie posiada żadnych transakcji nie-coinbase (zobacz blok z dodatkowymi transakcjami w następnym przykładzie): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblock","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "...", - "block_header": { - "depth": 80694, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} -``` - -**Wyszukiwanie za pomocą hasza:** - -W poniższym przykładzie wyszukano blok 993056 za pomocą jego hasza. Zauważ, że ten blok posiada 3 transakcje nie-coinbase: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblock","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "...", - "block_header": { - "depth": 12, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"] - } -} -``` - - -### **get_connections** - -Wyszukuje informacje na temat przychodzących i wychodzących połączeń z twoim węzłem. - -Wejście: *brak*. - -Wynik: - -* *connections* - lista wszystkich połączeń i ich informacje: - * *avg_download* - niepodpisana liczba całkowita; średnia bajtów ściągniętych przez węzeł. - * *avg_upload* - niepodpisana liczba całkowita; średnia bajtów przesłanych przez węzeł. - * *current_download* - niepodpisana liczba całkowita; aktualna liczba bajtów ściągniętych przez węzeł. - * *current_upload* - niepodpisana liczba całkowita; aktualna liczba bajtów przesłanych przez węzeł. - * *incoming* - logiczny typ danych; czy dany węzeł otrzymuje informacje z twojego węzła? - * *ip* - ciąg; adres IP danego węzła. - * *live_time* - niepodpisana liczba całkowita - * *local_ip* - logiczny typ danych - * *localhost* - logiczny typ danych - * *peer_id* - ciąg; ID węzła w sieci. - * *port* - ciąg; port używany przez węzeł do połączenia z siecią. - * *recv_count* - niepodpisana liczba całkowita - * *recv_idle_time* - niepodpisana liczba całkowita - * *send_count* - niepodpisana liczba całkowita - * *send_idle_time* - niepodpisana liczba całkowita - * *state* - ciąg - -Poniżej znajduje się przykład funkcji `get_connections` i jej wyniki: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "avg_download": 0, - "avg_upload": 0, - "current_download": 0, - "current_upload": 0, - "incoming": false, - "ip": "76.173.170.133", - "live_time": 1865, - "local_ip": false, - "localhost": false, - "peer_id": "3bfe29d6b1aa7c4c", - "port": "18080", - "recv_count": 116396, - "recv_idle_time": 23, - "send_count": 176893, - "send_idle_time": 1457726610, - "state": "state_normal" - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Wyszukuje podstawowe informacje na temat stanu twojego węzła oraz sieci. - -Wejście: *brak*. - -Wynik: - -* *alt_blocks_count* - niepodpisana liczba całkowita; liczba alternatywnych bloków głównego łańcucha. -* *difficulty* - niepodpisana liczba całkowita; trudność sieci (analogiczna do siły sieci). -* *grey_peerlist_size* - niepodpisana liczba całkowita; rozmiar szarej listy peerów. -* *height* - niepodpisana liczba całkowita; aktualna długość najdłuższego łańcucha znanego demonowi. -* *incoming_connections_count* - niepodpisana liczba całkowita; liczba peerów podłączonych i korzystających z twojego węzła. -* *outgoing_connections_count* - niepodpisana liczba całkowita; liczba peerów, do których jesteś podłączony i od których pobierasz informacje. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. -* *target* - niepodpisana liczba całkowita; aktualny cel następnego dowodu pracy. -* *target_height* - niepodpisana liczba całkowita; wysokość następnego bloku w łańcuchu. -* *testnet* - logiczny typ danych; określa, czy węzeł jest w sieci testowej ("true") lub sieci głównej ("false"). -* *top_block_hash* - ciąg; hasz najwyższego bloku w łańcuchu. -* *tx_count* - niepodpisana liczba całkowita; łączna liczba transakcji nie-coinbase w łańcuchu. -* *tx_pool_siz* - niepodpisana liczba całkowita; liczba transakcji, które zostały nadane, ale nie uwzględnione w bloku. -* *white_peerlist_size* - niepodpisana liczba całkowita; rozmiar białej listy peerów. - -Poniżej znajduje się przykład funkcji `get_info` i jej wyniki: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 5, - "difficulty": 972165250, - "grey_peerlist_size": 2280, - "height": 993145, - "incoming_connections_count": 0, - "outgoing_connections_count": 8, - "status": "OK", - "target": 60, - "target_height": 993137, - "testnet": false, - "top_block_hash": "", - "tx_count": 564287, - "tx_pool_size": 45, - "white_peerlist_size": 529 - } -} -``` - - -### **hard_fork_info** - -Wyszukuje informacje na temat głosowania na hard fork oraz jego gotowości. - -Wejście: *brak*. - -Wynik: - -* *earliest_height* - niepodpisana liczba całkowita; wysokość bloku, na której hard fork byłby dokonany, jeśli przegłosowany. -* *enabled* - logiczny typ danych; okreśa, czy hard fork został wyegzekwowany. -* *state* -niepodpisana liczba całkowita; aktualny stan hard forku: 0 (hard fork jest prawdopodobny), 1 (aktualizacja jest konieczna do prawidłowego forku), or 2 (wszystko jest w porządku). -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. -* *threshold* - niepodpisana liczba całkowita; minimalny procent głosów wymagany do rozpoczęcia hard forku. Domyślną liczbą jest 80. -* *version* - niepodpisana liczba całkowita; główna wersja bloku do hard forku. -* *votes* - niepodpisana liczba całkowita; liczba głosów za hard forkiem. -* *voting* - niepodpisana liczba całkowita; status głosowania za hard forkiem. -* *window* - niepodpisana liczba całkowita; liczba bloków, w których oddano głosy. Domyślną liczbą jest 10080 bloków. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **setbans** - -Banuje inny węzeł za pomocą IP. - -Wejście: - -* *bans* - lista węzłów do zbanowania: - * *ip* - niepodpisana liczba całkowita; adres IP do zbanowania w formacie numerycznym. - * *ban* - logiczny typ danych; ustaw `true`, aby zbanować. - * *seconds* - niepodpisana liczba całkowita; liczba sekund do zbanowania węzła. - -Wynik: - -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"setbans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **getbans** - -Wejście: *brak*. - -Wynik: - -* *bans* - list zbanowanych węzłów: - * *ip* - niepodpisana liczba całkowita; zbanowany adres IP w formacie numerycznym. - * *seconds* - niepodpisana liczba całkowita; lokalny czas uniksowy, do kiedy dany adres IP jest zbanowany. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "ip": 838969536, - "seconds": 1457748792 - }], - "status": "OK" - } -} -``` - - ---- - -## Pozostałe funkcje demona RPC - -Nie wszystkie funkcje demona RPC korzystają z interfejsu JSON_RPC. Ta sekcja objaśnia przykłady takich funkcji. - -Struktura danych w tych funkcjach jest inna niż w funkcjacj JSON RPC. Podczas gdy metody JSON RPC są stosowane przy użyciu rozszerzenia `/json_rpc` i określeniu metody, poniższe funkcje są stosowane z własnymi rozszerzeniami. Na przykład: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Zauważ: zaleca się używanie funkcji JSON RPC, gdy jest to możliwe, na przykład zalecanym sposobem na wyszukanie wysokości węzła jest zastosowanie metody JSON RPC [get_info](#getinfo) lub [getlastblockheader](#getlastblockheader), a nie poniższej [getheight](#getheight). - - -### **/getheight** - -Wyszukanie aktualnej wysokości węzła. - -Wejście: *brak*. - -Wynik: - -* *height* - niepodpisana liczba całkowita; aktualna długość najdłuższego łańcucha znanego demonowi. - -``` -$ curl -X POST http://127.0.0.1:18081/getheight -H 'Content-Type: application/json' - -{ - "height": 993488, - "status": "OK" -} -``` - - -### **/gettransactions** - -Wyszukuje jedną lub więcej transakcji za pomocą hasza. - -Wejście: - -* *txs_hashes* - lista ciągów; listra haszów transakcji do wyszukania. -* *decode_as_json* - logiczny typ danych; opcjonalny. Jeśli ustawiony jako `true`, znalezione informacje na temat transakcji będą dekodowane, a nie binarne. - -Wynik: - -* *status* - kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. -* *txs_as_hex* - ciąg; pełna informacja na temat transakcji jako ciąg heksadecymalny. -* *txs_as_json* - ciąg json; (opcjonalny - znaleziony, jeśli tak wskazano w wejściu); lista informacji na temat transakcji: - * *version* - wersja transakcji. - * *unlock_time* - jeśli różne od 0, informuje o czasie, kiedy wyjście transakcji będzie gotowe do wydania. - * *vin* - lista wkładów do transakcji: - * *key* - publiczny klucz poprzedniego wyjścia, wydanego w tej transakcji. - * *amount* - kwota wkładu w jednostkach atomowych. - * *key_offsets* - lista numerycznych offsetów wkładu. - * *k_image* - obraz klucza danego wkładu. - * *vout* - lista wyjść transakcji: - * *amount* - kwota wyjścia transakcji w jednostkach atomowych. - * *target* - informacje na temat celu wyjścia: - * *key* - jednorazowy klucz publiczny odbiorcy. Ktokolwiek posiada prywatny klucz połączony z tym kluczem, kontroluje wyjście tej transakcji. - * *extra* - zazwyczaj nazywane "numerem identyfikacyjnym płatności", może zostać użyte do włączenia dowolnych 32 bajtów. - * *signatures* - lista podpisów użytych w podpisie pierścieniowym w celu ukrycia prawdziwego pochodzenia transakcji. - -Przykład 1: wynik jest informacją na temat transakcji w formacie binarnym. - -``` -$ curl -X POST http://127.0.0.1:18081/gettransactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs_as_hex": ["..."] -} -``` - - -Przykład 2: zdekoduj otrzymane informacje na temat transakcji w formacie JSON. Zauważ, że lista "vout" została skrócona w podanym wyniku ze względu na jej obszerność. - -``` -$ curl -X POST http://127.0.0.1:18081/gettransactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 70000000, \n \"key_offsets\": [ 35952\n ], \n \"k_image\": \"d16908468dff9438a9814fe96bdaa575f06fe8da85772b72e54926428712293d\"\n }\n }, {\n \"key\": {\n \"amount\": 400000000000000, \n \"key_offsets\": [ 6830\n ], \n \"k_image\": \"c7a7024b763df1181ae6fe821b70669735e38a68162ac02362e33acbe829b605\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 50000, \n \"target\": {\n \"key\": \"f6be43f7be4f06adcb1d06f4a07c637c7359e009cf3e57bb32b8c9ea636509c3\"\n }\n }, {\n \"amount\": 200000, \n \"target\": {\n \"key\": \"b0a7a8e32f2b5302552bcd8d85112c62838b1f56cccd844eb9b63e0a732d0353\"\n }\n }, ... \n ], \n \"extra\": [ 1, 225, 240, 98, 34, 169, 73, 47, 237, 117, 192, 30, 192, 60, 155, 47, 4, 115, 20, 21, 11, 13, 252, 219, 129, 13, 174, 37, 36, 78, 191, 141, 109\n ], \n \"signatures\": [ \"e6a3be8003d481d2855c8127f56871de3d28a4fb52385b999eb986c831c5cc08361c126b0db24a21b6c4299b438ee2be201d44d57a371230b9cd04395ab8c400\", \"8309851abaf2cf2a7091e0cdb9c83704fa7d68838a7a8ef8c178bb55a1e93a038dd18bb4a7549dc056b7a70e037cabd80911a03f427e36f712756d4c00f38f0b\"]\n}"] -} -``` - - -### **/is_key_image_spent** - -Sprawdza, czy wyjścia zostały wydane przy użyciu obrazu klucza powiązanego z wyjściem. - -Wejście: - -* *key_images* - lista ciągów; lista ciągów heksadecymalnych obrazu klucza do sprawdzenia. - -Wynik: - -* *spent_status* - lista niepodpisanych liczb całkowitych; lista statusów każdego sprawdzonego obrazu. Statusy są następujące: 0 = niewydany, 1 = wydany w łańcuchu bloków, 2 = wydany w puli transakcji. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" -} -``` - - -### **/sendrawtransaction** - -Nadaje surową transakcję do sieci. - -Wejście: - -* *tx_as_hex* - ciąg; pełna inforacja na temat transakcji jako ciąg heksadecymalny. - -Wynik: - -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. Jakikolwiek inny wynik oznacza, że coś poszło nie tak. -* *double_spend* - logiczny typ danych; Transakcja jest dwukrotnym wydaniem (`true`) lub nie (`false`). -* *fee_too_low* - logiczny typ danych; opłata jest za niska (`true`) lub nie (`false`). -* *invalid_input* - logiczny typ danych; wejście jest nieprawidłowe (`true`) lub prawidłowe (`false`). -* *invalid_output* - logiczny typ danych; wyjście jest nieprawidłowe (`true`) lub prawidłowe (`false`). -* *low_mixin* - logiczny typ danych; liczba Mixin jest zbyt niska (`true`) lub nie (`false`). -* *not_rct* - logiczny typ danych; transakcja nie jest transakcją pierścieniową (`true`) lub jest transakcją pierścieniową (`false`). -* *not_relayed* - logiczny typ danych; transakcja nie została przekazana (`true`) lub została przekazana (`false`). -* *overspend* - logiczny typ danych; transakcja korzysta z większej kwoty niż to możliwe (`true`) lub nie (`false`). -* *reason* - ciąg; dodatkowe informacje. Obecnie puste lub "Not relayed", jeśli transakcja została zaakceptowana, ale nie przekazana. -* *too_big* - logiczny typ danych; rozmiar transakcji jest zbyt duży (`true`) lub nie (`false`). - - -Przykład (informacja zwrotna nie została tu zawarta): - - -``` -$ curl -X POST http://127.0.0.1:18081/sendrawtransaction -d '{"tx_as_hex":"de6a3..."}' -H 'Content-Type: application/json' -``` - - -### **/get_transaction_pool** - -Wyszukuje informacje na temat ważnych transakcji widocznych przez węzeł, które nie zostały jeszcze wydobyte w bloku, oraz informacje na temat obrazu klucza wydawania w pamięci węzła. - -Wejście: *brak*. - -Wynik: - -* *spent_key_images* - lista obrazów klucza wydawania wyjścia: - * *id_hash* - ciąg; hasz numeru identyfikacyjnego obrazu klucza. - * *txs_hashes* - lista ciągów; hasze transakcji obrazu klucza. -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. -* *transactions* - lista transakcji w puli pamięci, które nie zostały uwzględnione w bloku: - * *blob_size* - niepodpisana liczba całkowita; rozmiar pełnego blobu transakcji. - * *fee* - niepodpisana liczba całkowita; kwota opłaty wydobywczej uwzględnionej w transakcji w jednostkach atomowych. - * *id_hash* - ciąg; hasz numeru identyfikacyjnego transakcji. - * *kept_by_block* - logiczny typ danych; nie akceptujemy transakcji, które skończyły się wcześsniej, chyba że ustawiono jako `true`. - * *last_failed_height* - niepodpisana liczba całkowita; jeśli transakcja skończyła się wcześniej, funckja ta określa, na jakiej wysokości się to stało. - * *last_failed_id_hash* - ciąg; podobnie do poprzedniej, funkcja ta określa poprzedni hasz numeru identyfikacyjnego transakcji. - * *max_used_block_height* - niepodpisana liczba całkowita; określa wysokość ostatniego bloku z wyjściem użytym do tej transakcji. - * *max_used_block_hash* - ciąg; określa hasz ostatniego bloku z wyjściem użytym do tej transakcji. - * *receive_time* - niepodpisana liczba całkowita; uniksowy czas, kiedy transakcja została zauważona w sieci po raz pierwszy przez węzeł. - * *tx_json* - ciąg json; struktura JSON wszystkich informacji o transakcji: - * *version* - wersja transakcji. - * *unlock_time* - jeśli różne od 0, określa czas, kiedy wyjście transakcji będzie możliwe do wydania. - * *vin* - lista wkładów do transakcji: - * *key* - publiczny klucz poprzedniego wyjścia, wydanego w tej transakcji. - * *amount* - kwota wkładu w jednostkach atomowych. - * *key_offsets* - lista numerycznych offsetów wkładu. - * *k_image* - obraz klucza danego wkładu. - * *vout* - lista wyjść transakcji: - * *amount* - kwota wyjścia transakcji w jednostkach atomowych. - * *target* - informacje na temat celu wyjścia: - * *key* - jednorazowy klucz publiczny odbiorcy. Ktokolwiek posiada prywatny klucz połączony z tym kluczem, kontroluje wyjście tej transakcji. - * *extra* - zazwyczaj nazywane "numerem identyfikacyjnym płatności", może zostać użyte do włączenia dowolnych 32 bajtów. - * *signatures* - lista podpisów użytych w podpisie pierścieniowym w celu ukrycia prawdziwego pochodzenia transakcji. - -Przykład (zauważ, że niektóre z list w poniższym wyniku zostały skrócone ze względu na ich obszerność): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "1edb9ecc39602040282d326070ad22cb473c952c0d6280c9c4c3b853fb34f3bc", - "txs_hashes": ["409911b2be02e3f0e930b326c67ab9e74675885ce23d71bb3bd28b62bc3e7803"] - },{ - "id_hash": "4adb4bb63b3397027340ca4e6c45f4ce2147dfb3a4e0fafdec18834ae594a05e", - "txs_hashes": ["946f1f4c52e3426a41959c93b60078f314813bc4bdebcf69b8ee11d593b2bd14"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 25761, - "fee": 290000000000, - "id_hash": "11d4cff23e610fac6a2b89187ad61d429a5e226652693dcac5d83d506eb92b96", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "max_used_block_height": 954508, - "max_used_block_id_hash": "03f96b374778bc059e47b96e2beec2e6d4d9e0ad39afeabdbcd77e1bd5a62f81", - "receive_time": 1457676127, - "tx_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 70000000000, \n \"key_offsets\": [ 63408, 18978, 78357, 16560\n ], \n \"k_image\": \"7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4\"\n }\n }, ... ], \n \"vout\": [ {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"094e6a1b187385533665f89db741149f42d95fdc50bdd2a2384bcd1dc5209c55\"\n }\n }, ... ], \n \"extra\": [ 2, 33, 0, 15, 56, 190, 21, 169, 77, 13, 182, 209, 51, 35, 54, 96, 89, 237, 96, 23, 24, 107, 240, 79, 40, 86, 64, 68, 45, 166, 119, 192, 17, 225, 23, 1, 31, 159, 145, 15, 173, 255, 165, 192, 55, 84, 127, 154, 163, 25, 85, 204, 212, 127, 147, 133, 118, 218, 166, 52, 78, 188, 131, 235, 9, 159, 105, 158\n ], \n \"signatures\": [ \"966e5a67fbdbf72d7dc0364b705121a58e0ced7e2ab45747b6b154c05a1afe04fac4aac7f64faa2dc6dd4d51b8277f11e2f2ec7729fac225088befe3b8399c0b71a4cb55b9d0e20f93d305c78cebceff1bcfcfaf225428dfcfaaec630c88720ab65bf5d3399dd1ac82ea0ecf308b3f80d9780af7742fb157692cd60515a7e2086878f082117fa80fff3d257de7d3a2e9cc8b3472ef4a5e545d90e1159523a60f38d16cece783579627124776813334bdb2a2df4171ef1fa12bf415da338ce5085c01e7a715638ef5505aebec06a0625aaa72d13839838f7d4f981673c8f05f08408e8b372f900af7227c49cfb1e1febab6c07dd42b7c26f921cf010832841205\", ... ]\n}" - }, - ...] -} -``` - - -### **/stop_daemon** - -Wysyła polecenie do demona, aby bezpiecznie się rozłączyć i wyłączyć. - -Wejście: *brak*. - -Wynik: - -* *status* - ciąg; kod generalnego błędu RPC. "OK" oznacza, że wszystko jest w porządku. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` diff --git a/_i18n/pl/resources/developer-guides/wallet-rpc.md b/_i18n/pl/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index b9dac66d..00000000 --- a/_i18n/pl/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,1217 +0,0 @@ -{% assign version = '1.1.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Wprowadzenie - -Poniżej znajduje się lista funkcji monero-wallet-rpc, ich wejścia i wyniki oraz przykłady. Oprogramowanie monero-wallet-rpc zamieniło interfejs rpc, które znajdowało się w simplewallet, a później w monero-wallet-cli. - -Wszystkie metody monero-wallet-rpc korzystają z tego samego interfejsu JSON RPC. Przykład: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Jeśli funkcja monero-wallet-rpc została zastosowana z argumentem `--rpc-login` jako `username:password`, postępuj zgodnie z przykładem poniżej: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Zauważ, że jednostki atomowe (@atomic-unit) są najmniejszą częścią 1 XMR, zgodnie z implementacją monerod. **1 XMR = 1e12 jednostek atomowych.** - -### Lista metod JSON RPC: - -* [getbalance](#getbalance) -* [getaddress](#getaddress) -* [getheight](#getheight) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [sign](#sign) -* [verify](#verify) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) - ---- - -## Metody JSON RPC: - -### **getbalance** - -Wyszukuje saldo portfela. - -Wejście: *brak*. - -Wynik: - -* *balance* - niepodpisana liczba całkowita; całkowite saldo aktualnego monero-wallet-rpc w sesji. -* *unlocked_balance* - niepodpisana liczba całkowita; odblokowane środki to środki znajdujące się wystarczająco głęboko w łańcuchu bloków, aby mogły być bezpiecznie wydane. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 140000000000, - "unlocked_balance": 50000000000 - } -} -``` - - -### **getaddress** - -Wyszukuje adres portfela. - -Wejście: *brak*. - -Wynik: - -* *address* - ciąg; 95-znakowy heksadecymalny ciąg zawierający adres monero-wallet-rpc w sesji. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQGaDsaBA" - } -} -``` - - -### **getheight** - -Wyszukuje aktualną wysokość bloku portfela. - -Wejście: *brak*. - -Wynik: - -* *height* - niepodpisana liczba całkowita; aktualna wysokość łańcucha bloków dla monero-wallet-rpc. Jeśli portfel był off-ine przez dłuższy czas, możliwe, że będzie on potrzebował zaktualizować demona. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getheight"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 994310 - } -} -``` - - -### **transfer** - -Wysyła Monero do wielu odbiorców. - -Wejście: - -* *destinations* - szereg odbiorców XMR: - * *amount* - niepodpisana liczba całkowita; kwota do wysłania każdemu z odbiorców w jednostkach atomowych. - * *address* - ciąg; adres publiczny odbiorcy. -* *fee* - niepodpisana liczba całkowita; kwota opłaty, gdy zignorowana, zostanie obliczona automatycznie. -* *mixin* - niepodpisana liczba całkowita; liczba wyjść łańcucha do zmiksowaniah (0 oznacza brak miksowania). -* *unlock_time* - niepodpisana liczba całkowita; liczba bloków, które muszą minąć zanim Monero może zostać wydane (0 oznacza brak blokady). -* *payment_id* - ciąg; (opcjonalny) losowy ciąg 32-bajtowy/64-znakowy heksadecymalny służący do identyfikacji transakcji. -* *get_tx_key* - logiczny typ danych; (opcjonalny) wyszukuje klucz transakcji po jej wysłaniu. -* *priority* - niepodpisana liczba całkowita; ustala pierwszeństwo transakcji. Akceptowanymi wartościami są 0-3 i oznaczają odpowiednio: domyślna, nieważna, normalna, ważniejsza, pierwszeństwo. -* *do_not_relay* - logiczny typ danych; (ocpjonalny) Jeśli "true" - nowo utworzona transakcja nie zostanie przekazana sieci Monero (domyślnie ustawiono jako "false"). -* *get_tx_hex* - logiczny typ danych; wyszukuje transakcje jako ciąg heksadecymalny po jej wysłaniu. - - -Wynik: - -* *fee* - całkowita wartość opłaty poniesionej za dokonaną transakcję. -* *tx_hash* - ciąg publicznie możliwego do wyszukania hasza transakcji. -* *tx_key* - ciąg klucza transakcji, jeśli "get_tx_key" jest "true"; w innym przypadku - pusty ciąg. -* *tx_blob* - transakcja jako ciąg heksadecymalny, jeśli "get_tx_hex" jest "true". - - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000,"address":"9wNgSYy2F9qPZu7KBjvsFgZLTKE2TZgEpNFbGka9gA5zPmAXS35QzzYaLKJRkYTnzgArGNX7TvSqZC87tBLwtaC5RQgJ8rm"},{"amount":200000000,"address":"9vH5D7Fv47mbpCpdcthcjU34rqiiAYRCh1tYywmhqnEk9iwCE9yppgNCXAyVHG5qJt2kExa42TuhzQfJbmbpeGLkVbg8xit"}],"mixin":4,"get_tx_key": true}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 48958481211, - "tx_hash": "985180f468637bc6d2f72ee054e1e34b8d5097988bb29a2e0cb763e4464db23c", - "tx_key": "8d62e5637f1fcc9a8904057d6bed6c697618507b193e956f77c31ce662b2ee07" - } -} -``` - - -### **transfer_split** - -Funkcja podobna do "transfer", ale potrafi podzielić płatności na więcej niż jedną transakcję, jeśli to konieczne. - -Wejście: - -* *destinations* - szereg odbiorców XMR: - * *amount* - niepodpisana liczba całkowita; kwota do wysłania każdemu z odbiorców w jednostkach atomowych. - * *address* - ciąg; adres publiczny odbiorcy. -* *fee* - niepodpisana liczba całkowita; kwota opłaty, gdy zignorowana, zostanie obliczona automatycznie. -* *mixin* - niepodpisana liczba całkowita; liczba wyjść łańcucha do zmiksowaniah (0 oznacza brak miksowania). -* *unlock_time* - niepodpisana liczba całkowita; liczba bloków, które muszą minąć zanim Monero może zostać wydane (0 oznacza brak blokady). -* *payment_id* - ciąg; (opcjonalny) losowy ciąg 32-bajtowy/64-znakowy heksadecymalny służący do identyfikacji transakcji. -* *get_tx_keys* - logiczny typ danych; (opcjonalny) wyszukuje klucz transakcji po jej wysłaniu - do zignorowania. -* *priority* - niepodpisana liczba całkowita; ustala pierwszeństwo transakcji. Akceptowanymi wartościami są 0-3 i oznaczają odpowiednio: domyślna, nieważna, normalna, ważniejsza, pierwszeństwo. -* *do_not_relay* - logiczny typ danych; (ocpjonalny) Jeśli "true" - nowo utworzona transakcja nie zostanie przekazana sieci Monero (domyślnie ustawiono jako "false"). -* *get_tx_hex* - logiczny typ danych; wyszukuje transakcje jako ciąg heksadecymalny po jej wysłaniu. -* *new_algorithm* - logiczny typ danych; jeśli "true" - używa algorytmu konstrukcji nowej transakcji, domyślnie ustalony jako "false". - -Wynik: - -* *fee_list* - szereg: liczba całkowita. Kwota opłat za każdą transakcję. -* *tx_hash_list* - szereg: ciąg. Hasze wszystkich transakcji. -* *tx_blob_list* - szereg: ciąg. Transakcja jako ciąg heksadecymalny. -* *amount_list* - szereg: liczba całkowita. Kwota przesłana w każdej transakcji. -* *tx_key_list* - szereg: ciąg. Klucze wszystkich transakcji. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":100000000,"address":"9wNgSYy2F9qPZu7KBjvsFgZLTKE2TZgEpNFbGka9gA5zPmAXS35QzzYaLKJRkYTnzgArGNX7TvSqZC87tBwtaC5RQgJ8rm"},{"amount":200000000,"address":"9vH5D7Fv47mbpCpdcthcjU34rqiiAYRCh1tYywmhqnEk9iwCE9yppgNCXAyVHG5qJt2kExa42TuhzQfJbmbpeGLkVbg8xit"},{"amount":200000000,"address":"9vC5Q25cR1d3WzKX6dpTaLJaqZyDrtTnfadTmVuB1Wue2tyFGxUhiE4RGa74pEDJv7gSySzcd1Ao6G1nzSaqp78vLfP6MPj"},{"amount":200000000,"address":"A2MSrn49ziBPJBh8ZNEhhbfyLMou6mao4C1F5TLGUatmUnCxZArDYkcbAnVkVEopWVeak2rKDrmc8JpoS7n5dvfN9YDPBTG"},{"amount":200000000,"address":"9tEDyVQ8zgRQbDYiykTdpw5kZ6qWQWcKfExEj9eQshjpGb3sdr3UyWE2AHWzUGzJjaH9HN1DdGBdyQQ4AqGMc7rr5xYwZWW"}],"mixin":4,"get_tx_key": true, "new_algorithm": true}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee_list": [97916962422], - "tx_hash_list": ["c5c389846e701c27aaf1f7ab8b9dc457b471fcea5bc9710e8020d51275afbc54"] - } -} -``` - - -### **sweep_dust** - -Przesyła wszystkie drobne wyniki z powrotem do portfela, aby ułatwić ich wydawanie oraz miksowanie. - -Wejście: *brak*. - -Wynik: - -* *tx_hash_list* - lista: ciąg - -Przykład (w tym przypadku funkcja `sweep_dust` pokazuje błąd ze względu na niewystarczające środki): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust"}' -H 'Content-Type: application/json' - -{ - "error": { - "code": -4, - "message": "not enough money" - }, - "id": "0", - "jsonrpc": "2.0" -} -``` - -### **sweep_all** - -Przesyła wszystkie odblokowane środki na dany adres. - -Wejście: - -* *address* - ciąg; adres publiczny odbiorcy. -* *priority* - niepodpisana liczba całkowita; (opcjonalne) -* *mixin* - niepodpisana liczba całkowita; liczba wyjść z łańcucha bloków do zmiksowania (0 oznacza brak miksowania). -* *unlock_time* - niepodpisana liczba całkowita; liczba bloków, które muszą upłynąć, zanim Monero może zostać wydane (0 oznacza brak blokady). -* *payment_id* - ciąg; (opcjonalne) Losowy 32-bajtowy/64-znakowy ciąg heksadecymalny służący do identyfikacji transakcji. -* *get_tx_keys* - logiczny typ danych; (opcjonalne) wyszukuje klucze transakcji po jej dokonaniu. -* *below_amount* - niepodpisana liczba całkowita; (opcjonalne) -* *do_not_relay* - logiczny typ danych; (opcjonalne) -* *get_tx_hex* - logiczny typ danych; (opcjonalne) pokazuje transakcje jako zakodowany heksadecymalnie ciąg. - -Wynik: - -* *tx_hash_list* - szereg ciągów; -* *tx_key_list* - szereg ciągów; -* *tx_blob_list* - szereg ciągów; - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"9sS8eRU2b5ZbN2FPSrpkiab1bjbHE5XtL6Ti6We3Fhw5aQPudRfVVypjgzKDNkxtvTQSPs122NKggb2mqcqkKSeMNVu59S","mixin":2,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["53a3648797d5524dd037d4105e067fa61468faecab41927fc43adbb26c202d22"], - "tx_key_list": ["e83b3b78235e36cd7e4d9695efd81a3b3e64c7d1f1ebd61892f0a7add6a50301"] - } -} -``` - -### **store** - -Zapisuje łańcuch bloków - -Wejście: *brak*. - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Pobiera listę płatności przychodzących za pomocą numeru identyfikacyjnego płatności. - -Wejście: - -* *payment_id* - ciąg - -Wynik: - -* *payments* - lista: - * *payment_id* - ciąg - * *tx_hash* - ciąg - * *amount* - niepodpisana liczba całkowita - * *block_height* - niepodpisana liczba całkowita - * *unlock_time* - niepodpisana liczba całkowita - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "amount": 10350000000000, - "block_height": 994327, - "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030", - "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Wyszukuje listę płatności przychodzących za pomocą numeru identyfikacyjnego płatności lub listy numerów identyfikacyjnych na danej wysokości. Metoda ta jest zalecana, w odróżnieniu od funkcji `get_payments`, ponieważ posiada tę samą funkcjonalność, ale jest bardziej rozszerzalna. Obie funkcje służą do wyszukiwania transakcji za pomocą pojedynczego numeru identyfikacyjnego. - -Wejście: - -* *payment_ids* - szereg ciągu - * *min_block_height* - niepodpisana liczba całkowita; wysokość bloku, od której rozpoczęto wyszukiwanie płatności. - -Wynik: - -* *payments* - lista: - * *payment_id* - ciągu - * *tx_hash* - ciągu - * *amount* - niepodpisanej liczby całkowitej - * *block_height* - niepodpisanej liczby całkowitej - * *unlock_time* - niepodpisanej liczby całkowitej - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030"],"min_block_height":990000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "amount": 10350000000000, - "block_height": 994327, - "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030", - "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", - "unlock_time": 0 - }] - } -} -``` - - -### **get_transfers** - -Wyszukuje listę transferów. - -Wejście: - -* *in* - logiczny typ danych; -* *out* - logiczny typ danych; -* *pending* - logiczny typ danych; -* *failed* - logiczny typ danych; -* *pool* - logiczny typ danych; -* *filter_by_height* - logiczny typ danych; -* *min_height* - niepodpisana liczba całkowita; -* *max_height* - niepodpisana liczba całkowita; - -Wynik: - -* *in* szereg transferów: - * *txid* - ciąg; - * *payment_id* - ciąg; - * *height* - niepodpisana liczba całkowita; - * *timestamp* - niepodpisana liczba całkowita; - * *amount* - niepodpisana liczba całkowita; - * *fee* - niepodpisana liczba całkowita; - * *note* - ciąg; - * *destinations* - std::list; - * *type* - ciąg; -* *out* szereg transferów -* *pending* szereg transferów -* *failed* szereg transferów -* *pool* szereg transferów - - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"pool":true}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "pool": [{ - "amount": 500000000000, - "fee": 0, - "height": 0, - "note": "", - "payment_id": "758d9b225fda7b7f", - "timestamp": 1488312467, - "txid": "da7301d5423efa09fabacb720002e978d114ff2db6a1546f8b820644a1b96208", - "type": "pool" - }] - } -} -``` - -### **get_transfer_by_txid** - -Wyszukuje informacje na temat transferów z/na dany adres. - -Wejście: - -* *txid* - ciąg - -Wynik: - -* *transfer* - obiekt JSON zawierający informacje o płatności: - * *amount* - niepodpisana liczba całkowita - * *fee* - niepodpisana liczba całkowita - * *height* - niepodpisana liczba całkowita - * *note* - ciąg - * *payment_id* - ciąg - * *timestamp* - niepodpisana liczba całkowita - * *txid* - ciąg - * *type* - ciąg - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"f2d33ba969a09941c6671e6dfe7e9456e5f686eca72c1a94a3e63ac6d7f27baf"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "amount": 10000000000000, - "fee": 0, - "height": 1316388, - "note": "", - "payment_id": "0000000000000000", - "timestamp": 1495539310, - "txid": "f2d33ba969a09941c6671e6dfe7e9456e5f686eca72c1a94a3e63ac6d7f27baf", - "type": "in" - } - } -} -``` - - -### **incoming_transfers** - -Wyszukuje listę transferów przychodzących do portfela. - -Wejście: - -* *transfer_type* - ciąg; "all": wszystkie transfery, "available": jedynie transfery jeszcze nie wydane LUB "unavailable": jedynie transfery już wydane. - -Wynik: - -* *transfers* - lista: - * *amount* - niepodpisana liczba całkowita - * *spent* - logiczny typ danych - * *global_index* - niepodpisana liczba całkowita; zazwyczaj do użytku wewnętrznego, może zostać zignorowana przez większość użytkowników. - * *tx_hash* - ciąg; wiele transferów przychodzących może posiadać ten sam hasz, jeśli zawarte były w tej samej transakcji. - * *tx_size* - niepodpisana liczba całkowita - -Przykład (wszystkie rodzaje transakcji): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 10000000000000, - "global_index": 711506, - "spent": false, - "tx_hash": "<c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1>", - "tx_size": 5870 - },{ - "amount": 300000000000, - "global_index": 794232, - "spent": false, - "tx_hash": "<c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1>", - "tx_size": 5870 - },{ - "amount": 50000000000, - "global_index": 213659, - "spent": false, - "tx_hash": "<c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1>", - "tx_size": 5870 - }] - } -} -``` - -Przykład (wszystkie transakcje "available"): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 10000000000000, - "global_index": 711506, - "spent": false, - "tx_hash": "<c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1>", - "tx_size": 5870 - },{ - "amount": 300000000000, - "global_index": 794232, - "spent": false, - "tx_hash": "<c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1>", - "tx_size": 5870 - },{ - "amount": 50000000000, - "global_index": 213659, - "spent": false, - "tx_hash": "<c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1>", - "tx_size": 5870 - }] - } -} -``` - -Przykład (wszystkie transakcje "unavailable". Zauważ, że w tym przypadku znaleziono 0 transakcji "unavailable"): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **query_key** - -Wyszukuje prywatny klucz wydawania lub widoczności. - -Wejście: - -* *key_type* - ciąg; decyduje o rodzaju klucza do wyszukania: "mnemonic" - kod mnemoniczny (starsze portfele nie posiadają go) LUB "view_key" - klucz widoczności. - -Wynik: - -* *key* - ciąg; klucz widoczności będzie zakodowany heksadecymalnie, a kod mnemoniczny będzie ciągiem słów. - -Przykład (dla klucza widoczności): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "7e341d..." - } -} -``` - -Przykład (dla kodu mnemonicznego): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "adapt adapt nostril ..." - } -} -``` - - -### **make_integrated_address** - -Tworzy adres zintegrowany złożony z adresu portfela i numeru identyfikacyjnego płatności. - -Wejście: - -* *payment_id* - ciąg; zakodowany heksadecymalnie; może być pusty, co spowoduje wygenerowanie losowego numeru identyfikacyjnego płatności. - -Wynik: - -* *integrated_address* - ciąg - -Przykład (numer identyfikacyjny płatności jest pusty, użycie losowego numeru): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"payment_id":""}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "4BpEv3WrufwXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQQ8H2RRJveAtUeiFs6J" - } -} -``` - - -### **split_integrated_address** - -Wyszukuje adres standardowy i numer identyfikacyjny płatności składające się na adres zintegrowany. - -Wejście: - -* *integrated_address* - ciąg - -Wynik: - -* *standard_address* - ciąg -* *payment* - ciąg; zakodowany heksadecymalnie - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "4BpEv3WrufwXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQQ8H2RRJveAtUeiFs6J"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payment_id": "<420fa29b2d9a49f5>", - "standard_address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQGaDsaBA" - } -} -``` - - -### **stop_wallet** - -Zatrzymuje pracę portfela, zapisując jego aktualny stan. - -Wejście: *brak*. - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **make_uri** - -Tworzy URI płatności przy użyciu oficjalnych specyfikacji URI. - -Wejście: - -* *address* - ciąg; adres portfela -* *amount* (opcjonalne) - niepodpisana liczba całkowita; kwota do otrzymania w jednostkach **atomowych** -* *payment_id* (opcjonalne) - ciąg; numer identyfikacyjny płatności jako 16- lub 64-znakowy ciąg heksadecymalny -* *recipient_name* (opcjonalne) - ciąg; nazwa odbiorcy płatności -* *tx_description* (opcjonalne) - ciąg; tytuł transakcji - -Wynik: - -* *uri* - ciąg zawierający wszystkie informacje na temat wejścia płatności jako odpowiednio sformatowany URI - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A","amount":10,"payment_id":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","tx_description":"Testing out the make_uri function.","recipient_name":"Monero Project donation address"}}' -H 'Content-Type: application/json' - -{ - "id": 0, - "jsonrpc": "2.0", - "result": { - "uri": "monero:44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A?tx_payment_id=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef&tx_amount=0.000000000010&recipient_name=Monero%20Project%20donation%20address&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Analizuje URI płatności w celu uzyskania informacji na jej temat. - -Wejście: - -* *uri* - ciąg zawierający wszystkie informacje na temat wejścia płatności jako odpowiednio sformatowany URI - -Wynik: - -* *uri* - obiekt JSON zawierający informacje na temat płatności: - * *address* - ciąg; adres portfela - * *amount* - kwota do otrzymania w jednostkach **monetarnych** (0 jeśli brak informacji) - * *payment_id* - numer identyfikacyjny płatności jako 16- lub 64-znakowy ciąg heksadecymalny (zostawić puste, jeśli brak informacji) - * *recipient_name* - ciąg; nazwa odbiorcy płatności (zostawić puste, jeśli brak informacji) - * *tx_description* - ciąg; tytuł płatności (zostawić puste, jeśli brak informacji) - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A?tx_payment_id=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef&tx_amount=0.000000000010&recipient_name=Monero%20Project%20donation%20address&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' - -{ - "id": 0, - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A", - "amount": 10, - "payment_id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", - "recipient_name": "Monero Project donation address", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **rescan_blockchain** - -Skanuje łańcuch bloków od początku. - -Wejście: *brak*. - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Ustanawia dowolny ciąg adnotacji transakcji. - -Wejście: - -* *txids* - szereg ciągów; numery identyfikacyjne transakcji -* *notes* - szereg ciągów; adnotacje do transakcji - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["6a1a100c079c236e2cbf36f7760e8ef1a9e8357c434aa790a8c78de653ec4cf2"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Wyszukuje ciągi adnotacji transakcji. - -Wejście: - -* *txids* - szereg ciągów; numery identyfikacyjne transakcji - -Wynik: - -* *notes* - szereg ciągów; adnotacje do transakcji - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["6a1a100c079c236e2cbf36f7760e8ef1a9e8357c434aa790a8c78de653ec4cf2"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **sign** - -Podpisuje dany ciąg. - -Wejście: - -* *data* - ciąg; - -Wynik: - -* *signature* - ciąg; - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV1Xp61ZkGguxSCHpkYEVw9eaWfRfSoAf36PCsSCApx4DUrKWHEqM9CdNwjeuhJii6LHDVDFxvTPijFsj3L8NDQp1TV" - } -} -``` - - -### **verify** - -Weryfikuje podpis ciągu. - -Wejście: - -* *data* - ciąg; -* *address* - ciąg; -* *signature* - ciąg; - -Wynik: - -* *good* - logiczny typ danych; - -Przykład: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"9sS8eRU2b5ZbN2FPSrpkiab1bjbHE5XtL6Ti6We3Fhw5aQPudRfVVypjgzKDNkxtvTQZSPs122NKggb2mqcqkKSeMNVu59S","signature":"SigV1Xp61ZkGguxSCHpkYEVw9eaWfRfSoAf36PCsSCApx4DUrKWHEqM9CdNwjeuhJii6LHDVDFxvTPijFsj3L8NDQp1TV"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_key_images** - -Eksportuje podpisany zestaw obrazów klucza. - -Wejście: *brak*. - -Wynik: - -* *signed_key_images* - szereg podpisanych obrazów klucza: - * *key_image* - ciąg; - * *signature* - ciąg; - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "62b83df78baad99e23b5ad3f667bc6f8d388a13d9e84c7bb6c223a556dfd34af", - "signature": "b87b7e989aa85aa3a2a7cd8adcb3a848d3512ff718b168e15217ff3e5da29c0183c0328b97cc052fcb5ee3548aa5e41e530ba9d854199ea19d7ddaf6a54a4c0a" - }] - } -} -``` - - -### **import_key_images** - -Importuje listy podpisanych obrazów klucza i weryfikuje, czy zostały wydane. - -Wejście: - -* *signed_key_images* - szereg podpisanych obrazów klucza: - * *key_image* - ciąg; - * *signature* - ciąg; - -Wynik: - -* *height* - niepodpisana liczba całkowita; -* *spent* - niepodpisana liczba całkowita; -* *unspent* - niepodpisana liczba całkowita; - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"63b83df78cafd99e23b5ad3f667bc6f8d38813d9e84c7bb6c223a556dfd34af","signature":"b87b7e989aa86aa2a7a7cd8adcb3a848d3512ff718b168e15217ff3e5da29c0183c0328b97cc052fcb5ee3548aa5e41e530ba9d854199ea19d7ddaf6a54a4c0a"},{"key_image":"44ec12fbc56c533a30b09de8ae26febd515528c4957dfe875430377a7e212b4e","signature":"91105f15be0b25bc2a94bd78a7e261608974d6d888080b9f1815655b98af190340325ea1a0840a5951dacf913d4de1b2bd33ea59c1cb7bce1b6648afa7133d03"}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 986050, - "spent": 10000100000000, - "unspent": 4979852760000 - } -} -``` - - -### **get_address_book** - -Wyszukuje wpisy do książki adresowej. - -Wejście: - -* *entries* - szereg niepodpisanych liczb całkowitych; znaczniki żądanych wpisów do książki adresowej - -Wynik: - -* *entries* - szereg wpisów: - * *address* - ciąg; - * *description* - ciąg; - * *index* - niepodpisana liczba całkowita; - * *payment_id* - ciąg; - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[1,2]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "A135xq3GVMdU5qtAm4hN7zjPgz8bRaiSUQmtuDdjZ6CgXayvQruJy3WPe95qj873JhK4YdTQjoR39Leg6esznQk8PckhjRN", - "description": "", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "A135xq3GVMdU5qtAm4hN7zjPgz8bRaiSUQmtuDdjZ6CgXayvQruJy3WPe95qj873JhK4YdTQjoR39Leg6esznQk8PckhjRN", - "description": "", - "index": 2, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Dodaje wpis do książki adresowej. - -Wejście: - -* *address* - ciąg; -* *payment_id* - (opcjonalne) ciąg, domyślnie jako "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (opcjonalne) ciąg, domyślnie jako ""; - -Wynik: - -* *index* - niepodpisana liczba całkowita; znacznik wpisu do książki adresowej. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A","description":"Donation address for the Monero project"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 2 - } -} -``` - - -### **delete_address_book** - -Usuwa wpis do książki adresowej. - -Wejście: - -* *index* - niepodpisana liczba całkowita; znacznik wpisu do książki adresowej. - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":0}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_spent** - -Skanuje łańcuch bloków w poszukiwaniu wydanych wyjść. - -Wejście: *brak*. - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Rozpoczyna wydobywanie w demonie Monero. - -Wejście: - -* *threads_count* - niepodpisana liczba całkowita; liczba pasm stworzonych do wydobycia -* *do_background_mining* - logiczny typ danych; -* *ignore_battery* - logiczny typ danych; - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":true}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Przerywa wydobywanie w demonie Monero. - -Wejście: *brak*. - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Wyszukuje listę dostępnych wersji językowych portfela. - -Wejście: *brak*. - -Wynik: - -* *languages* - szereg ciągów; lista dostępnych języków - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto"] - } -} -``` - - -### **create_wallet** - -Tworzy nowy portfel.Create a new wallet. Argument "--wallet-dir" musi zostać ustawiony przy uruchamianiu monero-wallet-rpc, aby funkcja zadziałała. - -Wejście: - -* *filename* - ciąg; -* *password* - ciąg; -* *language* - ciąg; język twojego portfela - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Otwiera portfel. Argument "--wallet-dir" musi zostać ustawiony przy uruchamianiu monero-wallet-rpc, aby funkcja zadziałała. - -Wejście: - -* *filename* - ciąg; -* *password* - ciąg; - -Wynik: *brak*. - -Przykład: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` diff --git a/_i18n/pt-br/resources/developer-guides/daemon-rpc.md b/_i18n/pt-br/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/pt-br/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/pt-br/resources/developer-guides/wallet-rpc.md b/_i18n/pt-br/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/pt-br/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/ru/resources/developer-guides/daemon-rpc.md b/_i18n/ru/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/ru/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/ru/resources/developer-guides/wallet-rpc.md b/_i18n/ru/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/ru/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/tr/resources/developer-guides/daemon-rpc.md b/_i18n/tr/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/tr/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/tr/resources/developer-guides/wallet-rpc.md b/_i18n/tr/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/tr/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/zh-cn/resources/developer-guides/daemon-rpc.md b/_i18n/zh-cn/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index 892fced2..00000000 --- a/_i18n/zh-cn/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2378 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase amount and the fees amount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per byte. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units -* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/zh-cn/resources/developer-guides/wallet-rpc.md b/_i18n/zh-cn/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index f08061f6..00000000 --- a/_i18n/zh-cn/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="false" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/_i18n/zh-tw/resources/developer-guides/daemon-rpc.md b/_i18n/zh-tw/resources/developer-guides/daemon-rpc.md deleted file mode 100644 index d143bf1f..00000000 --- a/_i18n/zh-tw/resources/developer-guides/daemon-rpc.md +++ /dev/null @@ -1,2377 +0,0 @@ -{% assign version = '2.3.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Introduction - -This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. - -Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -Note2: Guide updated as of network height of 1,562,465. - -### [JSON RPC Methods](#json-rpc-methods): - -* [get_block_count](#get_block_count) -* [on_get_block_hash](#on_get_block_hash) -* [get_block_template](#get_block_template) -* [submit_block](#submit_block) -* [get_last_block_header](#get_last_block_header) -* [get_block_header_by_hash](#get_block_header_by_hash) -* [get_block_header_by_height](#get_block_header_by_height) -* [get_block_headers_range](#get_block_headers_range) -* [get_block](#get_block) -* [get_connections](#get_connections) -* [get_info](#get_info) -* [hard_fork_info](#hard_fork_info) -* [set_bans](#set_bans) -* [get_bans](#get_bans) -* [flush_txpool](#flush_txpool) -* [get_output_histogram](#get_output_histogram) -* [get_version](#get_version) -* [get_coinbase_tx_sum](#get_coinbase_tx_sum) -* [get_fee_estimate](#get_fee_estimate) -* [get_alternate_chains](#get_alternate_chains) -* [relay_tx](#relay_tx) -* [sync_info](#sync_info) -* [get_txpool_backlog](#get_txpool_backlog) -* [get_output_distribution](#get_output_distribution) - -### [Other RPC Methods](#other-daemon-rpc-calls): - -* [/get_height](#get_height) -* [/get_blocks.bin](#get_blocksbin) -* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) -* [/get_hashes.bin](#get_hashesbin) -* [/get_o_indexes.bin](#get_o_indexesbin) -* [/get_outs.bin](#get_outsbin) -* [/get_transactions](#get_transactions) -* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) -* [/is_key_image_spent](#is_key_image_spent) -* [/send_raw_transaction](#send_raw_transaction) -* [/start_mining](#start_mining) -* [/stop_mining](#stop_mining) -* [/mining_status](#mining_status) -* [/save_bc](#save_bc) -* [/get_peer_list](#get_peer_list) -* [/set_log_hash_rate](#set_log_hash_rate) -* [/set_log_level](#set_log_level) -* [/set_log_categories](#set_log_categories) -* [/get_transaction_pool](#get_transaction_pool) -* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) -* [/get_transaction_pool_stats](#get_transaction_pool_stats) -* [/stop_daemon](#stop_daemon) -* [/get_info (not JSON)](#get_info-not-json) -* [/get_limit](#get_limit) -* [/set_limit](#set_limit) -* [/out_peers](#out_peers) -* [/in_peers](#in_peers) -* [/start_save_graph](#start_save_graph) -* [/stop_save_graph](#stop_save_graph) -* [/get_outs](#get_outs) -* [/update](#update) - - ---- - -## JSON RPC Methods - -The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: - -``` -IP=127.0.0.1 -PORT=18081 -METHOD='get_block_header_by_height' -ALIAS='getblockheaderbyheight' -PARAMS='{"height":912345}' -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ - -H 'Content-Type: application/json' -``` - -Some methods include parameters, while others do not. Examples of each JSON RPC method follow. - -### **get_block_count** - -Look up how many blocks are in the longest chain known to the node. - -Alias: *getblockcount*. - -Inputs: *None*. - -Outputs: - -* *count* - unsigned int; Number of blocks in longest chain seen by the node. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "count": 993163, - "status": "OK" - } -} -``` - - -### **on_get_block_hash** - -Look up a block's hash by its height. - -Alias: *on_getblockhash*. - -Inputs: - -* block height (int array of length 1) - -Outputs: - -* block hash (string) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" -} -``` - - -### **get_block_template** - -Get a block template on which mining a new block. - -Alias: *getblocktemplate*. - -Inputs: - -* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. -* *reserve_size* - unsigned int; Reserve size. - -Outputs: - -* *blocktemplate_blob* - string; Blob on which to try to mine a new block. -* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. -* *difficulty* - unsigned int; Difficulty of next block. -* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. -* *height* - unsigned int; Height on which to mine. -* *prev_hash* - string; Hash of the most recent block on which to mine the next block. -* *reserved_offset* - unsigned int; Reserved offset. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", - "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", - "difficulty": 61043624293, - "expected_reward": 4771949057248, - "height": 1561970, - "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", - "reserved_offset": 129, - "status": "OK", - "untrusted": false - } -} -``` - - -### **submit_block** - -Submit a mined block to the network. - -Alias: *submitblock*. - -Inputs: - -* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. - -Outputs: - -* *status* - string; Block submit status. - -In this example, a block blob which has not been mined is submitted: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "error": { - "code": -7, - "message": "Block not accepted" - } -} -``` - - -### **get_last_block_header** - -Block header information for the most recent block is easily retrieved with this method. No inputs are needed. - -Alias: *getlastblockheader*. - -Inputs: *None*. - -Outputs: - -* *block_header* - A structure containing block header information. - * *block_size* - unsigned int; The block size in bytes. - * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. - * *difficulty* - unsigned int; The strength of the Monero network based on mining power. - * *hash* - string; The hash of this block. - * *height* - unsigned int; The number of blocks preceding this block on the blockchain. - * *major_version* - unsigned int; The major version of the monero protocol at this block height. - * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. - * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. - * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. - * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. - * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. - * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. - * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, the most recent block (1562023 at the time) is returned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 62774, - "depth": 0, - "difficulty": 60097900840, - "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", - "height": 1562023, - "major_version": 7, - "minor_version": 7, - "nonce": 3789681204, - "num_txes": 5, - "orphan_status": false, - "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", - "reward": 4724029079703, - "timestamp": 1525029411 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_hash** - -Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyhash*. - -Inputs: - -* *hash* - string; The block's sha256 hash. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its hash: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649717, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block_header_by_height** - -Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. - -Alias: *getblockheaderbyheight*. - -Inputs: - -* *height* - unsigned int; The block's height. - -Outputs: - -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "block_header": { - "block_size": 210, - "depth": 649721, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "status": "OK", - "untrusted": false - } -} -``` - -### **get_block_headers_range** - -Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. - -Alias: *getblockheadersrange*. - -Inputs: - -* *start_height* - unsigned int; The starting block's height. -* *end_height* - unsigned int; The ending block's height. - -Outputs: - -* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "headers": [{ - "block_size": 301413, - "depth": 16085, - "difficulty": 134636057921, - "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "height": 1545999, - "major_version": 6, - "minor_version": 6, - "nonce": 3246403956, - "num_txes": 20, - "orphan_status": false, - "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", - "reward": 5025593029981, - "timestamp": 1523002893 - },{ - "block_size": 13322, - "depth": 16084, - "difficulty": 134716086238, - "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", - "height": 1546000, - "major_version": 7, - "minor_version": 7, - "nonce": 3737164176, - "num_txes": 1, - "orphan_status": false, - "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", - "reward": 4851952181070, - "timestamp": 1523002931 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_block** - -Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. - -Alias: *getblock*. - -Inputs (pick one of the following): - -* *height* - unsigned int; The block's height. -* *hash* - string; The block's hash. - -Outputs: - -* *blob* - string; Hexadecimal blob of block information. -* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). -* *json* - json string; JSON formatted block details: - * *major_version* - Same as in block header. - * *minor_version* - Same as in block header. - * *timestamp* - Same as in block header. - * *prev_id* - Same as `prev_hash` in block header. - * *nonce* - Same as in block header. - * *miner_tx* - Miner transaction information - * *version* - Transaction version number. - * *unlock_time* - The block height when the coinbase transaction becomes spendable. - * *vin* - List of transaction inputs: - * *gen* - Miner txs are coinbase txs, or "gen". - * *height* - This block height, a.k.a. when the coinbase is generated. - * *vout* - List of transaction outputs. Each output contains: - * *amount* - The amount of the output, in @atomic-units. - * *target* - - * *key* - - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. - * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. - * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -**Look up by height:** - -In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", - "block_header": { - "block_size": 210, - "depth": 649772, - "difficulty": 815625611, - "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", - "height": 912345, - "major_version": 1, - "minor_version": 2, - "nonce": 1646, - "num_txes": 0, - "orphan_status": false, - "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", - "reward": 7388968946286, - "timestamp": 1452793716 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", - "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", - "status": "OK", - "untrusted": false - } -} -``` - -**Look up by hash:** - -In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", - "block_header": { - "block_size": 3981, - "depth": 569068, - "difficulty": 964985344, - "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", - "height": 993056, - "major_version": 1, - "minor_version": 2, - "nonce": 2036, - "num_txes": 3, - "orphan_status": false, - "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", - "reward": 6932043647005, - "timestamp": 1457720227 - }, - "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", - "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", - "status": "OK", - "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], - "untrusted": false - } -} -``` - - -### **get_connections** - -Retrieve information about incoming and outgoing connections to your node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *connections* - List of all connections and their info: - * *address* - string; The peer's address, actually IPv4 & port - * *avg_download* - unsigned int; Average bytes of data downloaded by node. - * *avg_upload* - unsigned int; Average bytes of data uploaded by node. - * *connection_id* - string; The connection ID - * *current_download* - unsigned int; Current bytes downloaded by node. - * *current_upload* - unsigned int; Current bytes uploaded by node. - * *height*- unsigned int; The peer height - * *host* - string; The peer host - * *incoming* - boolean; Is the node getting information from your node? - * *ip* - string; The node's IP address. - * *live_time* - unsigned int - * *local_ip* - boolean - * *localhost* - boolean - * *peer_id* - string; The node's ID on the network. - * *port* - string; The port that the node is using to connect to the network. - * *recv_count* - unsigned int - * *recv_idle_time* - unsigned int - * *send_count* - unsigned int - * *send_idle_time* - unsigned int - * *state* - string - * *support_flags* - unsigned int - -Following is an example of `get_connections` and it's return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "connections": [{ - "address": "173.90.69.136:62950", - "avg_download": 0, - "avg_upload": 2, - "connection_id": "083c301a3030329a487adb12ad981d2c", - "current_download": 0, - "current_upload": 2, - "height": 1562127, - "host": "173.90.69.136", - "incoming": true, - "ip": "173.90.69.136", - "live_time": 8, - "local_ip": false, - "localhost": false, - "peer_id": "c959fbfbed9e44fb", - "port": "62950", - "recv_count": 259, - "recv_idle_time": 8, - "send_count": 24342, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 0 - },{ - ... - }], - "status": "OK" - } -} -``` - - -### **get_info** - -Retrieve general information about the state of your node and the network. - -Alias: - -* */get_info* -* */getinfo* - -See other RPC Methods [/get_info (not JSON)](#get_info-not-json) - -Inputs: *None*. - -Outputs: - -* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. -* *block_size_limit* - unsigned int; Maximum allowed block size -* *block_size_median* - unsigned int; Median block size of latest 100 blocks -* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). -* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. -* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) -* *free_space* - unsigned int; Available disk space on the node. -* *grey_peerlist_size* - unsigned int; Grey Peerlist Size -* *height* - unsigned int; Current length of longest chain known to daemon. -* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. -* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. -* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). -* *offline* - boolean; States if the node is offline (`true`) or online (`false`). -* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. -* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). -* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). -* *start_time* - unsigned int; Start time of the daemon, as UNIX time. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target* - unsigned int; Current target for next proof of work. -* *target_height* - unsigned int; The height of the next block in the chain. -* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). -* *top_block_hash* - string; Hash of the highest block in the chain. -* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. -* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. -* *white_peerlist_size* - unsigned int; White Peerlist Size - -Following is an example `get_info` call and its return: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "alt_blocks_count": 6, - "block_size_limit": 600000, - "block_size_median": 129017, - "bootstrap_daemon_address": "", - "cumulative_difficulty": 14121125493385685, - "difficulty": 60580751777, - "free_space": 138758750208, - "grey_peerlist_size": 4998, - "height": 1562168, - "height_without_bootstrap": 1562168, - "incoming_connections_count": 2, - "mainnet": true, - "offline": false, - "outgoing_connections_count": 8, - "rpc_connections_count": 2, - "stagenet": false, - "start_time": 1524751757, - "status": "OK", - "target": 120, - "target_height": 1562063, - "testnet": false, - "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", - "tx_count": 2759894, - "tx_pool_size": 755, - "untrusted": false, - "was_bootstrap_ever_used": false, - "white_peerlist_size": 1000 - } -} -``` - - -### **hard_fork_info** - -Look up information regarding hard fork voting and readiness. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. -* *enabled* - boolean; Tells if hard fork is enforced. -* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). -* *status* - string; General RPC error code. "OK" means everything looks good. -* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. -* *version* - unsigned int; The major block version for the fork. -* *votes* - unsigned int; Number of votes towards hard fork. -* *voting* - unsigned int; Hard fork voting status. -* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "earliest_height": 1009827, - "enabled": false, - "state": 2, - "status": "OK", - "threshold": 0, - "version": 1, - "votes": 7277, - "voting": 2, - "window": 10080 - } -} -``` - - -### **set_bans** - -Ban another node by IP. - -Alias: *None*. - -Inputs: - -* *bans* - A list of nodes to ban: - * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). - * *ip* - unsigned int; IP address to ban, in Int format. - * *ban* - boolean; Set `true` to ban. - * *seconds* - unsigned int; Number of seconds to ban node. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Examples: - -**banning by host** - -In the following example, host is banned with its IP address string-formatted as A.B.C.D: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -**banning by ip** - -In the following example, integer-formatted IP is banned: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **get_bans** - -Get list of banned IPs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *bans* - List of banned nodes: - * *host* - string; Banned host (IP in A.B.C.D form). - * *ip* - unsigned int; Banned IP address, in Int format. - * *seconds* - unsigned int; Local Unix time that IP is banned until. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "bans": [{ - "host": "102.168.1.51", - "ip": 855746662, - "seconds": 22 - },{ - "host": "192.168.1.50", - "ip": 838969536, - "seconds": 28 - }], - "status": "OK" - } -} -``` - - -### **flush_txpool** - -Flush tx ids from transaction pool - -Alias: *None*. - -Inputs: - -* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - -### **get_output_histogram** - -Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. -RingCT outputs counts as 0 amount. - -Inputs: - -* *amounts* - list of unsigned int -* *min_count* - unsigned int -* *max_count* - unsigned int -* *unlocked* - boolean -* *recent_cutoff* - unsigned int - -Outputs: - -* *histogram* - list of histogram entries, in the following structure: - * *amount* - unsigned int; Output amount in @atomic-units - * *total_instances* - unsigned int; - * *unlocked_instances* - unsigned int; - * *recent_instances* - unsigned int; -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "histogram": [{ - "amount": 20000000000, - "recent_instances": 0, - "total_instances": 381458, - "unlocked_instances": 0 - }], - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_coinbase_tx_sum** - -Get the coinbase ammount and the fees ammount for n last blocks starting at particular height - -Alias: *None*. - -Inputs: - -* *height* - unsigned int; Block height from which getting the amounts -* *count* - unsigned int; number of blocks to include in the sum - -Outputs: - -* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units -* *fee_amount* - unsigned int; amount of fees in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "emission_amount": 9387854817320, - "fee_amount": 83981380000, - "status": "OK" - } -} -``` - - -### **get_version** - -Give the node current version - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). -* *version* - unsigned int; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK", - "untrusted": false, - "version": 65555 - } -} -``` - - -### **get_fee_estimate** - -Gives an estimation on fees per kB. - -Alias: *None*. - -Inputs: - -* *grace_blocks* - unsigned int; Optional - -Outputs: - -* *fee* - unsigned int; Amount of fees estimated per kB in @atomic-units -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "fee": 187610000, - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_alternate_chains** - -Display alternative chains seen by the node. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *chains* - array of chains, the following structure: - * *block_hash* - string; the block hash of the first diverging block of this alternative chain. - * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. - * *height* - unsigned int; the block height of the first diverging block of this alternative chain. - * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "chains": [{ - "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", - "difficulty": 14114729638300280, - "height": 1562062, - "length": 2 - }], - "status": "OK" - } -} -``` - - -### **relay_tx** - -Relay a list of transaction IDs. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; list of transaction IDs to relay - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":[9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613]}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "status": "OK" - } -} -``` - - -### **sync_info** - -Get synchronisation informations - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; -* *peers* - array of peer structure, defined as follows: - * *info* - structure of connection info, as defined in [get_connections](#get_connections) -* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): - * *connection_id* - string; Id of connection - * *nblocks* - unsigned int; number of blocks in that span - * *rate* - unsigned int; connection rate - * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from - * *size* - unsigned int; total number of bytes in that span's blocks (including txes) - * *speed* - unsigned int; connection speed - * *start_block_height* - unsigned int; block height of the first block in that span -* *status* - string; General RPC error code. "OK" means everything looks good. -* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 1563543, - "peers": [{ - "info": { - "address": "70.109.53.128:60064", - "avg_download": 0, - "avg_upload": 5, - "connection_id": "204067223b9b3415c265dd25ad29ee48", - "current_download": 0, - "current_upload": 1, - "height": 1559975, - "host": "70.109.53.128", - "incoming": true, - "ip": "70.109.53.128", - "live_time": 38, - "local_ip": false, - "localhost": false, - "peer_id": "96b8545dbc7a8866", - "port": "60064", - "recv_count": 1580, - "recv_idle_time": 28, - "send_count": 203603, - "send_idle_time": 8, - "state": "state_normal", - "support_flags": 1 - } - },{ - "info": { - ... - } - },{ - ... - },{ - ... - },{ - ... - }], - "status": "OK", - "target_height": 1564067 - } -} -``` - - -### **get_txpool_backlog** - -Get all transaction pool backlog - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *backlog*: array of structures *tx_backlog_entry* (in binary form): - * *blob_size* - unsigned int (in binary form) - * *fee* - unsigned int (in binary form) - * *time_in_pool* - unsigned int (in binary form) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "backlog": "...Binary...", - "status": "OK", - "untrusted": false - } -} -``` - - -### **get_output_distribution** - - - -Alias: *None*. - -Inputs: - -* *amounts* - array of unsigned int; amounts to look for -* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) -* *from_height* - unsigned int; (optional, default is 0) starting height to check from -* *to_height* - unsigned int; (optional, default is 0) ending height to check up to - -Outputs: - -* *distributions* - array of structure distribution as follows: - * *amount* - unsigned int - * *base* - unsigned int - * *distribution* - array of unsigned int - * *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "distributions": [{ - "amount": 2628780000, - "base": 0, - "distribution": "", - "start_height": 1462078 - }], - "status": "OK" - } -} -``` - - ---- - -## Other Daemon RPC Calls - -Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. - -The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: - - IP=127.0.0.1 - PORT=18081 - METHOD='gettransactions' - PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' - curl \ - -X POST http://$IP:$PORT/$METHOD \ - -d $PARAMS \ - -H 'Content-Type: application/json' - -Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. - -For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). - - -### **/get_height** - -Get the node's current height. - -Alias: */getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; Current length of longest chain known to daemon. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -``` -$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' - -{ - "height": 1564055, - "status": "OK", - "untrusted": false -} -``` - - - -### **/get_blocks.bin** - -Get all blocks info. Binary request. - -Alias: */getblocks.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int -* *prune* - boolean - -Outputs: - -* *blocks* - array of block complete entries -* *current_height* - unsigned int -* *output_indices* - structure as follows: - * *indices* - array of tx output indices, structure as follows: - * *indices* - array of unsigned int -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - -### **/get_blocks_by_height.bin** - -Get blocks by height. Binary request. - -Alias: */getblocks_by_height.bin*. - -Inputs: - -* *heights* - array of unsigned int; list of block heights - -Outputs: - -* *blocks* - array of block complete entries -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_hashes.bin** - -Get hashes. Binary request. - -Alias: */gethashes.bin*. - -Inputs: - -* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block -* *start_height* - unsigned int - -Outputs: - -* *current_height* - unsigned int -* *m_block_ids* - binary array of hashes; see *block_ids* above. -* *start_height* - unsigned int -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_o_indexes.bin** - -Get global outputs of transactions. Binary request. - -Alias: *None*. - -Inputs: - -* *txid* - binary txid - -Outputs: - -* *o_indexes* - array of unsigned int; List of output indexes -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_outs.bin** - -Get outputs. Binary request. - -Alias: *None*. - -Inputs: - -* *outputs* - array of structure *get_outputs_out* as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *amount* - unsigned int; - * *height* - unsigned int; block height of the output - * *key* - the public key of the output - * *mask* - * *txid* - transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - - - -### **/get_transactions** - -Look up one or more transactions by hash. - -Alias: */gettransactions*. - -Inputs: - -* *txs_hashes* - string list; List of transaction hashes to look up. -* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. -* *prune* - boolean; Optional (`false` by default). - -Outputs: - -* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. -* *status* - General RPC error code. "OK" means everything looks good. -* *txs* - array of structure *entry* as follows: - * *as_hex* - string; Full transaction information as a hex string. - * *as_json* - json string; List of transaction info: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. - * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. - * *block_height* - unsigned int; block height including the transaction - * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain - * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) - * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) - * *output_indices* - array of unsigned int; transaction indexes - * *tx_hash* - string; transaction hash -* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) -* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: - -Example 1: Return transaction information in binary format. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "untrusted": false -} -``` - -Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. - -``` -$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' - -{ - "status": "OK", - "txs": [{ - "as_hex": "...", - "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", - "block_height": 993442, - "block_timestamp": 1457749396, - "double_spend_seen": false, - "in_pool": false, - "output_indices": [198769,418598,176616,50345,509], - "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" - }], - "txs_as_hex": ["..."], - "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], - "untrusted": false -} -``` - -Example 3: Returned a missed (unexisting) transaction. - -``` -curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' - -{ - "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], - "status": "OK", - "untrusted": false -} -``` - - -### **/get_alt_blocks_hashes** - -Get the known blocks hashes which are not on the main chain. - -Alias: *None*. - -Inputs: *None* - -Outputs: - -* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' - -{ - "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], - "status": "OK", - "untrusted": false -} -``` - - -### **/is_key_image_spent** - -Check if outputs have been spent using the key image associated with the output. - -Alias: *None*. - -Inputs: - -* *key_images* - string list; List of key image hex strings to check. - -Outputs: - -* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' - -{ - "spent_status": [1,2], - "status": "OK" - "untrusted": false -} -``` - - -### **/send_raw_transaction** - -Broadcast a raw transaction to the network. - -Alias: */sendrawtransaction*. - -Inputs: - -* *tx_as_hex* - string; Full transaction information as hexidecimal string. -* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). - -Outputs: - -* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). -* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). -* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). -* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). -* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). -* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). -* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). -* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). -* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -Example (No return information included here.): - - -``` -$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' -``` - - -### **/start_mining** - -Start mining on the daemon. - -Alias: *None*. - -Inputs: - -* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). -* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). -* *miner_address* - string; Account address to mine to. -* *threads_count* - unsigned int; Number of mining thread to run. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_mining** - -Stop mining on the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/mining_status** - -Get the mining status of the daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). -* *address* - string; Account address daemon is mining to. Empty if not mining. -* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). -* *speed* - unsigned int; Mining power in hashes per seconds. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *threads_count* - unsigned int; Number of running mining threads. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": true, - "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", - "is_background_mining_enabled": false, - "speed": 20, - "status": "OK", - "threads_count": 1 -} -``` - -Example while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' - -{ - "active": false, - "address": "", - "is_background_mining_enabled": false, - "speed": 0, - "status": "OK", - "threads_count": 0 -} -``` - - -### **/save_bc** - -Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_peer_list** - -Get the known peers list. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *gray_list* - array of offline *peer* structure as follows: - * *host* - unsigned int; IP address in integer format - * *id* - string; Peer id - * *ip* - unsigned int; IP address in integer format - * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time - * *port* - unsigned int; TCP port the peer is using to connect to monero network. -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. -* *white_list* - array of online *peer* structure, as above. - -Example (truncated lists): - -``` -$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' - -{ - "gray_list": [{ - "host": "640304833", - "id": 5345237316225602120, - "ip": 640304833, - "last_seen": 1525540510, - "port": 18080 - },{ - "host": "2183731038", - "id": 14955030573998424430, - "ip": 2183731038, - "last_seen": 1525540499, - "port": 28080 - }, ... - ], - "status": "OK", - "white_list": [{ - "host": "1221637955", - "id": 10354694710033118926, - "ip": 1221637955, - "last_seen": 1525540511, - "port": 18080 - },{ - "host": "1780407354", - "id": 17193661050352240890, - "ip": 1780407354, - "last_seen": 1525540510, - "port": 18080 - }, ... - ] -} -``` - - -### **/set_log_hash_rate** - -Set the log hash rate display mode. - -Alias: *None*. - -Inputs: - -* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example while mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - -Error while not mining: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' - -{ - "status": "NOT MINING" -} -``` - - -### **/set_log_level** - -Set the daemon log level. -By default, log level is set to `0`. - -Alias: *None*. - -Inputs: - -* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/set_log_categories** - -Set the daemon log categories. -Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: -* *Category* is one of the following: - * *\** - All facilities - * *default* - * *net* - * *net.http* - * *net.p2p* - * *logging* - * *net.throttle* - * *blockchain.db* - * *blockchain.db.lmdb* - * *bcutil* - * *checkpoints* - * *net.dns* - * *net.dl* - * *i18n* - * *perf* - * *stacktrace* - * *updates* - * *account* - * *cn* - * *difficulty* - * *hardfork* - * *miner* - * *blockchain* - * *txpool* - * *cn.block_queue* - * *net.cn* - * *daemon* - * *debugtools.deserialize* - * *debugtools.objectsizes* - * *device.ledger* - * *wallet.gen_multisig* - * *multisig* - * *bulletproofs* - * *ringct* - * *daemon.rpc* - * *wallet.simplewallet* - * *WalletAPI* - * *wallet.ringdb* - * *wallet.wallet2* - * *wallet.rpc* - * *tests.core* -* *Level* is one of the following: - * *FATAL* - higher level - * *ERROR* - * *WARNING* - * *INFO* - * *DEBUG* - * *TRACE* - lower level -A level automatically includes higher level. -By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. -Setting the categories to "" prevent any logs to be outputed. - -Alias: *None*. - -Inputs: - -* *categories* - string; Optional, daemon log categories to enable - -Outputs: - -* *categories* - string; daemon log enabled categories -* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. - -Example to set all facilities to Security Level `Info`: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' - -{ - "categories": "*:INFO", - "status": "OK" -} -``` - -Example without input to set the default categories: - -``` -$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' - -{ - "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", - "status": "OK" -} -``` - - -### **/get_transaction_pool** - -Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *spent_key_images* - List of spent output key images: - * *id_hash* - string; Key image. - * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: - * *blob_size* - unsigned int; The size of the full transaction blob. - * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. - * *do_not_relay*; boolean; States if this transaction should not be relayed - * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. - * *id_hash* - string; The transaction ID hash. - * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). - * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. - * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. - * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. - * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. - * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. - * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. - * *relayed* - boolean; States if this transaction has been relayed - * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. - * *tx_json* - json string; JSON structure of all information in the transaction: - * *version* - Transaction version - * *unlock_time* - If not 0, this tells when a transaction output is spendable. - * *vin* - List of inputs into transaction: - * *key* - The public key of the previous output spent in this transaction. - * *amount* - The amount of the input, in @atomic-units. - * *key_offsets* - A list of integer offets to the input. - * *k_image* - The key image for the given input - * *vout* - List of outputs from transaction: - * *amount* - Amount of transaction output, in @atomic-units. - * *target* - Output destination information: - * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. - * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. - * *rct_signatures* - Ring signatures: - * *type* - * *txnFee* - * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: - * *mask* - String - * *amount* - String - * *outPk* - * *rctsig_prunable* - * *rangeSigs* - array of structures as follows: - * *asig* - * *Ci* - * *MGs* - array of structures as follows: - * *ss* - array of arrays of two strings. - * *cc* - String - -Example (Note: Some lists in the returned information have been truncated for display reasons): - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' - -{ - "spent_key_images": [{ - "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", - "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] - },{ - "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", - "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] - }, - ...], - "status": "OK", - "transactions": [{ - "blob_size": 13193, - "do_not_relay": false, - "double_spend_seen": false, - "fee": 9694360000, - "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", - "kept_by_block": false, - "last_failed_height": 0, - "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", - "last_relayed_time": 1525615049, - "max_used_block_height": 1564924, - "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", - "receive_time": 1525615049, - "relayed": true, - "tx_blob": " ... ", - "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], - ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" - }, - ...] -} -``` - - -### **/get_transaction_pool_hashes.bin** - -Get hashes from transaction pool. Binary request. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. -* *tx_hashes* - binary array of transaction hashes. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' - -{ - "status": "OK", - "tx_hashes": " ... ", - "untrusted": false -} -``` - - -### **/get_transaction_pool_stats** - -Get the transaction pool statistics. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *pool_stats* - Structure as follows: - * *bytes_max* - unsigned int; Max transaction size in pool - * *bytes_med* - unsigned int; Median transaction size in pool - * *bytes_min* - unsigned int; Min transaction size in pool - * *bytes_total* - unsigned int; total size of all transactions in pool - * *histo* - structure *txpool_histo* as follows: - * *txs* - unsigned int; number of transactions - * *bytes* - unsigned int; size in bytes. - * *histo_98pc* unsigned int; the time 98% of txes are "younger" than - * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes - * *num_double_spends* unsigned int; number of double spend transactions - * *num_failing* unsigned int; number of failing transactions - * *num_not_relayed* unsigned int; number of non-relayed transactions - * *oldest* unsigned int; unix time of the oldest transaction in the pool - * *txs_total* unsigned int; total number of transactions. -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' - -{ - "pool_stats": { - "bytes_max": 47222, - "bytes_med": 13290, - "bytes_min": 13092, - "bytes_total": 449511, - "fee_total": 289715320000, - "histo": "\t▒'▒5▒4▒\/▒▒▒$3", - "histo_98pc": 0, - "num_10m": 18, - "num_double_spends": 1, - "num_failing": 17, - "num_not_relayed": 0, - "oldest": 1525457001, - "txs_total": 26 - }, - "status": "OK", - "untrusted": false -} -``` - - -### **/stop_daemon** - -Send a command to the daemon to safely disconnect and shut down. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_info (not JSON)** - -This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. - -Alias: - -* */getinfo* -* *get_info* - - -### **/get_limit** - -Get daemon bandwidth limits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' - -{ - "limit_down": 8192, - "limit_up": 128, - "status": "OK", - "untrusted": false -} -``` - - -### **/set_limit** - -Set daemon bandwidth limits. - -Alias: *None*. - -Inputs: - -* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) -* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) - -Outputs: - -* *limit_down* - unsigned int; Download limit in kBytes per second -* *limit_up* - unsigned int; Upload limit in kBytes per second -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' - -{ - "limit_down": 1024, - "limit_up": 128, - "status": "OK" -} -``` - - -### **/out_peers** - -Limit number of Outgoing peers. - -Alias: *None*. - -Inputs: - -* *out_peers* - unsigned int; Max number of outgoing peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/in_peers** - -Limit number of Incoming peers. - -Alias: *None*. - -Inputs: - -* *in_peers* - unsigned int; Max number of incoming peers - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/start_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/stop_save_graph** - -Obsolete. Conserved here for reference. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *status* - string; General RPC error code. "OK" means everything looks good. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' - -{ - "status": "OK" -} -``` - - -### **/get_outs** - -Get outputs. - -Alias: *None*. - -Inputs: - -* *outputs* array of *get_outputs_out* structure as follows: - * *amount* - unsigned int; - * *index* - unsigned int; - -Outputs: - -* *outs* - array of structure *outkey* as follows: - * *height* - unsigned int; block height of the output - * *key* - String; the public key of the output - * *mask* - String - * *txid* - String; transaction id - * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) -* *status* - string; General RPC error code. "OK" means everything looks good. -* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). - - -### **/update** - -Update daemon. - -Alias: *None*. - -Inputs: - -* *command* - String; command to use, either `check` or `download` -* *path* - String; Optional, path where to download the update. - -Outputs: - -* *auto_uri* - string; -* *hash* - string; -* *path* - String; path to download the update -* *status* - string; General RPC error code. "OK" means everything looks good. -* *update* - boolean; States if an update is available to download (`true`) or not (`false`) -* *user_uri* - string; -* *version* - string; Version available for download. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' - -{ - "auto_uri": "", - "hash": "", - "path": "", - "status": "OK", - "update": false, - "user_uri": "", - "version": "" -} -``` - diff --git a/_i18n/zh-tw/resources/developer-guides/wallet-rpc.md b/_i18n/zh-tw/resources/developer-guides/wallet-rpc.md deleted file mode 100644 index 7d0ee5eb..00000000 --- a/_i18n/zh-tw/resources/developer-guides/wallet-rpc.md +++ /dev/null @@ -1,2734 +0,0 @@ -{% assign version = '2.2.0' | split: '.' %} -{% include disclaimer.html translated="true" version=page.version %} -## Introduction - -This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. - -All monero-wallet-rpc methods use the same JSON RPC interface. For example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: - -``` -IP=127.0.0.1 -PORT=18082 -METHOD="make_integrated_address" -PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" -curl \ - -u username:password --digest \ - -X POST http://$IP:$PORT/json_rpc \ - -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ - -H 'Content-Type: application/json' -``` - -Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** - -This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. - -### Index of JSON RPC Methods: - -* [get_balance](#get_balance) -* [get_address](#get_address) -* [get_address_index](#get_address_index) -* [create_address](#create_address) -* [label_address](#label_address) -* [get_accounts](#get_accounts) -* [create_account](#create_account) -* [label_account](#label_account) -* [get_account_tags](#get_account_tags) -* [tag_accounts](#tag_accounts) -* [untag_accounts](#untag_accounts) -* [set_account_tag_description](#set_account_tag_description) -* [get_height](#get_height) -* [transfer](#transfer) -* [transfer_split](#transfer_split) -* [sign_transfer](#sign_transfer) -* [submit_transfer](#submit_transfer) -* [sweep_dust](#sweep_dust) -* [sweep_all](#sweep_all) -* [sweep_single](#sweep_single) -* [relay_tx](#relay_tx) -* [store](#store) -* [get_payments](#get_payments) -* [get_bulk_payments](#get_bulk_payments) -* [incoming_transfers](#incoming_transfers) -* [query_key](#query_key) -* [make_integrated_address](#make_integrated_address) -* [split_integrated_address](#split_integrated_address) -* [stop_wallet](#stop_wallet) -* [rescan_blockchain](#rescan_blockchain) -* [set_tx_notes](#set_tx_notes) -* [get_tx_notes](#get_tx_notes) -* [set_attribute](#set_attribute) -* [get_attribute](#get_attribute) -* [get_tx_key](#get_tx_key) -* [check_tx_key](#check_tx_key) -* [get_tx_proof](#get_tx_proof) -* [check_tx_proof](#check_tx_proof) -* [get_spend_proof](#get_spend_proof) -* [check_spend_proof](#check_spend_proof) -* [get_reserve_proof](#get_reserve_proof) -* [check_reserve_proof](#check_reserve_proof) -* [get_transfers](#get_transfers) -* [get_transfer_by_txid](#get_transfer_by_txid) -* [sign](#sign) -* [verify](#verify) -* [export_outputs](#export_outputs) -* [import_outputs](#import_outputs) -* [export_key_images](#export_key_images) -* [import_key_images](#import_key_images) -* [make_uri](#make_uri) -* [parse_uri](#parse_uri) -* [get_address_book](#get_address_book) -* [add_address_book](#add_address_book) -* [delete_address_book](#delete_address_book) -* [refresh](#refresh) -* [rescan_spent](#rescan_spent) -* [start_mining](#start_mining) -* [stop_mining](#stop_mining) -* [get_languages](#get_languages) -* [create_wallet](#create_wallet) -* [open_wallet](#open_wallet) -* [close_wallet](#close_wallet) -* [change_wallet_password](#change_wallet_password) -* [is_multisig](#is_multisig) -* [prepare_multisig](#prepare_multisig) -* [make_multisig](#make_multisig) -* [export_multisig_info](#export_multisig_info) -* [import_multisig_info](#import_multisig_info) -* [finalize_multisig](#finalize_multisig) -* [sign_multisig](#sign_multisig) -* [submit_multisig](#submit_multisig) -* [get_version](#get_version) - ---- - -## JSON RPC Methods: - -### **get_balance** - -Return the wallet's balance. - -Alias: *getbalance*. - -Inputs: - -* *account_index* - unsigned int; Return balance for this account. -* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. - -Outputs: - -* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. -* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. -* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. -* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. - * *address_index* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address at this index. Base58 representation of the public keys. - * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). - * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. - * *label* - string; Label for the subaddress. - * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "balance": 157443303037455077, - "multisig_import_needed": false, - "per_subaddress": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "balance": 157360317826255077, - "label": "Primary account", - "num_unspent_outputs": 5281, - "unlocked_balance": 157360317826255077 - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "balance": 59985211200000, - "label": "", - "num_unspent_outputs": 1, - "unlocked_balance": 59985211200000 - }], - "unlocked_balance": 157443303037455077 - } -} -``` - - -### **get_address** - -Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. - -Alias: *getaddress*. - -Inputs: - -* *account_index* - unsigned int; Return subaddresses for this account. -* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. - -Outputs: - -* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. -* *addresses* array of addresses informations - * *address* string; The 95-character hex (sub)address string. - * *label* string; Label of the (sub)address - * *address_index* unsigned int; index of the subaddress - * *used* boolean; states if the (sub)address has already received funds - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "addresses": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "address_index": 0, - "label": "Primary account", - "used": true - },{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "address_index": 1, - "label": "", - "used": true - },{ - "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", - "address_index": 4, - "label": "test2", - "used": true - }] - } -} -``` - - - -### **get_address_index** - -Get account and address indexes from a specific (sub)address - -Alias: *None*. - -Inputs: - -* *address* - String; (sub)address to look for. - -Outputs: - -* *index* - subaddress informations - * *major* unsigned int; Account index. - * *minor* unsigned int; Address index. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": { - "major": 0, - "minor": 1 - } - } -} -``` - - -### **create_address** - -Create a new address for an account. Optionally, label the new address. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Create a new address for this account. -* *label* - string; (Optional) Label for the new address. - -Outputs: - -* *address* - string; Newly created address. Base58 representation of the public keys. -* *address_index* - unsigned int; Index of the new address under the input account. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", - "address_index": 5 - } -} -``` - - -### **label_address** - -Label an address. - -Alias: *None*. - -Inputs: - -* *index* - subaddress index; JSON Object containing the major & minor address index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. -* *label* - string; Label for the address. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - -### **get_accounts** - -Get all accounts for a wallet. Optionally filter accounts by tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; (Optional) Tag for filtering accounts. - -Outputs: - -* *subaddress_accounts* - array of subaddress account information: - * *account_index* - unsigned int; Index of the account. - * *balance* - unsigned int; Balance of the account (locked or unlocked). - * *base_address* - string; Base64 representation of the first subaddress in the account. - * *label* - string; (Optional) Label of the account. - * *tag* - string; (Optional) Tag for filtering accounts. - * *unlocked_balance* - unsigned int; Unlocked balance for the account. -* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). -* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "subaddress_accounts": [{ - "account_index": 0, - "balance": 157663195572433688, - "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "label": "Primary account", - "tag": "myTag", - "unlocked_balance": 157443303037455077 - },{ - "account_index": 1, - "balance": 0, - "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "label": "Secondary account", - "tag": "myTag", - "unlocked_balance": 0 - }], - "total_balance": 157663195572433688, - "total_unlocked_balance": 157443303037455077 - } -} -``` - - -### **create_account** - -Create a new account with an optional label. - -Alias: *None*. - -Inputs: - -* *label* - string; (Optional) Label for the account. - -Outputs: - -* *account_index* - unsigned int; Index of the new account. -* *address* - string; Address for this account. Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_index": 1, - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" - } -} -``` - - -### **label_account** - -Label an account. - -Alias: *None*. - -Inputs: - -* *account_index* - unsigned int; Apply label to account at this index. -* *label* - string; Label for the account. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0,1], - "label": "", - "tag": "myTag" - }] - } -} -``` - - -### **get_account_tags** - -Get a list of user-defined account tags. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *account_tags* - array of account tag information: - * *tag* - string; Filter tag. - * *label* - string; Label for the tag. - * *accounts* - array of int; List of tagged account indices. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "account_tags": [{ - "accounts": [0], - "label": "Test tag", - "tag": "myTag" - }] - } -} -``` - - -### **tag_accounts** - -Apply a filtering tag to a list of accounts. - -Alias: *None*. - -Inputs: - -* *tag* - string; Tag for the accounts. -* *accounts* - array of unsigned int; Tag this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **untag_accounts** - -Remove filtering tag from a list of accounts. - -Alias: *None*. - -Inputs: - -* *accounts* - array of unsigned int; Remove tag from this list of accounts. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_account_tag_description** - -Set description for an account tag. - -Alias: *None*. - -Inputs: - -* *tag* - string; Set a description for this tag. -* *description* - string; Description for the tag. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_height** - -Returns the wallet's current block height. - -Alias: *getheight*. - -Inputs: *None*. - -Outputs: - -* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 145545 - } -} -``` - - -### **transfer** - -Send monero to a number of recipients. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) -* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) - - -Outputs: - -* *amount* - Amount transferred for the transaction. -* *fee* - Integer value of the fee charged for the txn. -* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). -* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. -* *tx_hash* - String for the publically searchable transaction hash. -* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. -* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. -* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 300000000000, - "fee": 86897600000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", - "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **transfer_split** - -Same as transfer, but can split into more than one tx if necessary. - -Alias: *None*. - -Inputs: - -* *destinations* - array of destinations to receive XMR: - * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. - * *address* - string; Destination public address. -* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; Return the transactions as hex string after sending -* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. -* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [3000000000000], - "fee_list": [473710000], - "multisig_txset": "", - "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], - "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], - "unsigned_txset": "" - } -} -``` - - -### **sign_transfer** - -Sign a transaction created on a read-only wallet (in cold-signing process) - -Alias: *None*. - -Inputs: - -* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. -* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) - -Outputs: - -* *signed_txset* - string. Set of signed tx to be used for submitting transfer. -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_raw_list* - array of: string. The tx raw data of every transaction. - -In the example below, we first generate an unsigned_txset on a read only wallet before signing it: - -Generate unsigned_txset using the above "transfer" method on read-only wallet: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 1000000000000, - "fee": 15202740000, - "multisig_txset": "", - "tx_blob": "...long_hex...", - "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "...long_hex..." - } -} -``` - -Sign tx using the previously generated unsigned_txset -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_txset": "...long_hex...", - "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] - } -} -``` - - -### **submit_transfer** - -Submit a previously signed transaction on a read-only wallet (in cold-signing process). - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. - -In the example below, we submit the transfer using the signed_txset generated above: -``` -curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] - } -} -``` - -### **sweep_dust** - -Send all dust outputs back to the wallet's, to make them easier to spend (and mix). - -Alias: *sweep_unmixable*. - -Inputs: - -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): - - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_txset": "", - "unsigned_txset": "" - } -} -``` - - -### **sweep_all** - -Send all unlocked balance to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount_list": [9985885770000], - "fee_list": [14114230000], - "multisig_txset": "", - "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], - "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], - "unsigned_txset": "" - } -} -``` - - -### **sweep_single** - -Send all of a specific unlocked output to an address. - -Alias: *None*. - -Inputs: - -* *address* - string; Destination public address. -* *account_index* - unsigned int; Sweep transactions from this account. -* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. -* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. -* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). -* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). -* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). -* *payment_id* - string; (Optional) Random 32-byte/64-character hex string to identify a transaction. -* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. -* *key_image* - string; Key image of specific output to sweep. -* *below_amount* - unsigned int; (Optional) Include outputs below this amount. -* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) -* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) -* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) - -Outputs: - -* *tx_hash_list* - array of: string. The tx hashes of every transaction. -* *tx_key_list* - array of: string. The transaction keys for every transaction. -* *amount_list* - array of: integer. The amount transferred for every transaction. -* *fee_list* - array of: integer. The amount of fees paid for every transaction. -* *tx_blob_list* - array of: string. The tx as hex string for every transaction. -* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. -* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). -* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "amount": 27126892247503, - "fee": 14111630000, - "multisig_txset": "", - "tx_blob": "", - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_key": "", - "tx_metadata": "", - "unsigned_txset": "" - } -} -``` - - -### **relay_tx** - -Relay a transaction previously created with `"do_not_relay":true`. - -Alias: *None*. - -Inputs: - -* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. - -Outputs: - -* *tx_hash* - String for the publically searchable transaction hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" - } -} -``` - - -### **store** - -Save the wallet file. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_payments** - -Get a list of incoming payments using a given payment id. - -Alias: *None*. - -Inputs: - -* *payment_id* - string; Payment ID used to find the payments (16 characters hex). - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching the input parameter. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **get_bulk_payments** - -Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. - -Alias: *None*. - -Inputs: - -* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). -* *min_block_height* - unsigned int; The block height at which to start looking for payments. - -Outputs: - -* *payments* - list of: - * *payment_id* - string; Payment ID matching one of the input IDs. - * *tx_hash* - string; Transaction hash used as the transaction ID. - * *amount* - unsigned int; Amount for this payment. - * *block_height* - unsigned int; Height of the block that first confirmed this payment. - * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. - * *subaddr_index* - subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress in the account. - * *address* - string; Address receiving the payment; Base58 representation of the public keys. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "payments": [{ - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 1000000000000, - "block_height": 127606, - "payment_id": "60900e5603bf96e3", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", - "unlock_time": 0 - }] - } -} -``` - - -### **incoming_transfers** - -Return a list of incoming transfers to the wallet. - -Inputs: - -* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. -* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. -* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. - -Outputs: - -* *transfers* - list of: - * *amount* - unsigned int; Amount of this transfer. - * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. - * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). - * *spent* - boolean; Indicates if this transfer has been spent. - * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. - * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. - * *tx_size* - unsigned int; Size of transaction in bytes. - -Example, get all transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - },{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get available transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfers": [{ - "amount": 27126892247503, - "global_index": 594994, - "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", - "spent": false, - "subaddr_index": 3, - "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", - "tx_size": 157 - },{ - "amount": 27169374733655, - "global_index": 594997, - "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", - "spent": false, - "subaddr_index": 3, - "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", - "tx_size": 158 - }] - } -} -``` - -Example, get unavailable transfers: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' -{ -"id": "0", -"jsonrpc": "2.0", -"result": { - "transfers": [{ - "amount": 60000000000000, - "global_index": 122405, - "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", - "spent": true, - "subaddr_index": 3, - "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", - "tx_size": 159 - }] -} -} -``` - - -### **query_key** - -Return the spend or view private key. - -Alias: *None*. - -Inputs: - -* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key - -Outputs: - -* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. - -Example (Query view key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" - } -} -``` - -Example (Query mnemonic key): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" - } -} -``` - - -### **make_integrated_address** - -Make an integrated address from the wallet address and a payment id. - -Alias: *None*. - -Inputs: - -* *standard_address* - string; (Optional, defaults to primary address) Destination public address. -* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. - -Outputs: - -* *integrated_address* - string -* *payment_id* - string; hex encoded; - -Example (Payment ID is empty, use a random ID): - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", - "payment_id": "420fa29b2d9a49f5" - } -} -``` - - -### **split_integrated_address** - -Retrieve the standard address and payment id corresponding to an integrated address. - -Alias: *None*. - -Inputs: - -* *integrated_address* - string - -Outputs: - -* *is_subaddress* - boolean; States if the address is a subaddress -* *payment* - string; hex encoded -* *standard_address* - string - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "is_subaddress": false, - "payment_id": "420fa29b2d9a49f5", - "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" - } -} -``` - - -### **stop_wallet** - -Stops the wallet, storing the current state. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **rescan_blockchain** - -Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. -This includes destination addresses, tx secret keys, tx notes, etc. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **set_tx_notes** - -Set arbitrary string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids -* *notes* - array of string; notes for the transactions - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_tx_notes** - -Get string notes for transactions. - -Alias: *None*. - -Inputs: - -* *txids* - array of string; transaction ids - -Outputs: - -* *notes* - array of string; notes for the transactions - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "notes": ["This is an example"] - } -} -``` - - -### **set_attribute** - -Set arbitrary attribute. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name -* *value* - string; attribute value - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_attribute** - -Get attribute value by name. - -Alias: *None*. - -Inputs: - -* *key* - string; attribute name - -Outputs: - -* *value* - string; attribute value - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "value": "my_value" - } -} -``` - - -### **get_tx_key** - -Get transaction secret key from transaction id. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. - -Outputs: - -* *tx_key* - string; transaction secret key. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" - } -} -``` - - -### **check_tx_key** - -Check a transaction in the blockchain with its secret key. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *tx_key* - string; transaction secret key. -* *address* - string; destination public address of the transaction. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "in_pool": false, - "received": 1000000000000 - } -} -``` - - -### **get_tx_proof** - -Get transaction signature to prove it. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; transaction signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" - } -} -``` - - -### **check_tx_proof** - -Prove a transaction by checking its signature. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *address* - string; destination public address of the transaction. -* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. -* *signature* - string; transaction signature to confirm. - -Outputs: - -* *confirmations* - unsigned int; Number of block mined after the one with the transaction. -* *good* - boolean; States if the inputs proves the transaction. -* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. -* *received* - unsigned int; Amount of the transaction. - -In the example below, the transaction has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 482, - "good": true, - "in_pool": false, - "received": 1000000000000 - } -} -``` - -In the example below, the wrong message is used, avoiding the transaction to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "confirmations": 0, - "good": false, - "in_pool": false, - "received": 0 - } -} -``` - - -### **get_spend_proof** - -Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; spend signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" - } -} -``` - - -### **check_spend_proof** - -Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. - -Alias: *None*. - -Inputs: - -* *txid* - string; transaction id. -* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. -* *signature* - string; spend signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the spend. - -In the example below, the spend has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - -In the example below, the wrong message is used, avoiding the spend to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_reserve_proof** - -Generate a signature to prove of an available amount in a wallet. - -Alias: *None*. - -Inputs: - -* *all* - boolean; Proves all wallet balance to be disposable. -* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) -* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) -* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. - -Outputs: - -* *signature* - string; reserve signature. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" - } -} -``` - - -### **check_reserve_proof** - -Proves a wallet has a disposable reserve using a signature. - -Alias: *None*. - -Inputs: - -* *address* - string; Public address of the wallet. -* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. -* *signature* - string; reserve signature to confirm. - -Outputs: - -* *good* - boolean; States if the inputs proves the reserve. - -In the example below, the reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 100000000000 - } -} -``` - -In the example below, all wallet reserve has been proven: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true, - "spent": 0, - "total": 164113855714662789 - } -} -``` - -In the example below, the wrong message is used, avoiding the reserve to be proved: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": false - } -} -``` - - -### **get_transfers** - -Returns a list of transfers. - -Alias: *None*. - -Inputs: - -* *in* - boolean; (Optional) Include incoming transfers. -* *out* - boolean; (Optional) Include outgoing transfers. -* *pending* - boolean; (Optional) Include pending transfers. -* *failed* - boolean; (Optional) Include failed transfers. -* *pool* - boolean; (Optional) Include transfers from the daemon's transaction pool. -* *filter_by_height* - boolean; (Optional) Filter transfers by block height. -* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. -* *max_height* - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). -* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) -* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) - -Outputs: - -* *in* array of transfers: - * *address* - string; Public address of the transfer. - * *amount* - unsigned int; Amount transferred. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID for this transfer. - * *type* - string; Transfer type: "in" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. -* *out* array of transfers (see above). -* *pending* array of transfers (see above). -* *failed* array of transfers (see above). -* *pool* array of transfers (see above). - - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "in": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000, - "confirmations": 1, - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 1, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "in", - "unlock_time": 0 - }] - } -} -``` - -### **get_transfer_by_txid** - -Show information about a transfer to/from this address. - -Alias: *None*. - -Inputs: - -* *txid* - string; Transaction ID used to find the transfer. -* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. - -Outputs: - -* *transfer* - JSON object containing payment information: - * *address* - string; Address that transferred the funds. Base58 representation of the public keys. - * *amount* - unsigned int; Amount of this transfer. - * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). - * *destinations* - array of JSON objects containing transfer destinations: - * *amount* - unsigned int; Amount transferred to this destination. - * *address* - string; Address for this destination. Base58 representation of the public keys. - * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. - * *fee* - unsigned int; Transaction fee for this transfer. - * *height* - unsigned int; Height of the first block that confirmed this transfer. - * *note* - string; Note about this transfer. - * *payment_id* - string; Payment ID for this transfer. - * *subaddr_index* - JSON object containing the major & minor subaddress index: - * *major* - unsigned int; Account index for the subaddress. - * *minor* - unsigned int; Index of the subaddress under the account. - * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. - * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). - * *txid* - string; Transaction ID of this transfer (same as input TXID). - * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" - * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "transfer": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 300000000000, - "confirmations": 1, - "destinations": [{ - "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", - "amount": 100000000000 - },{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "amount": 200000000000 - }], - "double_spend_seen": false, - "fee": 21650200000, - "height": 153624, - "note": "", - "payment_id": "0000000000000000", - "subaddr_index": { - "major": 0, - "minor": 0 - }, - "suggested_confirmations_threshold": 1, - "timestamp": 1535918400, - "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", - "type": "out", - "unlock_time": 0 - } - } -} -``` - - -### **sign** - -Sign a string. - -Alias: *None*. - -Inputs: - -* *data* - string; Anything you need to sign. - -Outputs: - -* *signature* - string; Signature generated against the "data" and the account public address. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" - } -} -``` - - -### **verify** - -Verify a signature on a string. - -Alias: *None*. - -Inputs: - -* *data* - string; What should have been signed. -* *address* - string; Public address of the wallet used to `sign` the data. -* *signature* - string; signature generated by `sign` method. - -Outputs: - -* *good* - boolean; - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "good": true - } -} -``` - - -### **export_outputs** - -Export all outputs in hex format. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "outputs_data_hex": "...outputs..." - } -} -``` - - -### **import_outputs** - -Import outputs in hex format. - -Alias: *None*. - -Inputs: - -* *outputs_data_hex* - string; wallet outputs in hex format. - -Outputs: - -* *num_imported* - unsigned int; number of outputs imported. - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "num_imported": 6400 - } -} -``` - - -### **export_key_images** - -Export a signed set of key images. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "signed_key_images": [{ - "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", - "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" - },{ - "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", - "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" - },...] - } -} -``` - - -### **import_key_images** - -Import signed key images list and verify their spent status. - -Alias: *None*. - -Inputs: - -* *signed_key_images* - array of signed key images: - * *key_image* - string; - * *signature* - string; - -Outputs: - -* *height* - unsigned int; -* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. -* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "height": 76428, - "spent": 62708953408711, - "unspent": 0 - } -} -``` - - -### **make_uri** - -Create a payment URI using the official URI spec. - -Alias: *None*. - -Inputs: - -* *address* - string; Wallet address -* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** -* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id -* *recipient_name* - string; (optional) name of the payment recipient -* *tx_description* - string; (optional) Description of the reason for the tx - -Outputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." - } -} -``` - - -### **parse_uri** - -Parse a payment URI to get payment information. - -Alias: *None*. - -Inputs: - -* *uri* - string; This contains all the payment input information as a properly formatted payment URI - -Outputs: - -* *uri* - JSON object containing payment information: - * *address* - string; Wallet address - * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) - * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) - * *recipient_name* - string; Name of the payment recipient (empty if not provided) - * *tx_description* - string; Description of the reason for the tx (empty if not provided) - -Example: - -``` -$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "uri": { - "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", - "amount": 10, - "payment_id": "420fa29b2d9a49f5", - "recipient_name": "el00ruobuob Stagenet wallet", - "tx_description": "Testing out the make_uri function." - } - } -} -``` - - -### **get_address_book** - -Retrieves entries from the address book. - -Alias: *None*. - -Inputs: - -* *entries* - array of unsigned int; indices of the requested address book entries - -Outputs: - -* *entries* - array of entries: - * *address* - string; Public address of the entry - * *description* - string; Description of this address entry - * *index* - unsigned int; - * *payment_id* - string; - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "entries": [{ - "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", - "description": "Second account", - "index": 0, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - },{ - "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", - "description": "Third account", - "index": 1, - "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" - }] - } -} -``` - - -### **add_address_book** - -Add an entry to the address book. - -Alias: *None*. - -Inputs: - -* *address* - string; -* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; -* *description* - (optional) string, defaults to ""; - -Outputs: - -* *index* - unsigned int; The index of the address book entry. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "index": 1 - } -} -``` - - -### **delete_address_book** - -Delete an entry from the address book. - -Alias: *None*. - -Inputs: - -* *index* - unsigned int; The index of the address book entry. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **refresh** - -Refresh a wallet after openning. - -Alias: *None*. - -Inputs: - -* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. - -Outputs: - -* *blocks_fetched* - unsigned int; Number of new blocks scanned. -* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blocks_fetched": 24, - "received_money": true - } -} -``` - - -### **rescan_spent** - -Rescan the blockchain for spent outputs. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' - -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **start_mining** - -Start mining in the Monero daemon. - -Alias: *None*. - -Inputs: - -* *threads_count* - unsigned int; Number of threads created for mining. -* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. -* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **stop_mining** - -Stop mining in the Monero daemon. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **get_languages** - -Get a list of available languages for your wallet's seed. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *languages* - array of string; List of available languages - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] - } -} -``` - - -### **create_wallet** - -Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; Wallet file name. -* *password* - string; (Optional) password to protect the wallet. -* *language* - string; Language for your wallets' seed. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **open_wallet** - -Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. - -Alias: *None*. - -Inputs: - -* *filename* - string; wallet name stored in --wallet-dir. -* *password* - string; (Optional) only needed if the wallet has a password defined. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **close_wallet** - -Close the currently opened wallet, after trying to save it. - -Alias: *None*. - -Inputs: *None*. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **change_wallet_password** - -Change a wallet password. - -Alias: *None*. - -Inputs: - -* *old_password* - string; (Optional) Current wallet password, if defined. -* *new_password* - string; (Optional) New wallet password, if not blank. - -Outputs: *None*. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - } -} -``` - - -### **is_multisig** - -Check if a wallet is a multisig one. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig* - boolean; States if the wallet is multisig -* *ready* - boolean; -* *threshold* - unsigned int; Amount of signature needed to sign a transfer. -* *total* - unsigned int; Total amount of signature in the multisig wallet. - -Example for a non-multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": false, - "ready": false, - "threshold": 0, - "total": 0 - } -} -``` -Example for a multisig wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig": true, - "ready": true, - "threshold": 2, - "total": 2 - } -} -``` - - -### **prepare_multisig** - -Prepare a wallet for multisig by generating a multisig string to share with peers. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" - } -} -``` - - -### **make_multisig** - -Make a wallet multisig by importing peers multisig string. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. -* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). - -Example for 2/2 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", - "multisig_info": "" - } -} -``` - -Example for 2/3 Multisig Wallet: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", - "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" - } -} -``` - - -### **export_multisig_info** - -Export multisig info for other participants. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *info* - string; Multisig info in hex format for other participants. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" - } -} -``` - - -### **import_multisig_info** - -Import multisig info from other participants. - -Alias: *None*. - -Inputs: - -* *info* - array of string; List of multisig info in hex format from other participants. - -Outputs: - -* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "n_outputs": 35 - } -} -``` - - -### **finalize_multisig** - -Turn this wallet into a multisig wallet, extra step for N-1/N wallets. - -Alias: *None*. - -Inputs: - -* *multisig_info* - array of string; List of multisig string from peers. -* *password* - string; Wallet password - -Outputs: - -* *address* - string; multisig wallet address. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" - } -} -``` - - -### **sign_multisig** - -Sign a transaction in multisig. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. - -Outputs: - -* *tx_data_hex* - string; Multisig transaction in hex format. -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_data_hex": "...multisig_txset...", - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **submit_multisig** - -Submit a signed multisig transaction. - -Alias: *None*. - -Inputs: - -* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. - -Outputs: - -* *tx_hash_list* - array of string; List of transaction Hash. - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] - } -} -``` - - -### **get_version** - -Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. - -Alias: *None*. - -Inputs: *None*. - -Outputs: - -* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). - -Example: - -``` -$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "version": 65539 - } -} -``` \ No newline at end of file diff --git a/resources/developer-guides/daemon-rpc.md b/resources/developer-guides/daemon-rpc.md index 314aff05..56a4bd63 100644 --- a/resources/developer-guides/daemon-rpc.md +++ b/resources/developer-guides/daemon-rpc.md @@ -1,13 +1,2381 @@ --- layout: user-guide title: "Daemon RPC documentation" -permalink: /resources/developer-guides/daemon-rpc.html -mainVersion: - - "2" - - "2" - - "0" --- -{% t global.lang_tag %} -

{% t developer-guides.daemonrpc %}

-{% tf resources/developer-guides/daemon-rpc.md %} +# Daemon RPC + +## Introduction + +This is a list of the monerod daemon RPC calls, their inputs and outputs, and examples of each. + +Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below. + +Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** + +### [JSON RPC Methods](#json-rpc-methods): + +* [get_block_count](#get_block_count) +* [on_get_block_hash](#on_get_block_hash) +* [get_block_template](#get_block_template) +* [submit_block](#submit_block) +* [get_last_block_header](#get_last_block_header) +* [get_block_header_by_hash](#get_block_header_by_hash) +* [get_block_header_by_height](#get_block_header_by_height) +* [get_block_headers_range](#get_block_headers_range) +* [get_block](#get_block) +* [get_connections](#get_connections) +* [get_info](#get_info) +* [hard_fork_info](#hard_fork_info) +* [set_bans](#set_bans) +* [get_bans](#get_bans) +* [flush_txpool](#flush_txpool) +* [get_output_histogram](#get_output_histogram) +* [get_version](#get_version) +* [get_coinbase_tx_sum](#get_coinbase_tx_sum) +* [get_fee_estimate](#get_fee_estimate) +* [get_alternate_chains](#get_alternate_chains) +* [relay_tx](#relay_tx) +* [sync_info](#sync_info) +* [get_txpool_backlog](#get_txpool_backlog) +* [get_output_distribution](#get_output_distribution) + +### [Other RPC Methods](#other-daemon-rpc-calls): + +* [/get_height](#get_height) +* [/get_blocks.bin](#get_blocksbin) +* [/get_blocks_by_height.bin](#get_blocks_by_heightbin) +* [/get_hashes.bin](#get_hashesbin) +* [/get_o_indexes.bin](#get_o_indexesbin) +* [/get_outs.bin](#get_outsbin) +* [/get_transactions](#get_transactions) +* [/get_alt_blocks_hashes](#get_alt_blocks_hashes) +* [/is_key_image_spent](#is_key_image_spent) +* [/send_raw_transaction](#send_raw_transaction) +* [/start_mining](#start_mining) +* [/stop_mining](#stop_mining) +* [/mining_status](#mining_status) +* [/save_bc](#save_bc) +* [/get_peer_list](#get_peer_list) +* [/set_log_hash_rate](#set_log_hash_rate) +* [/set_log_level](#set_log_level) +* [/set_log_categories](#set_log_categories) +* [/get_transaction_pool](#get_transaction_pool) +* [/get_transaction_pool_hashes.bin](#get_transaction_pool_hashesbin) +* [/get_transaction_pool_stats](#get_transaction_pool_stats) +* [/stop_daemon](#stop_daemon) +* [/get_info (not JSON)](#get_info-not-json) +* [/get_limit](#get_limit) +* [/set_limit](#set_limit) +* [/out_peers](#out_peers) +* [/in_peers](#in_peers) +* [/start_save_graph](#start_save_graph) +* [/stop_save_graph](#stop_save_graph) +* [/get_outs](#get_outs) +* [/update](#update) + + +--- + +## JSON RPC Methods + +The majority of monerod RPC calls use the daemon's `json_rpc` interface to request various bits of information. These methods all follow a similar structure, for example: + +``` +IP=127.0.0.1 +PORT=18081 +METHOD='get_block_header_by_height' +ALIAS='getblockheaderbyheight' +PARAMS='{"height":912345}' +curl \ + -X POST http://$IP:$PORT/json_rpc \ + -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'$PARAMS'}' \ + -H 'Content-Type: application/json' +``` + +Some methods include parameters, while others do not. Examples of each JSON RPC method follow. + +### **get_block_count** + +Look up how many blocks are in the longest chain known to the node. + +Alias: *getblockcount*. + +Inputs: *None*. + +Outputs: + +* *count* - unsigned int; Number of blocks in longest chain seen by the node. +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "count": 993163, + "status": "OK" + } +} +``` + + +### **on_get_block_hash** + +Look up a block's hash by its height. + +Alias: *on_getblockhash*. + +Inputs: + +* block height (int array of length 1) + +Outputs: + +* block hash (string) + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"on_get_block_hash","params":[912345]}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" +} +``` + + +### **get_block_template** + +Get a block template on which mining a new block. + +Alias: *getblocktemplate*. + +Inputs: + +* *wallet_address* - string; Address of wallet to receive coinbase transactions if block is successfully mined. +* *reserve_size* - unsigned int; Reserve size. + +Outputs: + +* *blocktemplate_blob* - string; Blob on which to try to mine a new block. +* *blockhashing_blob* - string; Blob on which to try to find a valid nonce. +* *difficulty* - unsigned int; Difficulty of next block. +* *expected_reward* - unsigned int; Coinbase reward expected to be received if block is successfully mined. +* *height* - unsigned int; Height on which to mine. +* *prev_hash* - string; Hash of the most recent block on which to mine the next block. +* *reserved_offset* - unsigned int; Reserved offset. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_template","params":{"wallet_address":"44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns","reserve_size":60}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "blockhashing_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a00000000fc751ea4a94c2f840751eaa36138eee66dda15ef554e7d6594395827994e31da10", + "blocktemplate_blob": "070786a498d705f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a0000000002aeab5f01fff2aa5f01e0a9d0f2f08a01028fdb3d5b5a2c363d36ea17a4add99a23a3ec7935b4c3e1e0364fcc4295c7a2ef5f01f912b15f5d17c1539d4722f79d8856d8654c5af87f54cfb3a4ff7f6b512b2a08023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1755090c809421d69873c161e7969b8bf33cee3b451dd4859bfc244a705f0b4900498f804b6023e13fa023a0fb759e8b7c9a39506a21442bc47077beeedc6b78d34c4ebdae91bd96097ccc9a882bc5056568b0d2f1f06559368fea4acba8e745444e883e53156d5083c1fd260edf05292934c8b40c098b81fe4e261720bdd272b209e317247a1d2c55dc4718891af0d16273c5a610f36f382a3bf50f54808aaa6a508e51d4601dd0d8fbf8b3b1685066ce121666a1409e8ac7a4d673c1cc36d10b825f764af647441f53230518e4d2efbcf8791c6060912c76e90db4982a66d51bbd96290bbb34db8080b216c2940cec407260bf5e2c3a5ee280835f15298f0801e9d98c4d414792282fbc2c28c3e20bc0fcb1829b5c3ad8f8d20847be8fdb2a949fd96f0205fbd6d271c880c5d8c83e9813606cd803a44d377fdeae45bfa67112132af601e9b3b0613ba7dff2ec3d4b935c447b47bfe39f7b950981b2f4c66c0d853e2218f1f69229a9b608c3d98be09b6d4d640a9f6ff0e920dbacf7e58b59554c0b398b1ae4b1d497104b4e4e745d850eed7eddb8aa93437427bf442ae5beb22cbf10a8fa738ea38cfa5d86dfd30675d4be11a38016e36936fd5601e52643e8b8bc433702ea7ae6149309c95b898cc854850e73fe0b95c5b8879b7325ecd4", + "difficulty": 61043624293, + "expected_reward": 4771949057248, + "height": 1561970, + "prev_hash": "f8dc58791266179087907a2ff4cd883615216749b97d2f12173171c725a6f84a", + "reserved_offset": 129, + "status": "OK", + "untrusted": false + } +} +``` + + +### **submit_block** + +Submit a mined block to the network. + +Alias: *submitblock*. + +Inputs: + +* Block blob data - array of strings; list of block blobs which have been mined. See [get_block_template](#get_block_template) to get a blob on which to mine. + +Outputs: + +* *status* - string; Block submit status. + +In this example, a block blob which has not been mined is submitted: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_block","params":["0707e6bdfedc053771512f1bc27c62731ae9e8f2443db64ce742f4e57f5cf8d393de28551e441a0000000002fb830a01ffbf830a018cfe88bee283060274c0aae2ef5730e680308d9c00b6da59187ad0352efe3c71d36eeeb28782f29f2501bd56b952c3ddc3e350c2631d3a5086cac172c56893831228b17de296ff4669de020200000000"]' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "error": { + "code": -7, + "message": "Block not accepted" + } +} +``` + + +### **get_last_block_header** + +Block header information for the most recent block is easily retrieved with this method. No inputs are needed. + +Alias: *getlastblockheader*. + +Inputs: *None*. + +Outputs: + +* *block_header* - A structure containing block header information. + * *block_size* - unsigned int; The block size in bytes. + * *depth* - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block. + * *difficulty* - unsigned int; The strength of the Monero network based on mining power. + * *hash* - string; The hash of this block. + * *height* - unsigned int; The number of blocks preceding this block on the blockchain. + * *major_version* - unsigned int; The major version of the monero protocol at this block height. + * *minor_version* - unsigned int; The minor version of the monero protocol at this block height. + * *nonce* - unsigned int; a cryptographic random one-time number used in mining a Monero block. + * *num_txes* - unsigned int; Number of transactions in the block, not counting the coinbase tx. + * *orphan_status* - boolean; Usually `false`. If `true`, this block is not part of the longest chain. + * *prev_hash* - string; The hash of the block immediately preceding this block in the chain. + * *reward* - unsigned int; The amount of new @atomic-units generated in this block and rewarded to the miner. Note: 1 XMR = 1e12 @atomic-units. + * *timestamp* - unsigned int; The unix time at which the block was recorded into the blockchain. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +In this example, the most recent block (1562023 at the time) is returned: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_last_block_header"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "block_header": { + "block_size": 62774, + "depth": 0, + "difficulty": 60097900840, + "hash": "3a289b8fa88b10e2163826c230b45d79f2be37d14fa3153ee58ff8a427782d14", + "height": 1562023, + "major_version": 7, + "minor_version": 7, + "nonce": 3789681204, + "num_txes": 5, + "orphan_status": false, + "prev_hash": "743e5d0a26849efe27b96086f2c4ecc39a0bc744bf21473dad6710221aff6ac3", + "reward": 4724029079703, + "timestamp": 1525029411 + }, + "status": "OK", + "untrusted": false + } +} +``` + + +### **get_block_header_by_hash** + +Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block. + +Alias: *getblockheaderbyhash*. + +Inputs: + +* *hash* - string; The block's sha256 hash. + +Outputs: + +* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +In this example, block 912345 is looked up by its hash: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_hash","params":{"hash":"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6"}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "block_header": { + "block_size": 210, + "depth": 649717, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "num_txes": 0, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "status": "OK", + "untrusted": false + } +} +``` + + +### **get_block_header_by_height** + +Similar to [get_block_header_by_hash](#get_block_header_by_hash) above, this method includes a block's height as an input parameter to retrieve basic information about the block. + +Alias: *getblockheaderbyheight*. + +Inputs: + +* *height* - unsigned int; The block's height. + +Outputs: + +* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example): + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "block_header": { + "block_size": 210, + "depth": 649721, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "num_txes": 0, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "status": "OK", + "untrusted": false + } +} +``` + +### **get_block_headers_range** + +Similar to [get_block_header_by_height](#get_block_header_by_height) above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks. + +Alias: *getblockheadersrange*. + +Inputs: + +* *start_height* - unsigned int; The starting block's height. +* *end_height* - unsigned int; The ending block's height. + +Outputs: + +* *headers* - array of `block_header` (a structure containing block header information. See [get_last_block_header](#get_last_block_header)). +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time): + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_headers_range","params":{"start_height":1545999,"end_height":1546000}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "headers": [{ + "block_size": 301413, + "depth": 16085, + "difficulty": 134636057921, + "hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", + "height": 1545999, + "major_version": 6, + "minor_version": 6, + "nonce": 3246403956, + "num_txes": 20, + "orphan_status": false, + "prev_hash": "0ef6e948f77b8f8806621003f5de24b1bcbea150bc0e376835aea099674a5db5", + "reward": 5025593029981, + "timestamp": 1523002893 + },{ + "block_size": 13322, + "depth": 16084, + "difficulty": 134716086238, + "hash": "b408bf4cfcd7de13e7e370c84b8314c85b24f0ba4093ca1d6eeb30b35e34e91a", + "height": 1546000, + "major_version": 7, + "minor_version": 7, + "nonce": 3737164176, + "num_txes": 1, + "orphan_status": false, + "prev_hash": "86d1d20a40cefcf3dd410ff6967e0491613b77bf73ea8f1bf2e335cf9cf7d57a", + "reward": 4851952181070, + "timestamp": 1523002931 + }], + "status": "OK", + "untrusted": false + } +} +``` + + +### **get_block** + +Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters. + +Alias: *getblock*. + +Inputs (pick one of the following): + +* *height* - unsigned int; The block's height. +* *hash* - string; The block's hash. + +Outputs: + +* *blob* - string; Hexadecimal blob of block information. +* *block_header* - A structure containing block header information. See [get_last_block_header](#get_last_block_header). +* *json* - json string; JSON formatted block details: + * *major_version* - Same as in block header. + * *minor_version* - Same as in block header. + * *timestamp* - Same as in block header. + * *prev_id* - Same as `prev_hash` in block header. + * *nonce* - Same as in block header. + * *miner_tx* - Miner transaction information + * *version* - Transaction version number. + * *unlock_time* - The block height when the coinbase transaction becomes spendable. + * *vin* - List of transaction inputs: + * *gen* - Miner txs are coinbase txs, or "gen". + * *height* - This block height, a.k.a. when the coinbase is generated. + * *vout* - List of transaction outputs. Each output contains: + * *amount* - The amount of the output, in @atomic-units. + * *target* - + * *key* - + * *extra* - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string. + * *signatures* - Contain signatures of tx signers. Coinbased txs do not have signatures. + * *tx_hashes* - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +**Look up by height:** + +In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions): + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":912345}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "blob": "0102f4bedfb405b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff786e0600000195d83701ffd9d73704ee84ddb42102378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c5767700880c0fc82aa020273733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f280f092cbdd080247a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c80e08d84ddcb01021f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d2b01fd0a778957f4f3103a838afda488c3cdadf2697b3d34ad71234282b2fad9100e02080000000bdfc2c16c00", + "block_header": { + "block_size": 210, + "depth": 649772, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "num_txes": 0, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1452793716, \n \"prev_id\": \"b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78\", \n \"nonce\": 1646, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 912405, \n \"vin\": [ {\n \"gen\": {\n \"height\": 912345\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 8968946286, \n \"target\": {\n \"key\": \"378b043c1724c92c69d923d266fe86477d3a5ddd21145062e148c64c57677008\"\n }\n }, {\n \"amount\": 80000000000, \n \"target\": {\n \"key\": \"73733cbd6e6218bda671596462a4b062f95cfe5e1dbb5b990dacb30e827d02f2\"\n }\n }, {\n \"amount\": 300000000000, \n \"target\": {\n \"key\": \"47a5dab669770da69a860acde21616a119818e1a489bb3c4b1b6b3c50547bc0c\"\n }\n }, {\n \"amount\": 7000000000000, \n \"target\": {\n \"key\": \"1f7e4762b8b755e3e3c72b8610cc87b9bc25d1f0a87c0c816ebb952e4f8aff3d\"\n }\n }\n ], \n \"extra\": [ 1, 253, 10, 119, 137, 87, 244, 243, 16, 58, 131, 138, 253, 164, 136, 195, 205, 173, 242, 105, 123, 61, 52, 173, 113, 35, 66, 130, 178, 250, 217, 16, 14, 2, 8, 0, 0, 0, 11, 223, 194, 193, 108\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ ]\n}", + "miner_tx_hash": "c7da3965f25c19b8eb7dd8db48dcd4e7c885e2491db77e289f0609bf8e08ec30", + "status": "OK", + "untrusted": false + } +} +``` + +**Look up by hash:** + +In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"hash":"510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f"}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "blob": "0102a3978cb7050ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6df407000001dcce3c01ffa0ce3c049da8bece070259e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a80d88ee16f024c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f080d0b8e1981a0213dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a351580c0f9decfae010262bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c2b01b691851cf057b9c302a3dbca879e1cba4cc45061ca55aaa6e03cdc67ab9e455002080000000c617fdf160379c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899bb197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d", + "block_header": { + "block_size": 3981, + "depth": 569068, + "difficulty": 964985344, + "hash": "510ee3c4e14330a7b96e883c323a60ebd1b5556ac1262d0bc03c24a3b785516f", + "height": 993056, + "major_version": 1, + "minor_version": 2, + "nonce": 2036, + "num_txes": 3, + "orphan_status": false, + "prev_hash": "0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d", + "reward": 6932043647005, + "timestamp": 1457720227 + }, + "json": "{\n \"major_version\": 1, \n \"minor_version\": 2, \n \"timestamp\": 1457720227, \n \"prev_id\": \"0ea4af6547c05c965afc8df6d31509ff3105dc7ae6b10172521d77e09711fd6d\", \n \"nonce\": 2036, \n \"miner_tx\": {\n \"version\": 1, \n \"unlock_time\": 993116, \n \"vin\": [ {\n \"gen\": {\n \"height\": 993056\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 2043647005, \n \"target\": {\n \"key\": \"59e9d685b3484886bc7b47c133e6099ecdf212d5eaa16ce19cd58e8c3c1e590a\"\n }\n }, {\n \"amount\": 30000000000, \n \"target\": {\n \"key\": \"4c5e2f542d25513c46b9e3b7d40140a22d0ae5314bfcae492ad9f56fff8185f0\"\n }\n }, {\n \"amount\": 900000000000, \n \"target\": {\n \"key\": \"13dd8ffdac9e6a2f71e327dad65328198dc879a492d145eae72677c0703a3515\"\n }\n }, {\n \"amount\": 6000000000000, \n \"target\": {\n \"key\": \"62bda00341681dccbc066757862da593734395745bdfe1fdc89b5948c86a5d4c\"\n }\n }\n ], \n \"extra\": [ 1, 182, 145, 133, 28, 240, 87, 185, 195, 2, 163, 219, 202, 135, 158, 28, 186, 76, 196, 80, 97, 202, 85, 170, 166, 224, 60, 220, 103, 171, 158, 69, 80, 2, 8, 0, 0, 0, 12, 97, 127, 223, 22\n ], \n \"signatures\": [ ]\n }, \n \"tx_hashes\": [ \"79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07\", \"d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b\", \"b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d\"\n ]\n}", + "miner_tx_hash": "372395aeac5e5ad2c40b4c546b0bad00c4242fb2bd88e2e25f4e43231876f81e", + "status": "OK", + "tx_hashes": ["79c6b9f00db027bde151705aafe85c495883aae2597d5cb8e1adb2e0f3ae1d07","d715db73331abc3ec588ef07c7bb195786a4724b08dff431b51ffa32a4ce899b","b197066426c0ed89f0b431fe171f7fd62bc95dd29943daa7cf3585cf1fdfc99d"], + "untrusted": false + } +} +``` + + +### **get_connections** + +Retrieve information about incoming and outgoing connections to your node. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *connections* - List of all connections and their info: + * *address* - string; The peer's address, actually IPv4 & port + * *avg_download* - unsigned int; Average bytes of data downloaded by node. + * *avg_upload* - unsigned int; Average bytes of data uploaded by node. + * *connection_id* - string; The connection ID + * *current_download* - unsigned int; Current bytes downloaded by node. + * *current_upload* - unsigned int; Current bytes uploaded by node. + * *height*- unsigned int; The peer height + * *host* - string; The peer host + * *incoming* - boolean; Is the node getting information from your node? + * *ip* - string; The node's IP address. + * *live_time* - unsigned int + * *local_ip* - boolean + * *localhost* - boolean + * *peer_id* - string; The node's ID on the network. + * *port* - string; The port that the node is using to connect to the network. + * *recv_count* - unsigned int + * *recv_idle_time* - unsigned int + * *send_count* - unsigned int + * *send_idle_time* - unsigned int + * *state* - string + * *support_flags* - unsigned int + +Following is an example of `get_connections` and it's return: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_connections"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "connections": [{ + "address": "173.90.69.136:62950", + "avg_download": 0, + "avg_upload": 2, + "connection_id": "083c301a3030329a487adb12ad981d2c", + "current_download": 0, + "current_upload": 2, + "height": 1562127, + "host": "173.90.69.136", + "incoming": true, + "ip": "173.90.69.136", + "live_time": 8, + "local_ip": false, + "localhost": false, + "peer_id": "c959fbfbed9e44fb", + "port": "62950", + "recv_count": 259, + "recv_idle_time": 8, + "send_count": 24342, + "send_idle_time": 8, + "state": "state_normal", + "support_flags": 0 + },{ + ... + }], + "status": "OK" + } +} +``` + + +### **get_info** + +Retrieve general information about the state of your node and the network. + +Alias: + +* */get_info* +* */getinfo* + +See other RPC Methods [/get_info (not JSON)](#get_info-not-json) + +Inputs: *None*. + +Outputs: + +* *alt_blocks_count* - unsigned int; Number of alternative blocks to main chain. +* *block_size_limit* - unsigned int; Maximum allowed block size +* *block_size_median* - unsigned int; Median block size of latest 100 blocks +* *bootstrap_daemon_address* - string; @Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy). +* *cumulative_difficulty* - unsigned int; Cumulative difficulty of all blocks in the blockchain. +* *difficulty* - unsigned int; Network difficulty (analogous to the strength of the network) +* *free_space* - unsigned int; Available disk space on the node. +* *grey_peerlist_size* - unsigned int; Grey Peerlist Size +* *height* - unsigned int; Current length of longest chain known to daemon. +* *height_without_bootstrap* - unsigned int; Current length of the local chain of the daemon. +* *incoming_connections_count* - unsigned int; Number of peers connected to and pulling from your node. +* *mainnet* - boolean; States if the node is on the mainnet (`true`) or not (`false`). +* *offline* - boolean; States if the node is offline (`true`) or online (`false`). +* *outgoing_connections_count* - unsigned int; Number of peers that you are connected to and getting information from. +* *rpc_connections_count* - unsigned int; Number of RPC client connected to the daemon (Including this RPC request). +* *stagenet* - boolean; States if the node is on the stagenet (`true`) or not (`false`). +* *start_time* - unsigned int; Start time of the daemon, as UNIX time. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *target* - unsigned int; Current target for next proof of work. +* *target_height* - unsigned int; The height of the next block in the chain. +* *testnet* - boolean; States if the node is on the testnet (`true`) or not (`false`). +* *top_block_hash* - string; Hash of the highest block in the chain. +* *tx_count* - unsigned int; Total number of non-coinbase transaction in the chain. +* *tx_pool_size* - unsigned int; Number of transactions that have been broadcast but not included in a block. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). +* *was_bootstrap_ever_used* - boolean; States if a bootstrap node has ever been used since the daemon started. +* *white_peerlist_size* - unsigned int; White Peerlist Size + +Following is an example `get_info` call and its return: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "alt_blocks_count": 6, + "block_size_limit": 600000, + "block_size_median": 129017, + "bootstrap_daemon_address": "", + "cumulative_difficulty": 14121125493385685, + "difficulty": 60580751777, + "free_space": 138758750208, + "grey_peerlist_size": 4998, + "height": 1562168, + "height_without_bootstrap": 1562168, + "incoming_connections_count": 2, + "mainnet": true, + "offline": false, + "outgoing_connections_count": 8, + "rpc_connections_count": 2, + "stagenet": false, + "start_time": 1524751757, + "status": "OK", + "target": 120, + "target_height": 1562063, + "testnet": false, + "top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592", + "tx_count": 2759894, + "tx_pool_size": 755, + "untrusted": false, + "was_bootstrap_ever_used": false, + "white_peerlist_size": 1000 + } +} +``` + + +### **hard_fork_info** + +Look up information regarding hard fork voting and readiness. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *earliest_height* - unsigned int; Block height at which hard fork would be enabled if voted in. +* *enabled* - boolean; Tells if hard fork is enforced. +* *state* - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good). +* *status* - string; General RPC error code. "OK" means everything looks good. +* *threshold* - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80. +* *version* - unsigned int; The major block version for the fork. +* *votes* - unsigned int; Number of votes towards hard fork. +* *voting* - unsigned int; Hard fork voting status. +* *window* - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"hard_fork_info"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "earliest_height": 1009827, + "enabled": false, + "state": 2, + "status": "OK", + "threshold": 0, + "version": 1, + "votes": 7277, + "voting": 2, + "window": 10080 + } +} +``` + + +### **set_bans** + +Ban another node by IP. + +Alias: *None*. + +Inputs: + +* *bans* - A list of nodes to ban: + * *host* - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future). + * *ip* - unsigned int; IP address to ban, in Int format. + * *ban* - boolean; Set `true` to ban. + * *seconds* - unsigned int; Number of seconds to ban node. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Examples: + +**banning by host** + +In the following example, host is banned with its IP address string-formatted as A.B.C.D: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"host":"192.168.1.51","ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "status": "OK" + } +} +``` + +**banning by ip** + +In the following example, integer-formatted IP is banned: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_bans","params":{"bans":[{"ip":838969536,"ban":true,"seconds":30}]}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "status": "OK" + } +} +``` + + +### **get_bans** + +Get list of banned IPs. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *bans* - List of banned nodes: + * *host* - string; Banned host (IP in A.B.C.D form). + * *ip* - unsigned int; Banned IP address, in Int format. + * *seconds* - unsigned int; Local Unix time that IP is banned until. +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bans"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "bans": [{ + "host": "102.168.1.51", + "ip": 855746662, + "seconds": 22 + },{ + "host": "192.168.1.50", + "ip": 838969536, + "seconds": 28 + }], + "status": "OK" + } +} +``` + + +### **flush_txpool** + +Flush tx ids from transaction pool + +Alias: *None*. + +Inputs: + +* *txids* - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty). + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"flush_txpool","params":{"txids":["dc16fa8eaffe1484ca9014ea050e13131d3acf23b419f33bb4cc0b32b6c49308",""]}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "status": "OK" + } +} +``` + +### **get_output_histogram** + +Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. +RingCT outputs counts as 0 amount. + +Inputs: + +* *amounts* - list of unsigned int +* *min_count* - unsigned int +* *max_count* - unsigned int +* *unlocked* - boolean +* *recent_cutoff* - unsigned int + +Outputs: + +* *histogram* - list of histogram entries, in the following structure: + * *amount* - unsigned int; Output amount in @atomic-units + * *total_instances* - unsigned int; + * *unlocked_instances* - unsigned int; + * *recent_instances* - unsigned int; +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_histogram","params":{"amounts":[20000000000]}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "histogram": [{ + "amount": 20000000000, + "recent_instances": 0, + "total_instances": 381458, + "unlocked_instances": 0 + }], + "status": "OK", + "untrusted": false + } +} +``` + + +### **get_coinbase_tx_sum** + +Get the coinbase amount and the fees amount for n last blocks starting at particular height + +Alias: *None*. + +Inputs: + +* *height* - unsigned int; Block height from which getting the amounts +* *count* - unsigned int; number of blocks to include in the sum + +Outputs: + +* *emission_amount* - unsigned int; amount of coinbase reward in @atomic-units +* *fee_amount* - unsigned int; amount of fees in @atomic-units +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_coinbase_tx_sum","params":{"height":1563078,"count":2}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "emission_amount": 9387854817320, + "fee_amount": 83981380000, + "status": "OK" + } +} +``` + + +### **get_version** + +Give the node current version + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). +* *version* - unsigned int; + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "status": "OK", + "untrusted": false, + "version": 65555 + } +} +``` + + +### **get_fee_estimate** + +Gives an estimation on fees per byte. + +Alias: *None*. + +Inputs: + +* *grace_blocks* - unsigned int; Optional + +Outputs: + +* *fee* - unsigned int; Amount of fees estimated per byte in @atomic-units +* *quantization_mask* - unsigned int; Final fee should be rounded up to an even multiple of this value +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_fee_estimate"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "fee": 187610000, + "status": "OK", + "untrusted": false + } +} +``` + + +### **get_alternate_chains** + +Display alternative chains seen by the node. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *chains* - array of chains, the following structure: + * *block_hash* - string; the block hash of the first diverging block of this alternative chain. + * *difficulty* - unsigned int; the cumulative difficulty of all blocks in the alternative chain. + * *height* - unsigned int; the block height of the first diverging block of this alternative chain. + * *length* - unsigned int; the length in blocks of this alternative chain, after divergence. +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_alternate_chains"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "chains": [{ + "block_hash": "697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625", + "difficulty": 14114729638300280, + "height": 1562062, + "length": 2 + }], + "status": "OK" + } +} +``` + + +### **relay_tx** + +Relay a list of transaction IDs. + +Alias: *None*. + +Inputs: + +* *txids* - array of string; list of transaction IDs to relay + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"txids":["9fd75c429cbe52da9a52f2ffc5fbd107fe7fd2099c0d8de274dc8a67e0c98613"]}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "status": "OK" + } +} +``` + + +### **sync_info** + +Get synchronisation informations + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *height* - unsigned int; +* *peers* - array of peer structure, defined as follows: + * *info* - structure of connection info, as defined in [get_connections](#get_connections) +* *spans* - array of span structure, defined as follows (optional, absent if node is fully synced): + * *connection_id* - string; Id of connection + * *nblocks* - unsigned int; number of blocks in that span + * *rate* - unsigned int; connection rate + * *remote_address* - string; peer address the node is downloading (or has downloaded) than span from + * *size* - unsigned int; total number of bytes in that span's blocks (including txes) + * *speed* - unsigned int; connection speed + * *start_block_height* - unsigned int; block height of the first block in that span +* *status* - string; General RPC error code. "OK" means everything looks good. +* *target_height* - unsigned int; target height the node is syncing from (optional, absent if node is fully synced) + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sync_info"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "height": 1563543, + "peers": [{ + "info": { + "address": "70.109.53.128:60064", + "avg_download": 0, + "avg_upload": 5, + "connection_id": "204067223b9b3415c265dd25ad29ee48", + "current_download": 0, + "current_upload": 1, + "height": 1559975, + "host": "70.109.53.128", + "incoming": true, + "ip": "70.109.53.128", + "live_time": 38, + "local_ip": false, + "localhost": false, + "peer_id": "96b8545dbc7a8866", + "port": "60064", + "recv_count": 1580, + "recv_idle_time": 28, + "send_count": 203603, + "send_idle_time": 8, + "state": "state_normal", + "support_flags": 1 + } + },{ + "info": { + ... + } + },{ + ... + },{ + ... + },{ + ... + }], + "status": "OK", + "target_height": 1564067 + } +} +``` + + +### **get_txpool_backlog** + +Get all transaction pool backlog + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *backlog*: array of structures *tx_backlog_entry* (in binary form): + * *blob_size* - unsigned int (in binary form) + * *fee* - unsigned int (in binary form) + * *time_in_pool* - unsigned int (in binary form) +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_txpool_backlog"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "backlog": "...Binary...", + "status": "OK", + "untrusted": false + } +} +``` + + +### **get_output_distribution** + + + +Alias: *None*. + +Inputs: + +* *amounts* - array of unsigned int; amounts to look for +* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`) +* *from_height* - unsigned int; (optional, default is 0) starting height to check from +* *to_height* - unsigned int; (optional, default is 0) ending height to check up to + +Outputs: + +* *distributions* - array of structure distribution as follows: + * *amount* - unsigned int + * *base* - unsigned int + * *distribution* - array of unsigned int + * *start_height* - unsigned int +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_output_distribution","params":{"amounts":[628780000],"from_height":1462078}}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "distributions": [{ + "amount": 2628780000, + "base": 0, + "distribution": "", + "start_height": 1462078 + }], + "status": "OK" + } +} +``` + + +--- + +## Other Daemon RPC Calls + +Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls. + +The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the `/json_rpc` extension and specifying a method, these methods are called at their own extensions. For example: + + IP=127.0.0.1 + PORT=18081 + METHOD='gettransactions' + PARAMS='{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' + curl \ + -X POST http://$IP:$PORT/$METHOD \ + -d $PARAMS \ + -H 'Content-Type: application/json' + +Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods [get_info](#getinfo) or [get_last_block_header](#get_last_block_header), rather than [getheight](#getheight) below. + +For calls that end with **.bin**, the data is exchanged in the form of binary, serialized objects, as defined in the [Core RPC Server](https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server_commands_defs.h). + + +### **/get_height** + +Get the node's current height. + +Alias: */getheight*. + +Inputs: *None*. + +Outputs: + +* *height* - unsigned int; Current length of longest chain known to daemon. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +``` +$ curl -X POST http://127.0.0.1:18081/get_height -H 'Content-Type: application/json' + +{ + "height": 1564055, + "status": "OK", + "untrusted": false +} +``` + + + +### **/get_blocks.bin** + +Get all blocks info. Binary request. + +Alias: */getblocks.bin*. + +Inputs: + +* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block +* *start_height* - unsigned int +* *prune* - boolean + +Outputs: + +* *blocks* - array of block complete entries +* *current_height* - unsigned int +* *output_indices* - structure as follows: + * *indices* - array of tx output indices, structure as follows: + * *indices* - array of unsigned int +* *start_height* - unsigned int +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + + +### **/get_blocks_by_height.bin** + +Get blocks by height. Binary request. + +Alias: */getblocks_by_height.bin*. + +Inputs: + +* *heights* - array of unsigned int; list of block heights + +Outputs: + +* *blocks* - array of block complete entries +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + + + +### **/get_hashes.bin** + +Get hashes. Binary request. + +Alias: */gethashes.bin*. + +Inputs: + +* *block_ids* - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block +* *start_height* - unsigned int + +Outputs: + +* *current_height* - unsigned int +* *m_block_ids* - binary array of hashes; see *block_ids* above. +* *start_height* - unsigned int +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + + + +### **/get_o_indexes.bin** + +Get global outputs of transactions. Binary request. + +Alias: *None*. + +Inputs: + +* *txid* - binary txid + +Outputs: + +* *o_indexes* - array of unsigned int; List of output indexes +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + + + +### **/get_outs.bin** + +Get outputs. Binary request. + +Alias: *None*. + +Inputs: + +* *outputs* - array of structure *get_outputs_out* as follows: + * *amount* - unsigned int; + * *index* - unsigned int; + +Outputs: + +* *outs* - array of structure *outkey* as follows: + * *amount* - unsigned int; + * *height* - unsigned int; block height of the output + * *key* - the public key of the output + * *mask* + * *txid* - transaction id + * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + + + +### **/get_transactions** + +Look up one or more transactions by hash. + +Alias: */gettransactions*. + +Inputs: + +* *txs_hashes* - string list; List of transaction hashes to look up. +* *decode_as_json* - boolean; Optional (`false` by default). If set `true`, the returned transaction information will be decoded rather than binary. +* *prune* - boolean; Optional (`false` by default). + +Outputs: + +* *missed_tx* - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found. +* *status* - General RPC error code. "OK" means everything looks good. +* *txs* - array of structure *entry* as follows: + * *as_hex* - string; Full transaction information as a hex string. + * *as_json* - json string; List of transaction info: + * *version* - Transaction version + * *unlock_time* - If not 0, this tells when a transaction output is spendable. + * *vin* - List of inputs into transaction: + * *key* - The public key of the previous output spent in this transaction. + * *amount* - The amount of the input, in @atomic-units. + * *key_offsets* - A list of integer offets to the input. + * *k_image* - The key image for the given input + * *vout* - List of outputs from transaction: + * *amount* - Amount of transaction output, in @atomic-units. + * *target* - Output destination information: + * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. + * *extra* - Usually called the "payment ID" but can be used to include any random 32 bytes. + * *signatures* - List of signatures used in ring signature to hide the true origin of the transaction. + * *block_height* - unsigned int; block height including the transaction + * *block_timestamp* - unsigned int; Unix time at chich the block has been added to the blockchain + * *double_spend_seen* - boolean; States if the transaction is a double-spend (`true`) or not (`false`) + * *in_pool* - boolean; States if the transaction is in pool (`true`) or included in a block (`false`) + * *output_indices* - array of unsigned int; transaction indexes + * *tx_hash* - string; transaction hash +* *txs_as_hex* - string; Full transaction information as a hex string (old compatibility parameter) +* *txs_as_json* - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in *as_json* above: + +Example 1: Return transaction information in binary format. + +``` +$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"]}' -H 'Content-Type: application/json' + +{ + "status": "OK", + "txs": [{ + "as_hex": "...", + "as_json": "", + "block_height": 993442, + "block_timestamp": 1457749396, + "double_spend_seen": false, + "in_pool": false, + "output_indices": [198769,418598,176616,50345,509], + "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" + }], + "txs_as_hex": ["..."], + "untrusted": false +} +``` + +Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations. + +``` +$ curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408"],"decode_as_json":true}' -H 'Content-Type: application/json' + +{ + "status": "OK", + "txs": [{ + "as_hex": "...", + "as_json": "{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}", + "block_height": 993442, + "block_timestamp": 1457749396, + "double_spend_seen": false, + "in_pool": false, + "output_indices": [198769,418598,176616,50345,509], + "tx_hash": "d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090408" + }], + "txs_as_hex": ["..."], + "txs_as_json": ["{\n \"version\": 1, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 9999999999, \n \"key_offsets\": [ 691\n ], \n \"k_image\": \"6ebee1b651a8da723462b4891d471b990ddc226049a0866d3029b8e2f75b7012\"\n }\n }, {\n \"key\": {\n \"amount\": 9000000000000, \n \"key_offsets\": [ 175760\n ], \n \"k_image\": \"200bd02b70ee707441a8863c5279b4e4d9f376dc97a140b1e5bc7d72bc508069\"\n }\n }, ... \n ], \n \"vout\": [ {\n \"amount\": 60000000000, \n \"target\": {\n \"key\": \"8c792dea94dab48160e067fb681edd6247ba375281fbcfedc03cb970f3b98e2d\"\n }\n }, {\n \"amount\": 700000000000, \n \"target\": {\n \"key\": \"1ab33e69737e157d23e33274c42793be06a8711670e73fa10ecebc604f87cc71\"\n }\n }, ... \n ], \n \"extra\": [ 1, 3, 140, 109, 156, 205, 47, 148, 153, 9, 17, 93, 83, 33, 162, 110, 152, 1, 139, 70, 121, 19, 138, 10, 44, 6, 55, 140, 242, 124, 143, 219, 172\n ], \n \"signatures\": [ \"fd82214a59c99d9251fa00126d353f9cf502a80d8993a6c223e3c802a40ab405555637f495903d3ba558312881e586d452e6e95826d8e128345f6c0a8f9f350e\", \"8c04ef50cf34afa3a9ec19c457143496f8cf7045ed869b581f9efa2f1d65e30f1cec5272b00e9c61a34bdd3c78cf82ae8ef4df3132f70861391069b9c255cd08\", ... ]\n}"], + "untrusted": false +} +``` + +Example 3: Returned a missed (unexisting) transaction. + +``` +curl -X POST http://127.0.0.1:18081/get_transactions -d '{"txs_hashes":["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"]}' -H 'Content-Type: application/json' + +{ + "missed_tx": ["d6e48158472848e6687173a91ae6eebfa3e1d778e65252ee99d7515d63090409"], + "status": "OK", + "untrusted": false +} +``` + + +### **/get_alt_blocks_hashes** + +Get the known blocks hashes which are not on the main chain. + +Alias: *None*. + +Inputs: *None* + +Outputs: + +* *blks_hashes* - array of strings; list of alternative blocks hashes to main chain +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/get_alt_blocks_hashes -H 'Content-Type: application/json' + +{ + "blks_hashes": ["9c2277c5470234be8b32382cdf8094a103aba4fcd5e875a6fc159dc2ec00e011","637c0e0f0558e284493f38a5fcca3615db59458d90d3a5eff0a18ff59b83f46f","6f3adc174a2e8082819ebb965c96a095e3e8b63929ad9be2d705ad9c086a6b1c","697cf03c89a9b118f7bdf11b1b3a6a028d7b3617d2d0ed91322c5709acf75625","d99b3cf3ac6f17157ac7526782a3c3b9537f89d07e069f9ce7821d74bd9cad0e","e97b62109a6303233dcd697fa8545c9fcbc0bf8ed2268fede57ddfc36d8c939c","70ff822066a53ad64b04885c89bbe5ce3e537cdc1f7fa0dc55317986f01d1788","b0d36b209bd0d4442b55ea2f66b5c633f522401f921f5a85ea6f113fd2988866"], + "status": "OK", + "untrusted": false +} +``` + + +### **/is_key_image_spent** + +Check if outputs have been spent using the key image associated with the output. + +Alias: *None*. + +Inputs: + +* *key_images* - string list; List of key image hex strings to check. + +Outputs: + +* *spent_status* - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/is_key_image_spent -d '{"key_images":["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3","7319134bfc50668251f5b899c66b005805ee255c136f0e1cecbb0f3a912e09d4"]}' -H 'Content-Type: application/json' + +{ + "spent_status": [1,2], + "status": "OK" + "untrusted": false +} +``` + + +### **/send_raw_transaction** + +Broadcast a raw transaction to the network. + +Alias: */sendrawtransaction*. + +Inputs: + +* *tx_as_hex* - string; Full transaction information as hexidecimal string. +* *do_not_relay* - boolean; Stop relaying transaction to other nodes (default is `false`). + +Outputs: + +* *double_spend* - boolean; Transaction is a double spend (`true`) or not (`false`). +* *fee_too_low* - boolean; Fee is too low (`true`) or OK (`false`). +* *invalid_input* - boolean; Input is invalid (`true`) or valid (`false`). +* *invalid_output* - boolean; Output is invalid (`true`) or valid (`false`). +* *low_mixin* - boolean; Mixin count is too low (`true`) or OK (`false`). +* *not_rct* - boolean; Transaction is a standard ring transaction (`true`) or a ring confidential transaction (`false`). +* *not_relayed* - boolean; Transaction was not relayed (`true`) or relayed (`false`). +* *overspend* - boolean; Transaction uses more money than available (`true`) or not (`false`). +* *reason* - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed. +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. +* *too_big* - boolean; Transaction size is too big (`true`) or OK (`false`). +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + +Example (No return information included here.): + + +``` +$ curl -X POST http://127.0.0.1:18081/send_raw_transaction -d '{"tx_as_hex":"de6a3...", "do_not_relay":false}' -H 'Content-Type: application/json' +``` + + +### **/start_mining** + +Start mining on the daemon. + +Alias: *None*. + +Inputs: + +* *do_background_mining* - boolean; States if the mining should run in background (`true`) or foreground (`false`). +* *ignore_battery* - boolean; States if batery state (on laptop) should be ignored (`true`) or not (`false`). +* *miner_address* - string; Account address to mine to. +* *threads_count* - unsigned int; Number of mining thread to run. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/start_mining -d '{"do_background_mining":false,"ignore_battery":true,"miner_address":"47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc","threads_count":1}' -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/stop_mining** + +Stop mining on the daemon. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/stop_mining -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/mining_status** + +Get the mining status of the daemon. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *active* - boolean; States if mining is enabled (`true`) or disabled (`false`). +* *address* - string; Account address daemon is mining to. Empty if not mining. +* *is_background_mining_enabled* - boolean; States if the mining is running in background (`true`) or foreground (`false`). +* *speed* - unsigned int; Mining power in hashes per seconds. +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. +* *threads_count* - unsigned int; Number of running mining threads. + +Example while mining: + +``` +$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' + +{ + "active": true, + "address": "47xu3gQpF569au9C2ajo5SSMrWji6xnoE5vhr94EzFRaKAGw6hEGFXYAwVADKuRpzsjiU1PtmaVgcjUJF89ghGPhUXkndHc", + "is_background_mining_enabled": false, + "speed": 20, + "status": "OK", + "threads_count": 1 +} +``` + +Example while not mining: + +``` +$ curl -X POST http://127.0.0.1:18081/mining_status -H 'Content-Type: application/json' + +{ + "active": false, + "address": "", + "is_background_mining_enabled": false, + "speed": 0, + "status": "OK", + "threads_count": 0 +} +``` + + +### **/save_bc** + +Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/save_bc -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/get_peer_list** + +Get the known peers list. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *gray_list* - array of offline *peer* structure as follows: + * *host* - unsigned int; IP address in integer format + * *id* - string; Peer id + * *ip* - unsigned int; IP address in integer format + * *last_seen* - unsigned int; unix time at which the peer has been seen for the last time + * *port* - unsigned int; TCP port the peer is using to connect to monero network. +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. +* *white_list* - array of online *peer* structure, as above. + +Example (truncated lists): + +``` +$ curl -X POST http://127.0.0.1:18081/get_peer_list -H 'Content-Type: application/json' + +{ + "gray_list": [{ + "host": "640304833", + "id": 5345237316225602120, + "ip": 640304833, + "last_seen": 1525540510, + "port": 18080 + },{ + "host": "2183731038", + "id": 14955030573998424430, + "ip": 2183731038, + "last_seen": 1525540499, + "port": 28080 + }, ... + ], + "status": "OK", + "white_list": [{ + "host": "1221637955", + "id": 10354694710033118926, + "ip": 1221637955, + "last_seen": 1525540511, + "port": 18080 + },{ + "host": "1780407354", + "id": 17193661050352240890, + "ip": 1780407354, + "last_seen": 1525540510, + "port": 18080 + }, ... + ] +} +``` + + +### **/set_log_hash_rate** + +Set the log hash rate display mode. + +Alias: *None*. + +Inputs: + +* *visible* - boolean; States if hash rate logs should be visible (`true`) or hidden (`false`) + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. + +Example while mining: + +``` +$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + +Error while not mining: + +``` +$ curl -X POST http://127.0.0.1:18081/set_log_hash_rate -d '{"visible":true}' -H 'Content-Type: application/json' + +{ + "status": "NOT MINING" +} +``` + + +### **/set_log_level** + +Set the daemon log level. +By default, log level is set to `0`. + +Alias: *None*. + +Inputs: + +* *level* - integer; daemon log level to set from `0` (less verbose) to `4` (most verbose) + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/set_log_level -d '{"level":1}' -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/set_log_categories** + +Set the daemon log categories. +Categories are represented as a comma separated list of `:` (similarly to syslog standard `:`), where: +* *Category* is one of the following: + * *\** - All facilities + * *default* + * *net* + * *net.http* + * *net.p2p* + * *logging* + * *net.throttle* + * *blockchain.db* + * *blockchain.db.lmdb* + * *bcutil* + * *checkpoints* + * *net.dns* + * *net.dl* + * *i18n* + * *perf* + * *stacktrace* + * *updates* + * *account* + * *cn* + * *difficulty* + * *hardfork* + * *miner* + * *blockchain* + * *txpool* + * *cn.block_queue* + * *net.cn* + * *daemon* + * *debugtools.deserialize* + * *debugtools.objectsizes* + * *device.ledger* + * *wallet.gen_multisig* + * *multisig* + * *bulletproofs* + * *ringct* + * *daemon.rpc* + * *wallet.simplewallet* + * *WalletAPI* + * *wallet.ringdb* + * *wallet.wallet2* + * *wallet.rpc* + * *tests.core* +* *Level* is one of the following: + * *FATAL* - higher level + * *ERROR* + * *WARNING* + * *INFO* + * *DEBUG* + * *TRACE* - lower level +A level automatically includes higher level. +By default, categories are set to `*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO`. +Setting the categories to "" prevent any logs to be outputed. + +Alias: *None*. + +Inputs: + +* *categories* - string; Optional, daemon log categories to enable + +Outputs: + +* *categories* - string; daemon log enabled categories +* *status* - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong. + +Example to set all facilities to Security Level `Info`: + +``` +$ curl -X POST http://127.0.0.1:18081/set_log_categories -d '{"categories": "*:INFO"}' -H 'Content-Type: application/json' + +{ + "categories": "*:INFO", + "status": "OK" +} +``` + +Example without input to set the default categories: + +``` +$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json' + +{ + "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO", + "status": "OK" +} +``` + + +### **/get_transaction_pool** + +Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *spent_key_images* - List of spent output key images: + * *id_hash* - string; Key image. + * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment: + * *blob_size* - unsigned int; The size of the full transaction blob. + * *double_spend_seen* - boolean; States if this transaction has been seen as double spend. + * *do_not_relay*; boolean; States if this transaction should not be relayed + * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units. + * *id_hash* - string; The transaction ID hash. + * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`). + * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured. + * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash. + * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed. + * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction. + * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction. + * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node. + * *relayed* - boolean; States if this transaction has been relayed + * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction. + * *tx_json* - json string; JSON structure of all information in the transaction: + * *version* - Transaction version + * *unlock_time* - If not 0, this tells when a transaction output is spendable. + * *vin* - List of inputs into transaction: + * *key* - The public key of the previous output spent in this transaction. + * *amount* - The amount of the input, in @atomic-units. + * *key_offsets* - A list of integer offets to the input. + * *k_image* - The key image for the given input + * *vout* - List of outputs from transaction: + * *amount* - Amount of transaction output, in @atomic-units. + * *target* - Output destination information: + * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output. + * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes. + * *rct_signatures* - Ring signatures: + * *type* + * *txnFee* + * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows: + * *mask* - String + * *amount* - String + * *outPk* + * *rctsig_prunable* + * *rangeSigs* - array of structures as follows: + * *asig* + * *Ci* + * *MGs* - array of structures as follows: + * *ss* - array of arrays of two strings. + * *cc* - String + +Example (Note: Some lists in the returned information have been truncated for display reasons): + +``` +$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json' + +{ + "spent_key_images": [{ + "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c", + "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"] + },{ + "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792", + "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"] + }, + ...], + "status": "OK", + "transactions": [{ + "blob_size": 13193, + "do_not_relay": false, + "double_spend_seen": false, + "fee": 9694360000, + "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f", + "kept_by_block": false, + "last_failed_height": 0, + "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000", + "last_relayed_time": 1525615049, + "max_used_block_height": 1564924, + "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7", + "receive_time": 1525615049, + "relayed": true, + "tx_blob": " ... ", + "tx_json": "{\n \"version\": 2, \n \"unlock_time\": 0, \n \"vin\": [ {\n \"key\": {\n \"amount\": 0, \n \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n ], \n \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 0, \n \"target\": {\n \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n }\n }, {\n \"amount\": 0, \n \"target\": {\n \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n }\n }\n ], \n \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n ], \n \"rct_signatures\": {\n \"type\": 1, \n \"txnFee\": 9694360000, \n \"ecdhInfo\": [ {\n \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n }, {\n \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n }], \n \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n }, \n \"rctsig_prunable\": {\n \"rangeSigs\": [ {\n \"asig\": \" ... \", \n \"Ci\": \" .. \"\n }, {\n \"asig\": \" ... \", \n \"Ci\": \" ... \"\n }], \n \"MGs\": [ {\n \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"], + ...], \n \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n }]\n }\n}" + }, + ...] +} +``` + + +### **/get_transaction_pool_hashes.bin** + +Get hashes from transaction pool. Binary request. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. +* *tx_hashes* - binary array of transaction hashes. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json' + +{ + "status": "OK", + "tx_hashes": " ... ", + "untrusted": false +} +``` + + +### **/get_transaction_pool_stats** + +Get the transaction pool statistics. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *pool_stats* - Structure as follows: + * *bytes_max* - unsigned int; Max transaction size in pool + * *bytes_med* - unsigned int; Median transaction size in pool + * *bytes_min* - unsigned int; Min transaction size in pool + * *bytes_total* - unsigned int; total size of all transactions in pool + * *histo* - structure *txpool_histo* as follows: + * *txs* - unsigned int; number of transactions + * *bytes* - unsigned int; size in bytes. + * *histo_98pc* unsigned int; the time 98% of txes are "younger" than + * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes + * *num_double_spends* unsigned int; number of double spend transactions + * *num_failing* unsigned int; number of failing transactions + * *num_not_relayed* unsigned int; number of non-relayed transactions + * *oldest* unsigned int; unix time of the oldest transaction in the pool + * *txs_total* unsigned int; total number of transactions. +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json' + +{ + "pool_stats": { + "bytes_max": 47222, + "bytes_med": 13290, + "bytes_min": 13092, + "bytes_total": 449511, + "fee_total": 289715320000, + "histo": "\t▒'▒5▒4▒\/▒▒▒$3", + "histo_98pc": 0, + "num_10m": 18, + "num_double_spends": 1, + "num_failing": 17, + "num_not_relayed": 0, + "oldest": 1525457001, + "txs_total": 26 + }, + "status": "OK", + "untrusted": false +} +``` + + +### **/stop_daemon** + +Send a command to the daemon to safely disconnect and shut down. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/get_info (not JSON)** + +This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details. + +Alias: + +* */getinfo* +* *get_info* + + +### **/get_limit** + +Get daemon bandwidth limits. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *limit_down* - unsigned int; Download limit in kBytes per second +* *limit_up* - unsigned int; Upload limit in kBytes per second +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json' + +{ + "limit_down": 8192, + "limit_up": 128, + "status": "OK", + "untrusted": false +} +``` + + +### **/set_limit** + +Set daemon bandwidth limits. + +Alias: *None*. + +Inputs: + +* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit) +* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit) + +Outputs: + +* *limit_down* - unsigned int; Download limit in kBytes per second +* *limit_up* - unsigned int; Upload limit in kBytes per second +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json' + +{ + "limit_down": 1024, + "limit_up": 128, + "status": "OK" +} +``` + + +### **/out_peers** + +Limit number of Outgoing peers. + +Alias: *None*. + +Inputs: + +* *out_peers* - unsigned int; Max number of outgoing peers + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/in_peers** + +Limit number of Incoming peers. + +Alias: *None*. + +Inputs: + +* *in_peers* - unsigned int; Max number of incoming peers + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/start_save_graph** + +Obsolete. Conserved here for reference. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/stop_save_graph** + +Obsolete. Conserved here for reference. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *status* - string; General RPC error code. "OK" means everything looks good. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json' + +{ + "status": "OK" +} +``` + + +### **/get_outs** + +Get outputs. + +Alias: *None*. + +Inputs: + +* *outputs* array of *get_outputs_out* structure as follows: + * *amount* - unsigned int; + * *index* - unsigned int; + +Outputs: + +* *outs* - array of structure *outkey* as follows: + * *height* - unsigned int; block height of the output + * *key* - String; the public key of the output + * *mask* - String + * *txid* - String; transaction id + * *unlocked* - boolean; States if output is locked (`false`) or not (`true`) +* *status* - string; General RPC error code. "OK" means everything looks good. +* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`). + + +### **/update** + +Update daemon. + +Alias: *None*. + +Inputs: + +* *command* - String; command to use, either `check` or `download` +* *path* - String; Optional, path where to download the update. + +Outputs: + +* *auto_uri* - string; +* *hash* - string; +* *path* - String; path to download the update +* *status* - string; General RPC error code. "OK" means everything looks good. +* *update* - boolean; States if an update is available to download (`true`) or not (`false`) +* *user_uri* - string; +* *version* - string; Version available for download. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json' + +{ + "auto_uri": "", + "hash": "", + "path": "", + "status": "OK", + "update": false, + "user_uri": "", + "version": "" +} +``` + diff --git a/resources/developer-guides/index.md b/resources/developer-guides/index.md index ec6226ef..a47a720d 100644 --- a/resources/developer-guides/index.md +++ b/resources/developer-guides/index.md @@ -19,9 +19,9 @@ permalink: /resources/developer-guides/index.html

{% t developer-guides.outdated %}

-

{% t developer-guides.daemonrpc %}

+

{% t developer-guides.daemonrpc %}

{% t developer-guides.daemonrpc_descr %}

-

{% t developer-guides.walletrpc %}

+

{% t developer-guides.walletrpc %}

{% t developer-guides.walletrpc_descr %}

diff --git a/resources/developer-guides/wallet-rpc.md b/resources/developer-guides/wallet-rpc.md index 7c5cce08..2597b854 100644 --- a/resources/developer-guides/wallet-rpc.md +++ b/resources/developer-guides/wallet-rpc.md @@ -1,12 +1,2965 @@ --- layout: user-guide title: "Wallet RPC documentation" -permalink: /resources/developer-guides/wallet-rpc.html -mainVersion: - - "2" - - "2" - - "0" --- -{% t global.lang_tag %} -

{% t developer-guides.walletrpc %}

-{% tf resources/developer-guides/wallet-rpc.md %} + +# Wallet RPC + +## Introduction + +This is a list of the monero-wallet-rpc calls, their inputs and outputs, and examples of each. The program monero-wallet-rpc replaced the rpc interface that was in simplewallet and then monero-wallet-cli. + +All monero-wallet-rpc methods use the same JSON RPC interface. For example: + +``` +IP=127.0.0.1 +PORT=18082 +METHOD="make_integrated_address" +PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" +curl \ + -X POST http://$IP:$PORT/json_rpc \ + -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ + -H 'Content-Type: application/json' +``` + +If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: + +``` +IP=127.0.0.1 +PORT=18082 +METHOD="make_integrated_address" +PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" +curl \ + -u username:password --digest \ + -X POST http://$IP:$PORT/json_rpc \ + -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ + -H 'Content-Type: application/json' +``` + +Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** + +This list has been updated on a frozen code on 2018-09-14 after merged commit bb30a7236725e456138f055f96a634c75ce2b491 (Wallet RPC version 1.3), and at block height 1643308. + +### Index of JSON RPC Methods: + +* [set_daemon](#set_daemon) +* [get_balance](#get_balance) +* [get_address](#get_address) +* [get_address_index](#get_address_index) +* [create_address](#create_address) +* [label_address](#label_address) +* [validate_address](#validate_address) +* [get_accounts](#get_accounts) +* [create_account](#create_account) +* [label_account](#label_account) +* [get_account_tags](#get_account_tags) +* [tag_accounts](#tag_accounts) +* [untag_accounts](#untag_accounts) +* [set_account_tag_description](#set_account_tag_description) +* [get_height](#get_height) +* [transfer](#transfer) +* [transfer_split](#transfer_split) +* [sign_transfer](#sign_transfer) +* [submit_transfer](#submit_transfer) +* [sweep_dust](#sweep_dust) +* [sweep_all](#sweep_all) +* [sweep_single](#sweep_single) +* [relay_tx](#relay_tx) +* [store](#store) +* [get_payments](#get_payments) +* [get_bulk_payments](#get_bulk_payments) +* [incoming_transfers](#incoming_transfers) +* [query_key](#query_key) +* [make_integrated_address](#make_integrated_address) +* [split_integrated_address](#split_integrated_address) +* [stop_wallet](#stop_wallet) +* [rescan_blockchain](#rescan_blockchain) +* [set_tx_notes](#set_tx_notes) +* [get_tx_notes](#get_tx_notes) +* [set_attribute](#set_attribute) +* [get_attribute](#get_attribute) +* [get_tx_key](#get_tx_key) +* [check_tx_key](#check_tx_key) +* [get_tx_proof](#get_tx_proof) +* [check_tx_proof](#check_tx_proof) +* [get_spend_proof](#get_spend_proof) +* [check_spend_proof](#check_spend_proof) +* [get_reserve_proof](#get_reserve_proof) +* [check_reserve_proof](#check_reserve_proof) +* [get_transfers](#get_transfers) +* [get_transfer_by_txid](#get_transfer_by_txid) +* [describe_transfer](#describe_transfer) +* [sign](#sign) +* [verify](#verify) +* [export_outputs](#export_outputs) +* [import_outputs](#import_outputs) +* [export_key_images](#export_key_images) +* [import_key_images](#import_key_images) +* [make_uri](#make_uri) +* [parse_uri](#parse_uri) +* [get_address_book](#get_address_book) +* [add_address_book](#add_address_book) +* [edit_address_book](#edit_address_book) +* [delete_address_book](#delete_address_book) +* [refresh](#refresh) +* [auto_refresh](#auto_refresh) +* [rescan_spent](#rescan_spent) +* [start_mining](#start_mining) +* [stop_mining](#stop_mining) +* [get_languages](#get_languages) +* [create_wallet](#create_wallet) +* [open_wallet](#open_wallet) +* [restore_deterministic_wallet](#restore_deterministic_wallet) +* [close_wallet](#close_wallet) +* [change_wallet_password](#change_wallet_password) +* [is_multisig](#is_multisig) +* [prepare_multisig](#prepare_multisig) +* [make_multisig](#make_multisig) +* [export_multisig_info](#export_multisig_info) +* [import_multisig_info](#import_multisig_info) +* [finalize_multisig](#finalize_multisig) +* [sign_multisig](#sign_multisig) +* [submit_multisig](#submit_multisig) +* [get_version](#get_version) + +--- + +## JSON RPC Methods: + +### **set_daemon** + +Connect the RPC server to a Monero daemon. + +Inputs: + +* *address* - string; (Optional; Default: "") The URL of the daemon to connect to. +* *trusted* - boolean; (Optional; Default: false) If false, some RPC wallet methods will be disabled. +* *ssl_support* - string; (Optional; Default: autodetect; Accepts: disabled, enabled, autodetect) Specifies whether the Daemon uses SSL encryption. +* *ssl_private_key_path* - string; (Optional) The file path location of the SSL key. +* *ssl_certificate_path* - string; (Optional) The file path location of the SSL certificate. +* *ssl_ca_file* - string; (Optional) The file path location of the certificate authority file. +* *ssl_allowed_fingerprints* - array of string; (Optional) The SHA1 fingerprints accepted by the SSL certificate. +* *ssl_allow_any_cert* - boolean; (Optional; Default: false) If false, the certificate must be signed by a trusted certificate authority. + +Outputs: +* *None* + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_daemon","params": {"address":"http://localhost:18081","trusted":true,"ssl_support":"enabled","ssl_private_key_path":"path/to/ssl/key","ssl_certificate_path":"path/to/ssl/certificate","ssl_ca_file":"path/to/ssl/ca/file","ssl_allowed_fingerprints":["85:A7:68:29:BE:73:49:80:84:91:7A:BB:1F:F1:AD:7E:43:FE:CC:B8"],"ssl_allow_any_cert":true}},' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **get_balance** + +Return the wallet's balance. + +Alias: *getbalance*. + +Inputs: + +* *account_index* - unsigned int; Return balance for this account. +* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses. + +Outputs: + +* *balance* - unsigned int; The total balance of the current monero-wallet-rpc in session. +* *unlocked_balance* - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend. +* *multisig_import_needed* - boolean; True if importing multisig data is needed for returning a correct balance. +* *per_subaddress* - array of subaddress information; Balance information for each subaddress in an account. + * *address_index* - unsigned int; Index of the subaddress in the account. + * *address* - string; Address at this index. Base58 representation of the public keys. + * *balance* - unsigned int; Balance for the subaddress (locked or unlocked). + * *unlocked_balance* - unsigned int; Unlocked balance for the subaddress. + * *label* - string; Label for the subaddress. + * *num_unspent_outputs* - unsigned int; Number of unspent outputs available for the subaddress. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "balance": 157443303037455077, + "multisig_import_needed": false, + "per_subaddress": [{ + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "address_index": 0, + "balance": 157360317826255077, + "label": "Primary account", + "num_unspent_outputs": 5281, + "unlocked_balance": 157360317826255077 + },{ + "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", + "address_index": 1, + "balance": 59985211200000, + "label": "", + "num_unspent_outputs": 1, + "unlocked_balance": 59985211200000 + }], + "unlocked_balance": 157443303037455077 + } +} +``` + + +### **get_address** + +Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. + +Alias: *getaddress*. + +Inputs: + +* *account_index* - unsigned int; Return subaddresses for this account. +* *address_index* - array of unsigned int; (Optional) List of subaddresses to return from an account. + +Outputs: + +* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. +* *addresses* array of addresses informations + * *address* string; The 95-character hex (sub)address string. + * *label* string; Label of the (sub)address + * *address_index* unsigned int; index of the subaddress + * *used* boolean; states if the (sub)address has already received funds + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0,1,4]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "addresses": [{ + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "address_index": 0, + "label": "Primary account", + "used": true + },{ + "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", + "address_index": 1, + "label": "", + "used": true + },{ + "address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5", + "address_index": 4, + "label": "test2", + "used": true + }] + } +} +``` + + + +### **get_address_index** + +Get account and address indexes from a specific (sub)address + +Alias: *None*. + +Inputs: + +* *address* - String; (sub)address to look for. + +Outputs: + +* *index* - subaddress informations + * *major* unsigned int; Account index. + * *minor* unsigned int; Address index. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "index": { + "major": 0, + "minor": 1 + } + } +} +``` + + +### **create_address** + +Create a new address for an account. Optionally, label the new address. + +Alias: *None*. + +Inputs: + +* *account_index* - unsigned int; Create a new address for this account. +* *label* - string; (Optional) Label for the new address. + +Outputs: + +* *address* - string; Newly created address. Base58 representation of the public keys. +* *address_index* - unsigned int; Index of the new address under the input account. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"new-sub"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q", + "address_index": 5 + } +} +``` + + +### **label_address** + +Label an address. + +Alias: *None*. + +Inputs: + +* *index* - subaddress index; JSON Object containing the major & minor address index: + * *major* - unsigned int; Account index for the subaddress. + * *minor* - unsigned int; Index of the subaddress in the account. +* *label* - string; Label for the address. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":5},"label":"myLabel"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### validate_address + +Analyzes a string to determine whether it is a valid monero wallet address and returns the result and the address specifications. + +Inputs: + +* *address* - string; The address to validate. +* *any_net_type* - boolean (Optional); If true, consider addresses belonging to any of the three Monero networks (mainnet, stagenet, and testnet) valid. Otherwise, only consider an address valid if it belongs to the network on which the rpc-wallet's current daemon is running (Defaults to false). +* *allow_openalias* - boolean (Optional); If true, consider [OpenAlias-formatted addresses](https://web.getmonero.org/resources/moneropedia/openalias.html) valid (Defaults to false). + +Outputs: +* *valid* - boolean; True if the input address is a valid Monero address. +* *integrated* - boolean; True if the given address is an [integrated address](https://web.getmonero.org/resources/moneropedia/address.html). +* *subaddress* - boolean; True if the given address is a [subaddress](https://github.com/monero-project/monero/pull/2056) +* *nettype* - string; Specifies which of the three Monero networks (mainnet, stagenet, and testnet) the address belongs to. +* *openalias_address* - boolean; True if the address is [OpenAlias-formatted](https://web.getmonero.org/resources/moneropedia/openalias.html). + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"validate_address", params={"address":"42go2d3XqA9Mx4HjZoqr93BHspcMxwAUBivs3yJKV1FyTycEcbgjNyEaGNEcgnUE9DDDAXNanzB16YgMt88Sa8cFSm2QcHK","any_net_type":"true","allow_openalias":"true"},' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "valid": true, + "integrated": false, + "subaddress": false, + "nettype": "mainnet", + "openalias_address": false + } +} +``` + + +### **get_accounts** + +Get all accounts for a wallet. Optionally filter accounts by tag. + +Alias: *None*. + +Inputs: + +* *tag* - string; (Optional) Tag for filtering accounts. + +Outputs: + +* *subaddress_accounts* - array of subaddress account information: + * *account_index* - unsigned int; Index of the account. + * *balance* - unsigned int; Balance of the account (locked or unlocked). + * *base_address* - string; Base64 representation of the first subaddress in the account. + * *label* - string; (Optional) Label of the account. + * *tag* - string; (Optional) Tag for filtering accounts. + * *unlocked_balance* - unsigned int; Unlocked balance for the account. +* *total_balance* - unsigned int; Total balance of the selected accounts (locked or unlocked). +* *total_unlocked_balance* - unsigned int; Total unlocked balance of the selected accounts. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts","params":{"tag":"myTag"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "subaddress_accounts": [{ + "account_index": 0, + "balance": 157663195572433688, + "base_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "label": "Primary account", + "tag": "myTag", + "unlocked_balance": 157443303037455077 + },{ + "account_index": 1, + "balance": 0, + "base_address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", + "label": "Secondary account", + "tag": "myTag", + "unlocked_balance": 0 + }], + "total_balance": 157663195572433688, + "total_unlocked_balance": 157443303037455077 + } +} +``` + + +### **create_account** + +Create a new account with an optional label. + +Alias: *None*. + +Inputs: + +* *label* - string; (Optional) Label for the account. + +Outputs: + +* *account_index* - unsigned int; Index of the new account. +* *address* - string; Address for this account. Base58 representation of the public keys. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"Secondary account"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "account_index": 1, + "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp" + } +} +``` + + +### **label_account** + +Label an account. + +Alias: *None*. + +Inputs: + +* *account_index* - unsigned int; Apply label to account at this index. +* *label* - string; Label for the account. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_account","params":{"account_index":0,"label":"Primary account"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "account_tags": [{ + "accounts": [0,1], + "label": "", + "tag": "myTag" + }] + } +} +``` + + +### **get_account_tags** + +Get a list of user-defined account tags. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *account_tags* - array of account tag information: + * *tag* - string; Filter tag. + * *label* - string; Label for the tag. + * *accounts* - array of int; List of tagged account indices. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_account_tags","params":""}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "account_tags": [{ + "accounts": [0], + "label": "Test tag", + "tag": "myTag" + }] + } +} +``` + + +### **tag_accounts** + +Apply a filtering tag to a list of accounts. + +Alias: *None*. + +Inputs: + +* *tag* - string; Tag for the accounts. +* *accounts* - array of unsigned int; Tag this list of accounts. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"tag_accounts","params":{"tag":"myTag","accounts":[0,1]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **untag_accounts** + +Remove filtering tag from a list of accounts. + +Alias: *None*. + +Inputs: + +* *accounts* - array of unsigned int; Remove tag from this list of accounts. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"untag_accounts","params":{"accounts":[1]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **set_account_tag_description** + +Set description for an account tag. + +Alias: *None*. + +Inputs: + +* *tag* - string; Set a description for this tag. +* *description* - string; Description for the tag. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_account_tag_description","params":{"tag":"myTag","description":"Test tag"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **get_height** + +Returns the wallet's current block height. + +Alias: *getheight*. + +Inputs: *None*. + +Outputs: + +* *height* - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "height": 145545 + } +} +``` + + +### **transfer** + +Send monero to a number of recipients. + +Alias: *None*. + +Inputs: + +* *destinations* - array of destinations to receive XMR: + * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. + * *address* - string; Destination public address. +* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) +* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) +* *priority* - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. +* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). +* *ring_size* - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain). +* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). +* *get_tx_key* - boolean; (Optional) Return the transaction key after sending. +* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) +* *get_tx_hex* - boolean; Return the transaction as hex string after sending (Defaults to false) +* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction. (Defaults to false) + + +Outputs: + +* *amount* - Amount transferred for the transaction. +* *fee* - Integer value of the fee charged for the txn. +* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig). +* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true. +* *tx_hash* - String for the publically searchable transaction hash. +* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string. +* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true. +* *unsigned_txset* - String. Set of unsigned tx for cold-signing purposes. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_key": true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "amount": 300000000000, + "fee": 86897600000, + "multisig_txset": "", + "tx_blob": "", + "tx_hash": "7663438de4f72b25a0e395b770ea9ecf7108cd2f0c4b75be0b14a103d3362be9", + "tx_key": "25c9d8ec20045c80c93d665c9d3684aab7335f8b2cd02e1ba2638485afd1c70e236c4bdd7a2f1cb511dbf466f13421bdf8df988b7b969c448ca6239d7251490e4bf1bbf9f6ffacffdcdc93b9d1648ec499eada4d6b4e02ce92d4a1c0452e5d009fbbbf15b549df8856205a4c7bda6338d82c823f911acd00cb75850b198c5803", + "tx_metadata": "", + "unsigned_txset": "" + } +} +``` + + +### **transfer_split** + +Same as transfer, but can split into more than one tx if necessary. + +Alias: *None*. + +Inputs: + +* *destinations* - array of destinations to receive XMR: + * *amount* - unsigned int; Amount to send to each destination, in @atomic-units. + * *address* - string; Destination public address. +* *account_index* - unsigned int; (Optional) Transfer from this account index. (Defaults to 0) +* *subaddr_indices* - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices) +* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). +* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). +* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). +* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. +* *priority* - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority. +* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) +* *get_tx_hex* - boolean; Return the transactions as hex string after sending +* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false. +* *get_tx_metadata* - boolean; Return list of transaction metadata needed to relay the transfer later. + +Outputs: + +* *tx_hash_list* - array of: string. The tx hashes of every transaction. +* *tx_key_list* - array of: string. The transaction keys for every transaction. +* *amount_list* - array of: integer. The amount transferred for every transaction. +* *fee_list* - array of: integer. The amount of fees paid for every transaction. +* *tx_blob_list* - array of: string. The tx as hex string for every transaction. +* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. +* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). +* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"get_tx_keys": true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "amount_list": [3000000000000], + "fee_list": [473710000], + "multisig_txset": "", + "tx_hash_list": ["4adcdc1af3f665770cdf8fb7a380887cd07ac53c2b771bd18df5ca375d5e7540"], + "tx_key_list": ["5b455c0f97168be652a2c03c5c68a064bb84cdae4ddef01b5c48d73a0bbb27075fb714f2ca19ea6c8ff592417e606addea6deb1d6530e2969f75681ffcbfc4075677b94a8c9197963ae38fa6f543ee68f0a4c4bbda4c453f39538f00b28e980ea08509730b51c004960101ba2f3adbc34cbbdff0d5af9dba061b523090debd06"], + "unsigned_txset": "" + } +} +``` + + +### **sign_transfer** + +Sign a transaction created on a read-only wallet (in cold-signing process) + +Alias: *None*. + +Inputs: + +* *unsigned_txset* - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods. +* *export_raw* - boolean; (Optional) If true, return the raw transaction data. (Defaults to false) + +Outputs: + +* *signed_txset* - string. Set of signed tx to be used for submitting transfer. +* *tx_hash_list* - array of: string. The tx hashes of every transaction. +* *tx_raw_list* - array of: string. The tx raw data of every transaction. + +In the example below, we first generate an unsigned_txset on a read only wallet before signing it: + +Generate unsigned_txset using the above "transfer" method on read-only wallet: +``` +curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":7,"do_not_relay":true,"get_tx_hex":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "amount": 1000000000000, + "fee": 15202740000, + "multisig_txset": "", + "tx_blob": "...long_hex...", + "tx_hash": "c648ba0a049e5ce4ec21361dbf6e4b21eac0f828eea9090215de86c76b31d0a4", + "tx_key": "", + "tx_metadata": "", + "unsigned_txset": "...long_hex..." + } +} +``` + +Sign tx using the previously generated unsigned_txset +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":...long_hex..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "signed_txset": "...long_hex...", + "tx_hash_list": ["ff2e2d49fbfb1c9a55754f786576e171c8bf21b463a74438df604b7fa6cebc6d"] + } +} +``` + + +### **submit_transfer** + +Submit a previously signed transaction on a read-only wallet (in cold-signing process). + +Alias: *None*. + +Inputs: + +* *tx_data_hex* - string; Set of signed tx returned by "sign_transfer" + +Outputs: + +* *tx_hash_list* - array of: string. The tx hashes of every transaction. + +In the example below, we submit the transfer using the signed_txset generated above: +``` +curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":...long_hex..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "tx_hash_list": ["40fad7c828bb383ac02648732f7afce9adc520ba5629e1f5d9c03f584ac53d74"] + } +} +``` + +### **sweep_dust** + +Send all dust outputs back to the wallet's, to make them easier to spend (and mix). + +Alias: *sweep_unmixable*. + +Inputs: + +* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. +* *do_not_relay* - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false) +* *get_tx_hex* - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false) +* *get_tx_metadata* - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false) + +Outputs: + +* *tx_hash_list* - array of: string. The tx hashes of every transaction. +* *tx_key_list* - array of: string. The transaction keys for every transaction. +* *amount_list* - array of: integer. The amount transferred for every transaction. +* *fee_list* - array of: integer. The amount of fees paid for every transaction. +* *tx_blob_list* - array of: string. The tx as hex string for every transaction. +* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. +* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). +* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. + +Example (In this example, `sweep_dust` returns nothing because there are no funds to sweep): + + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust","params":{"get_tx_keys":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "multisig_txset": "", + "unsigned_txset": "" + } +} +``` + + +### **sweep_all** + +Send all unlocked balance to an address. + +Alias: *None*. + +Inputs: + +* *address* - string; Destination public address. +* *account_index* - unsigned int; Sweep transactions from this account. +* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. +* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. +* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). +* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). +* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). +* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. +* *below_amount* - unsigned int; (Optional) Include outputs below this amount. +* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) +* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) +* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) + +Outputs: + +* *tx_hash_list* - array of: string. The tx hashes of every transaction. +* *tx_key_list* - array of: string. The transaction keys for every transaction. +* *amount_list* - array of: integer. The amount transferred for every transaction. +* *fee_list* - array of: integer. The amount of fees paid for every transaction. +* *tx_blob_list* - array of: string. The tx as hex string for every transaction. +* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. +* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). +* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","subaddr_indices":[4],"ring_size":7,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "amount_list": [9985885770000], + "fee_list": [14114230000], + "multisig_txset": "", + "tx_hash_list": ["ab4b6b65cc8cd8c9dd317d0b90d97582d68d0aa1637b0065b05b61f9a66ea5c5"], + "tx_key_list": ["b9b4b39d3bb3062ddb85ec0266d4df39058f4c86077d99309f218ce4d76af607"], + "unsigned_txset": "" + } +} +``` + + +### **sweep_single** + +Send all of a specific unlocked output to an address. + +Alias: *None*. + +Inputs: + +* *address* - string; Destination public address. +* *account_index* - unsigned int; Sweep transactions from this account. +* *subaddr_indices* - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account. +* *priority* - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee. +* *mixin* - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). +* *ring_size* - unsigned int; Sets ringsize to n (mixin + 1). +* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock). +* *get_tx_keys* - boolean; (Optional) Return the transaction keys after sending. +* *key_image* - string; Key image of specific output to sweep. +* *below_amount* - unsigned int; (Optional) Include outputs below this amount. +* *do_not_relay* - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false) +* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false) +* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string. (Defaults to false) + +Outputs: + +* *tx_hash_list* - array of: string. The tx hashes of every transaction. +* *tx_key_list* - array of: string. The transaction keys for every transaction. +* *amount_list* - array of: integer. The amount transferred for every transaction. +* *fee_list* - array of: integer. The amount of fees paid for every transaction. +* *tx_blob_list* - array of: string. The tx as hex string for every transaction. +* *tx_metadata_list* - array of: string. List of transaction metadata needed to relay the transactions later. +* *multisig_txset* - string. The set of signing keys used in a multisig transaction (empty for non-multisig). +* *unsigned_txset* - string. Set of unsigned tx for cold-signing purposes. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"address":"74Jsocx8xbpTBEjm3ncKE5LBQbiJouyCDaGhgSiebpvNDXZnTAbW2CmUR5SsBeae2pNk9WMVuz6jegkC4krUyqRjA6VjoLD","ring_size":7,"unlock_time":0,"key_image":"a7834459ef795d2efb6f665d2fd758c8d9288989d8d4c712a68f8023f7804a5e","get_tx_keys":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "amount": 27126892247503, + "fee": 14111630000, + "multisig_txset": "", + "tx_blob": "", + "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", + "tx_key": "", + "tx_metadata": "", + "unsigned_txset": "" + } +} +``` + + +### **relay_tx** + +Relay a transaction previously created with `"do_not_relay":true`. + +Alias: *None*. + +Inputs: + +* *hex* - string; transaction metadata returned from a `transfer` method with `get_tx_metadata` set to `true`. + +Outputs: + +* *tx_hash* - String for the publically searchable transaction hash. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"...tx_metadata..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "tx_hash": "1c42dcc5672bb09bccf33fb1e9ab4a498af59a6dbd33b3d0cfb289b9e0e25fa5" + } +} +``` + + +### **store** + +Save the wallet file. + +Alias: *None*. + +Inputs: *None*. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **get_payments** + +Get a list of incoming payments using a given payment id. + +Alias: *None*. + +Inputs: + +* *payment_id* - string; Payment ID used to find the payments (16 characters hex). + +Outputs: + +* *payments* - list of: + * *payment_id* - string; Payment ID matching the input parameter. + * *tx_hash* - string; Transaction hash used as the transaction ID. + * *amount* - unsigned int; Amount for this payment. + * *block_height* - unsigned int; Height of the block that first confirmed this payment. + * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. + * *subaddr_index* - subaddress index: + * *major* - unsigned int; Account index for the subaddress. + * *minor* - unsigned int; Index of the subaddress in the account. + * *address* - string; Address receiving the payment; Base58 representation of the public keys. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "payments": [{ + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "amount": 1000000000000, + "block_height": 127606, + "payment_id": "60900e5603bf96e3", + "subaddr_index": { + "major": 0, + "minor": 0 + }, + "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", + "unlock_time": 0 + }] + } +} +``` + + +### **get_bulk_payments** + +Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over `get_payments` because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID. + +Alias: *None*. + +Inputs: + +* *payment_ids* - array of: string; Payment IDs used to find the payments (16 characters hex). +* *min_block_height* - unsigned int; The block height at which to start looking for payments. + +Outputs: + +* *payments* - list of: + * *payment_id* - string; Payment ID matching one of the input IDs. + * *tx_hash* - string; Transaction hash used as the transaction ID. + * *amount* - unsigned int; Amount for this payment. + * *block_height* - unsigned int; Height of the block that first confirmed this payment. + * *unlock_time* - unsigned int; Time (in block height) until this payment is safe to spend. + * *subaddr_index* - subaddress index: + * *major* - unsigned int; Account index for the subaddress. + * *minor* - unsigned int; Index of the subaddress in the account. + * *address* - string; Address receiving the payment; Base58 representation of the public keys. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "payments": [{ + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "amount": 1000000000000, + "block_height": 127606, + "payment_id": "60900e5603bf96e3", + "subaddr_index": { + "major": 0, + "minor": 0 + }, + "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", + "unlock_time": 0 + }] + } +} +``` + + +### **incoming_transfers** + +Return a list of incoming transfers to the wallet. + +Inputs: + +* *transfer_type* - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent. +* *account_index* - unsigned int; (Optional) Return transfers for this account. (defaults to 0) +* *subaddr_indices* - array of unsigned int; (Optional) Return transfers sent to these subaddresses. +* *verbose* - boolean; (Optional) Enable verbose output, return key image if true. + +Outputs: + +* *transfers* - list of: + * *amount* - unsigned int; Amount of this transfer. + * *global_index* - unsigned int; Mostly internal use, can be ignored by most users. + * *key_image* - string; Key image for the incoming transfer's unspent output (empty unless verbose is true). + * *spent* - boolean; Indicates if this transfer has been spent. + * *subaddr_index* - unsigned int; Subaddress index for incoming transfer. + * *tx_hash* - string; Several incoming transfers may share the same hash if they were in the same transaction. + * *tx_size* - unsigned int; Size of transaction in bytes. + +Example, get all transfers: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "transfers": [{ + "amount": 60000000000000, + "global_index": 122405, + "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", + "spent": true, + "subaddr_index": 3, + "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", + "tx_size": 159 + },{ + "amount": 27126892247503, + "global_index": 594994, + "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", + "spent": false, + "subaddr_index": 3, + "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", + "tx_size": 157 + },{ + "amount": 27169374733655, + "global_index": 594997, + "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", + "spent": false, + "subaddr_index": 3, + "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", + "tx_size": 158 + }] + } +} +``` + +Example, get available transfers: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "transfers": [{ + "amount": 27126892247503, + "global_index": 594994, + "key_image": "7e561394806afd1be61980cc3431f6ef3569fa9151cd8d234f8ec13aa145695e", + "spent": false, + "subaddr_index": 3, + "tx_hash": "106d4391a031e5b735ded555862fec63233e34e5fa4fc7edcfdbe461c275ae5b", + "tx_size": 157 + },{ + "amount": 27169374733655, + "global_index": 594997, + "key_image": "e76c0a3bfeaae35e4173712f782eb34011198e26b990225b71aa787c8ba8a157", + "spent": false, + "subaddr_index": 3, + "tx_hash": "0bd959b59117ee1254bd8e5aa8e77ec04ef744144a1ffb2d5c1eb9380a719621", + "tx_size": 158 + }] + } +} +``` + +Example, get unavailable transfers: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable","account_index":0,"subaddr_indices":[3],"verbose":true}}' -H 'Content-Type: application/json' +{ +"id": "0", +"jsonrpc": "2.0", +"result": { + "transfers": [{ + "amount": 60000000000000, + "global_index": 122405, + "key_image": "768f5144777eb23477ab7acf83562581d690abaf98ca897c03a9d2b900eb479b", + "spent": true, + "subaddr_index": 3, + "tx_hash": "f53401f21c6a43e44d5dd7a90eba5cf580012ad0e15d050059136f8a0da34f6b", + "tx_size": 159 + }] +} +} +``` + + +### **query_key** + +Return the spend or view private key. + +Alias: *None*. + +Inputs: + +* *key_type* - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key + +Outputs: + +* *key* - string; The view key will be hex encoded, while the mnemonic will be a string of words. + +Example (Query view key): + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "key": "0a1a38f6d246e894600a3e27238a064bf5e8d91801df47a17107596b1378e501" + } +} +``` + +Example (Query mnemonic key): + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "key": "vocal either anvil films dolphin zeal bacon cuisine quote syndrome rejoices envy okay pancakes tulips lair greater petals organs enmity dedicated oust thwart tomorrow tomorrow" + } +} +``` + + +### **make_integrated_address** + +Make an integrated address from the wallet address and a payment id. + +Alias: *None*. + +Inputs: + +* *standard_address* - string; (Optional, defaults to primary address) Destination public address. +* *payment_id* - string; (Optional, defaults to a random ID) 16 characters hex encoded. + +Outputs: + +* *integrated_address* - string +* *payment_id* - string; hex encoded; + +Example (Payment ID is empty, use a random ID): + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn", + "payment_id": "420fa29b2d9a49f5" + } +} +``` + + +### **split_integrated_address** + +Retrieve the standard address and payment id corresponding to an integrated address. + +Alias: *None*. + +Inputs: + +* *integrated_address* - string + +Outputs: + +* *is_subaddress* - boolean; States if the address is a subaddress +* *payment* - string; hex encoded +* *standard_address* - string + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "5F38Rw9HKeaLQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZXCkbHUXdPHyiUeRyokn"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "is_subaddress": false, + "payment_id": "420fa29b2d9a49f5", + "standard_address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt" + } +} +``` + + +### **stop_wallet** + +Stops the wallet, storing the current state. + +Alias: *None*. + +Inputs: *None*. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **rescan_blockchain** + +Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. +This includes destination addresses, tx secret keys, tx notes, etc. + +Alias: *None*. + +Inputs: *None*. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **set_tx_notes** + +Set arbitrary string notes for transactions. + +Alias: *None*. + +Inputs: + +* *txids* - array of string; transaction ids +* *notes* - array of string; notes for the transactions + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"],"notes":["This is an example"]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **get_tx_notes** + +Get string notes for transactions. + +Alias: *None*. + +Inputs: + +* *txids* - array of string; transaction ids + +Outputs: + +* *notes* - array of string; notes for the transactions + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f"]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "notes": ["This is an example"] + } +} +``` + + +### **set_attribute** + +Set arbitrary attribute. + +Alias: *None*. + +Inputs: + +* *key* - string; attribute name +* *value* - string; attribute value + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_attribute","params":{"key":"my_attribute","value":"my_value"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **get_attribute** + +Get attribute value by name. + +Alias: *None*. + +Inputs: + +* *key* - string; attribute name + +Outputs: + +* *value* - string; attribute value + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_attribute","params":{"key":"my_attribute"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "value": "my_value" + } +} +``` + + +### **get_tx_key** + +Get transaction secret key from transaction id. + +Alias: *None*. + +Inputs: + +* *txid* - string; transaction id. + +Outputs: + +* *tx_key* - string; transaction secret key. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "tx_key": "feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06" + } +} +``` + + +### **check_tx_key** + +Check a transaction in the blockchain with its secret key. + +Alias: *None*. + +Inputs: + +* *txid* - string; transaction id. +* *tx_key* - string; transaction secret key. +* *address* - string; destination public address of the transaction. + +Outputs: + +* *confirmations* - unsigned int; Number of block mined after the one with the transaction. +* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. +* *received* - unsigned int; Amount of the transaction. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","tx_key":"feba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "confirmations": 0, + "in_pool": false, + "received": 1000000000000 + } +} +``` + + +### **get_tx_proof** + +Get transaction signature to prove it. + +Alias: *None*. + +Inputs: + +* *txid* - string; transaction id. +* *address* - string; destination public address of the transaction. +* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. + +Outputs: + +* *signature* - string; transaction signature. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "signature": "InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ" + } +} +``` + + +### **check_tx_proof** + +Prove a transaction by checking its signature. + +Alias: *None*. + +Inputs: + +* *txid* - string; transaction id. +* *address* - string; destination public address of the transaction. +* *message* - string; (Optional) Should be the same message used in `get_tx_proof`. +* *signature* - string; transaction signature to confirm. + +Outputs: + +* *confirmations* - unsigned int; Number of block mined after the one with the transaction. +* *good* - boolean; States if the inputs proves the transaction. +* *in_pool* - boolean; States if the transaction is still in pool or has been added to a block. +* *received* - unsigned int; Amount of the transaction. + +In the example below, the transaction has been proven: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"this is my transaction","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "confirmations": 482, + "good": true, + "in_pool": false, + "received": 1000000000000 + } +} +``` + +In the example below, the wrong message is used, avoiding the transaction to be proved: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","address":"7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o","message":"wrong message","signature":"InProofV13vqBCT6dpSAXkypZmSEMPGVnNRFDX2vscUYeVS4WnSVnV5BwLs31T9q6Etfj9Wts6tAxSAS4gkMeSYzzLS7Gt4vvCSQRh9niGJMUDJsB5hTzb2XJiCkUzWkkcjLFBBRVD5QZ"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "confirmations": 0, + "good": false, + "in_pool": false, + "received": 0 + } +} +``` + + +### **get_spend_proof** + +Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address. + +Alias: *None*. + +Inputs: + +* *txid* - string; transaction id. +* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. + +Outputs: + +* *signature* - string; spend signature. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "signature": "SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB" + } +} +``` + + +### **check_spend_proof** + +Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. + +Alias: *None*. + +Inputs: + +* *txid* - string; transaction id. +* *message* - string; (Optional) Should be the same message used in `get_spend_proof`. +* *signature* - string; spend signature to confirm. + +Outputs: + +* *good* - boolean; States if the inputs proves the spend. + +In the example below, the spend has been proven: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "good": true + } +} +``` + +In the example below, the wrong message is used, avoiding the spend to be proved: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "good": false + } +} +``` + + +### **get_reserve_proof** + +Generate a signature to prove of an available amount in a wallet. + +Alias: *None*. + +Inputs: + +* *all* - boolean; Proves all wallet balance to be disposable. +* *account_index* - unsigned int; Specify the account from witch to prove reserve. (ignored if `all` is set to true) +* *amount* - unsigned int; Amount (in @atomic-units) to prove the account has for reserve. (ignored if `all` is set to true) +* *message* - string; (Optional) add a message to the signature to further authenticate the prooving process. + +Outputs: + +* *signature* - string; reserve signature. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":false,"account_index":0,"amount":100000000000}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A" + } +} +``` + + +### **check_reserve_proof** + +Proves a wallet has a disposable reserve using a signature. + +Alias: *None*. + +Inputs: + +* *address* - string; Public address of the wallet. +* *message* - string; (Optional) Should be the same message used in `get_reserve_proof`. +* *signature* - string; reserve signature to confirm. + +Outputs: + +* *good* - boolean; States if the inputs proves the reserve. + +In the example below, the reserve has been proven: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NfCYJQjZ6c46gT2kXgcHCaSSZeL8sRdzqjqx7i1e7FQfQGu2o113UYFVdwzHQi3iENDPa76Kn1BvywbKz3bMkXdZkBEEhBSF4kjjGaiMJ1ucKb6wvMVC4A8sA4nZEdL2Mk3wBucJCYTZwKqA8i1M113kqakDkG25FrjiDqdQTCYz2wDBmfKxF3eQiV5FWzZ6HmAyxnqTWUiMWukP9A3Edy3ZXqjP1b23dhz7Mbj39bBxe3ZeDNu9HnTSqYvHNRyqCkeUMJpHyQweqjGUJ1DSfFYr33J1E7MkhMnEi1o7trqWjVix32XLetYfePG73yvHbS24837L7Q64i5n1LSpd9yMiQZ3Dyaysi5y6jPx7TpAvnSqBFtuCciKoNzaXoA3dqt9cuVFZTXzdXKqdt3cXcVJMNxY8RvKPVQHhUur94Lpo1nSpxf7BN5a5rHrbZFqoZszsZmiWikYPkLX72XUdw6NWjLrTBxSy7KuPYH86c6udPEXLo2xgN6XHMBMBJzt8FqqK7EcpNUBkuHm2AtpGkf9CABY3oSjDQoRF5n4vNLd3qUaxNsG4XJ12L9gJ7GrK273BxkfEA8fDdxPrb1gpespbgEnCTuZHqj1A"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "good": true, + "spent": 0, + "total": 100000000000 + } +} +``` + +In the example below, all wallet reserve has been proven: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","message":"I have 10 at least","signature":"...signature..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "good": true, + "spent": 0, + "total": 164113855714662789 + } +} +``` + +In the example below, the wrong message is used, avoiding the reserve to be proved: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"19d5089f9469db3d90aca9024dfcb17ce94b948300101c8345a5e9f7257353be","message":"wrong message","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "good": false + } +} +``` + + +### **get_transfers** + +Returns a list of transfers. + +Alias: *None*. + +Inputs: + +* *in* - boolean; (defaults to false) Include incoming transfers. +* *out* - boolean; (defaults to false) Include outgoing transfers. +* *pending* - boolean; (defaults to false) Include pending transfers. +* *failed* - boolean; (defaults to false) Include failed transfers. +* *pool* - boolean; (defaults to false) Include transfers from the daemon's transaction pool. +* *filter_by_height* - boolean; (Optional) Filter transfers by block height. +* *min_height* - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled. +* *max_height* - unsigned int; (Optional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height). +* *account_index* - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0) +* *subaddr_indices* - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices) + +Outputs: + +* *in* array of transfers: + * *address* - string; Public address of the transfer. + * *amount* - unsigned int; Amount transferred. + * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). + * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. + * *fee* - unsigned int; Transaction fee for this transfer. + * *height* - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet). + * *note* - string; Note about this transfer. + * *payment_id* - string; Payment ID for this transfer. + * *subaddr_index* - JSON object containing the major & minor subaddress index: + * *major* - unsigned int; Account index for the subaddress. + * *minor* - unsigned int; Index of the subaddress under the account. + * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. + * *timestamp* - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). + * *txid* - string; Transaction ID for this transfer. + * *type* - string; Transfer type: "in" + * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. +* *out* array of transfers (see above). +* *pending* array of transfers (see above). +* *failed* array of transfers (see above). +* *pool* array of transfers (see above). + + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "in": [{ + "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", + "amount": 200000000000, + "confirmations": 1, + "double_spend_seen": false, + "fee": 21650200000, + "height": 153624, + "note": "", + "payment_id": "0000000000000000", + "subaddr_index": { + "major": 1, + "minor": 0 + }, + "suggested_confirmations_threshold": 1, + "timestamp": 1535918400, + "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", + "type": "in", + "unlock_time": 0 + }] + } +} +``` + +### **get_transfer_by_txid** + +Show information about a transfer to/from this address. + +Alias: *None*. + +Inputs: + +* *txid* - string; Transaction ID used to find the transfer. +* *account_index* - unsigned int; (Optional) Index of the account to query for the transfer. + +Outputs: + +* *transfer* - JSON object containing payment information: + * *address* - string; Address that transferred the funds. Base58 representation of the public keys. + * *amount* - unsigned int; Amount of this transfer. + * *confirmations* - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed). + * *destinations* - array of JSON objects containing transfer destinations: + * *amount* - unsigned int; Amount transferred to this destination. + * *address* - string; Address for this destination. Base58 representation of the public keys. + * *double_spend_seen* - boolean; True if the key image(s) for the transfer have been seen before. + * *fee* - unsigned int; Transaction fee for this transfer. + * *height* - unsigned int; Height of the first block that confirmed this transfer. + * *note* - string; Note about this transfer. + * *payment_id* - string; Payment ID for this transfer. + * *subaddr_index* - JSON object containing the major & minor subaddress index: + * *major* - unsigned int; Account index for the subaddress. + * *minor* - unsigned int; Index of the subaddress under the account. + * *suggested_confirmations_threshold* - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block. + * *timestamp* - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet). + * *txid* - string; Transaction ID of this transfer (same as input TXID). + * *type* - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool" + * *unlock_time* - unsigned int; Number of blocks until transfer is safely spendable. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "transfer": { + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "amount": 300000000000, + "confirmations": 1, + "destinations": [{ + "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", + "amount": 100000000000 + },{ + "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", + "amount": 200000000000 + }], + "double_spend_seen": false, + "fee": 21650200000, + "height": 153624, + "note": "", + "payment_id": "0000000000000000", + "subaddr_index": { + "major": 0, + "minor": 0 + }, + "suggested_confirmations_threshold": 1, + "timestamp": 1535918400, + "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", + "type": "out", + "unlock_time": 0 + } + } +} +``` + + +### **describe_transfer** + +Returns details for each transaction in an unsigned or multisig transaction set. Transaction sets are obtained as return values from one of the following RPC methods: +* transfer +* transfer_split +* sweep_all +* sweep_single +* sweep_dust + +These methods return unsigned transaction sets if the wallet is view-only (i.e. the wallet was created without the private spend key). + +Inputs: + +* *unsigned_txset* - string; (Optional) A hexadecimal string representing a set of unsigned transactions (empty for multisig transactions; non-multisig signed transactions are not supported). +* *multisig_txset* - string; (Optional) A hexadecimal string representing the set of signing keys used in a multisig transaction (empty for unsigned transactions; non-multisig signed transactions are not supported). + +Outputs: +* *desc* - The description of the transfer as a list of: + * *amount_in* - unsigned int (64 bit); The sum of the inputs spent by the transaction in @atomic-units. + * *amount_out* - unsigned int (64 bit); The sum of the outputs created by the transaction in @atomic-units. + * *recipients* - list of: + * *address* - string; The public address of the recipient. + * *amount* - unsigned int; The amount sent to the recipient in @atomic-units. + * *change_address* - string; The address of the change recipient. + * *change_amount* - unsigned int; The amount sent to the change address in @atomic-units. + * *fee* - unsigned int; The fee charged for the transaction in @atomic-units. + * *payment_id* - string; payment ID for this transfer (empty if not provided. + * *ring_size* - unsigned int; The number of inputs in the ring (1 real output + the number of decoys from the blockchain). + * *unlock_time* - unsigned int; The number of blocks before the monero can be spent (0 for no lock). + * *dummy_outputs* - unsigned int; The number of fake outputs added to single-output transactions. Fake outputs have 0 amount and are sent to a random address. + * *extra* - string; Arbitrary transaction data in hexadecimal format. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"describe_transfer","params":{"unsigned_txset":"...long hex..."}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "desc": [{ + "amount_in": 886489038634812, + "amount_out": 886455352051344, + "change_address": "5BqWeZrK944YesCy5VdmBneWeaSZutEijFVAKjpVHeVd4unsCSM55CjgViQsK9WFNHK1eZgcCuZ3fRqYpzKDokqSUmQfJzvswQs13AAidJ", + "change_amount": 4976287087263, + "dummy_outputs": 0, + "extra": 01b998f16459bcbac9c92074d3128d10724f10b74f5a7b1ec8e5a1e7f1150544020209010000000000000000", + "fee": 33686583468, + "payment_id": "0000000000000000000000000000000000000000000000000000000000000000", + "recipients": [{ + "address": "0b057f69acc1552014cb157138e5c4dd495347d333f68ff0af70494b979aed10", + "amount": 881479064964081 + }], + "ring_size": 11, + "unlock_time": 0 + ]} + } +} +``` + + +### **sign** + +Sign a string. + +Alias: *None*. + +Inputs: + +* *data* - string; Anything you need to sign. + +Outputs: + +* *signature* - string; Signature generated against the "data" and the account public address. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "signature": "SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3" + } +} +``` + + +### **verify** + +Verify a signature on a string. + +Alias: *None*. + +Inputs: + +* *data* - string; What should have been signed. +* *address* - string; Public address of the wallet used to `sign` the data. +* *signature* - string; signature generated by `sign` method. + +Outputs: + +* *good* - boolean; + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","signature":"SigV14K6G151gycjiGxjQ74tKX6A2LwwghvuHjcDeuRFQio5LS6Gb27BNxjYQY1dPuUvXkEbGQUkiHSVLPj4nJAHRrrw3"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "good": true + } +} +``` + + +### **export_outputs** + +Export all outputs in hex format. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *outputs_data_hex* - string; wallet outputs in hex format. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_outputs"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "outputs_data_hex": "...outputs..." + } +} +``` + + +### **import_outputs** + +Import outputs in hex format. + +Alias: *None*. + +Inputs: + +* *outputs_data_hex* - string; wallet outputs in hex format. + +Outputs: + +* *num_imported* - unsigned int; number of outputs imported. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"...outputs..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "num_imported": 6400 + } +} +``` + + +### **export_key_images** + +Export a signed set of key images. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *signed_key_images* - array of signed key images: + * *key_image* - string; + * *signature* - string; + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "signed_key_images": [{ + "key_image": "cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876", + "signature": "c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00" + },{ + "key_image": "65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19", + "signature": "c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c" + },...] + } +} +``` + + +### **import_key_images** + +Import signed key images list and verify their spent status. + +Alias: *None*. + +Inputs: + +* *signed_key_images* - array of signed key images: + * *key_image* - string; + * *signature* - string; + +Outputs: + +* *height* - unsigned int; +* *spent* - unsigned int; Amount (in @atomic-units) spent from those key images. +* *unspent* - unsigned int; Amount (in @atomic-units) still available from those key images. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"cd35239b72a35e26a57ed17400c0b66944a55de9d5bda0f21190fed17f8ea876","signature":"c9d736869355da2538ab4af188279f84138c958edbae3c5caf388a63cd8e780b8c5a1aed850bd79657df659422c463608ea4e0c730ba9b662c906ae933816d00"},{"key_image":"65158a8ee5a3b32009b85a307d85b375175870e560e08de313531c7dbbe6fc19","signature":"c96e40d09dfc45cfc5ed0b76bfd7ca793469588bb0cf2b4d7b45ef23d40fd4036057b397828062e31700dc0c2da364f50cd142295a8405b9fe97418b4b745d0c"}]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "height": 76428, + "spent": 62708953408711, + "unspent": 0 + } +} +``` + + +### **make_uri** + +Create a payment URI using the official URI spec. + +Alias: *None*. + +Inputs: + +* *address* - string; Wallet address +* *amount* - unsigned int; (optional) the integer amount to receive, in **@atomic-units** +* *payment_id* - string; (optional) 16 or 64 character hexadecimal payment id +* *recipient_name* - string; (optional) name of the payment recipient +* *tx_description* - string; (optional) Description of the reason for the tx + +Outputs: + +* *uri* - string; This contains all the payment input information as a properly formatted payment URI + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params":{"address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","amount":10,"payment_id":"420fa29b2d9a49f5","tx_description":"Testing out the make_uri function.","recipient_name":"el00ruobuob Stagenet wallet"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "uri": "monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function." + } +} +``` + + +### **parse_uri** + +Parse a payment URI to get payment information. + +Alias: *None*. + +Inputs: + +* *uri* - string; This contains all the payment input information as a properly formatted payment URI + +Outputs: + +* *uri* - JSON object containing payment information: + * *address* - string; Wallet address + * *amount* - unsigned int; Integer amount to receive, in **@atomic-units** (0 if not provided) + * *payment_id* - string; 16 or 64 character hexadecimal payment id (empty if not provided) + * *recipient_name* - string; Name of the payment recipient (empty if not provided) + * *tx_description* - string; Description of the reason for the tx (empty if not provided) + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"monero:55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt?tx_payment_id=420fa29b2d9a49f5&tx_amount=0.000000000010&recipient_name=el00ruobuob%20Stagenet%20wallet&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "uri": { + "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", + "amount": 10, + "payment_id": "420fa29b2d9a49f5", + "recipient_name": "el00ruobuob Stagenet wallet", + "tx_description": "Testing out the make_uri function." + } + } +} +``` + + +### **get_address_book** + +Retrieves entries from the address book. + +Alias: *None*. + +Inputs: + +* *entries* - array of unsigned int; indices of the requested address book entries + +Outputs: + +* *entries* - array of entries: + * *address* - string; Public address of the entry + * *description* - string; Description of this address entry + * *index* - unsigned int; + * *payment_id* - string; + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[0,1]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "entries": [{ + "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", + "description": "Second account", + "index": 0, + "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" + },{ + "address": "78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j", + "description": "Third account", + "index": 1, + "payment_id": "0000000000000000000000000000000000000000000000000000000000000000" + }] + } +} +``` + + +### **add_address_book** + +Add an entry to the address book. + +Alias: *None*. + +Inputs: + +* *address* - string; +* *payment_id* - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000"; +* *description* - (optional) string, defaults to ""; + +Outputs: + +* *index* - unsigned int; The index of the address book entry. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"78P16M3XmFRGcWFCcsgt1WcTntA1jzcq31seQX1Eg92j8VQ99NPivmdKam4J5CKNAD7KuNWcq5xUPgoWczChzdba5WLwQ4j","description":"Third account"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "index": 1 + } +} +``` + + +### **edit_address_book** + +Edit an existing address book entry. + +Alias: *None* + +Inputs: + +* *index* - unsigned_int; Index of the address book entry to edit. +* *set_address* - boolean; If true, set the address for this entry to the value of "address". +* *address* - string; (Optional) The 95-character public address to set. +* *set_description* - boolean; If true, set the description for this entry to the value of "description". +* *description* - string; (Optional) Human-readable description for this entry. +* *set_payment_id* - boolean; If true, set the payment ID for this entry to the value of "payment_id". +* *payment_id* - string; (Optional) Payment ID for this address. + +Outputs: *none*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"edit_address_book","params":{"index":0, "set_address":true, "address":"0b057f69acc1552014cb157138e5c4dd495347d333f68ff0af70494b979aed10", "set_payment_id":true, "payment_id":"60900e5603bf96e3", "set_description":true, "description":"Example description."}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **delete_address_book** + +Delete an entry from the address book. + +Alias: *None*. + +Inputs: + +* *index* - unsigned int; The index of the address book entry. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":1}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **refresh** + +Refresh a wallet after openning. + +Alias: *None*. + +Inputs: + +* *start_height* - unsigned int; (Optional) The block height from which to start refreshing. + +Outputs: + +* *blocks_fetched* - unsigned int; Number of new blocks scanned. +* *received_money* - boolean; States if transactions to the wallet have been found in the blocks. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"refresh","params":{"start_height":100000}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "blocks_fetched": 24, + "received_money": true + } +} +``` + + +### **auto_refresh** + +Set whether and how often to automatically refresh the current wallet. + +Inputs: + +* *enable* - boolean; (Optional) Enable or disable automatic refreshing (default = true). +* *period* - unsigned integer; (Optional) The period of the wallet refresh cycle (i.e. time between refreshes) in seconds. + +Outputs: *none*. + +Example: + +``` +$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"auto_refresh","params":{"enable":true, "period":10}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **rescan_spent** + +Rescan the blockchain for spent outputs. + +Alias: *None*. + +Inputs: *None*. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json' + +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **start_mining** + +Start mining in the Monero daemon. + +Alias: *None*. + +Inputs: + +* *threads_count* - unsigned int; Number of threads created for mining. +* *do_background_mining* - boolean; Allow to start the miner in @smart-mining mode. +* *ignore_battery* - boolean; Ignore battery status (for @smart-mining only) + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":false}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **stop_mining** + +Stop mining in the Monero daemon. + +Alias: *None*. + +Inputs: *None*. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **get_languages** + +Get a list of available languages for your wallet's seed. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *languages* - array of string; List of available languages + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "languages": ["Deutsch","English","Español","Français","Italiano","Nederlands","Português","русский язык","日本語","简体中文 (中国)","Esperanto","Lojban"] + } +} +``` + + +### **create_wallet** + +Create a new wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. + +Alias: *None*. + +Inputs: + +* *filename* - string; Wallet file name. +* *password* - string; (Optional) password to protect the wallet. +* *language* - string; Language for your wallets' seed. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **open_wallet** + +Open a wallet. You need to have set the argument "--wallet-dir" when launching monero-wallet-rpc to make this work. + +Alias: *None*. + +Inputs: + +* *filename* - string; wallet name stored in --wallet-dir. +* *password* - string; (Optional) only needed if the wallet has a password defined. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **restore_deterministic_wallet** + +Create and open a wallet on the RPC server from an existing mnemonic phrase and close the currently open wallet. + +Alias: *None*. + +Inputs: + +* *name* - string; Name of the wallet. +* *password* - string; Password of the wallet. +* *seed* - string; Mnemonic phrase of the wallet to restore. +* *restore_height* - integer; (Optional) Block height to restore the wallet from (default = 0). +* *language* - string; (Optional) Language of the mnemonic phrase in case the old language is invalid. +* *seed_offset* - string; (Optional) Offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase. +* *autosave_current* - boolean; Whether to save the currently open RPC wallet before closing it (Defaults to true). + +Outputs: + +* *address* - string; 95-character hexadecimal address of the restored wallet as a string. +* *info* - string; Message describing the success or failure of the attempt to restore the wallet. +* *seed* - string; Mnemonic phrase of the restored wallet, which is updated if the wallet was restored from a deprecated-style mnemonic phrase. +* *was_deprecated* - boolean; Indicates if the restored wallet was created from a deprecated-style mnemonic phrase. + +Example: + +``` +$ curl -X POST http://localhost:38083/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"restore_deterministic_wallet","params":{"filename":"My Wallet","password":"mypassword123","seed":"awkward vogue odometer amply bagpipe kisses poker aspire slug eluded hydrogen selfish later toolbox enigma wolf tweezers eluded gnome soprano ladder broken jukebox lordship aspire","restore_height":0, "language":"English","seed_offset":"","autosave_current":true}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "address": "9wB1Jc5fy5hjTkFBnv4UNY3WfhUswhx8M7uWjZrwRBzH2uatJcn8AqiKEHWuSNrnapApCzzTxP4iSiV3y3pqYcRbDHNboJK", + "info": "Wallet has been restored successfully.", + "seed": "awkward vogue odometer amply bagpipe kisses poker aspire slug eluded hydrogen selfish later toolbox enigma wolf tweezers eluded gnome soprano ladder broken jukebox lordship aspire", + "was_deprecated": false + } +} + +``` + + +### **close_wallet** + +Close the currently opened wallet, after trying to save it. + +Alias: *None*. + +Inputs: *None*. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **change_wallet_password** + +Change a wallet password. + +Alias: *None*. + +Inputs: + +* *old_password* - string; (Optional) Current wallet password, if defined. +* *new_password* - string; (Optional) New wallet password, if not blank. + +Outputs: *None*. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"old_password":"theCurrentSecretPassPhrase","new_password":"theNewSecretPassPhrase"}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + } +} +``` + + +### **is_multisig** + +Check if a wallet is a multisig one. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *multisig* - boolean; States if the wallet is multisig +* *ready* - boolean; +* *threshold* - unsigned int; Amount of signature needed to sign a transfer. +* *total* - unsigned int; Total amount of signature in the multisig wallet. + +Example for a non-multisig wallet: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "multisig": false, + "ready": false, + "threshold": 0, + "total": 0 + } +} +``` +Example for a multisig wallet: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"is_multisig"}' -H 'Content-Type: application/json' { + "id": "0", + "jsonrpc": "2.0", + "result": { + "multisig": true, + "ready": true, + "threshold": 2, + "total": 2 + } +} +``` + + +### **prepare_multisig** + +Prepare a wallet for multisig by generating a multisig string to share with peers. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"prepare_multisig"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "multisig_info": "MultisigV1BFdxQ653cQHB8wsj9WJQd2VdnjxK89g5M94dKPBNw22reJnyJYKrz6rJeXdjFwJ3Mz6n4qNQLd6eqUZKLiNzJFi3UPNVcTjtkG2aeSys9sYkvYYKMZ7chCxvoEXVgm74KKUcUu4V8xveCBFadFuZs8shnxBWHbcwFr5AziLr2mE7KHJT" + } +} +``` + + +### **make_multisig** + +Make a wallet multisig by importing peers multisig string. + +Alias: *None*. + +Inputs: + +* *multisig_info* - array of string; List of multisig string from peers. +* *threshold* - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in `multisig_info`. +* *password* - string; Wallet password + +Outputs: + +* *address* - string; multisig wallet address. +* *multisig_info* - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets). + +Example for 2/2 Multisig Wallet: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1K4tGGe8QirZdHgTYoBZMumSug97fdDyM3Z63M3ZY5VXvAdoZvx16HJzPCP4Rp2ABMKUqLD2a74ugMdBfrVpKt4BwD8qCL5aZLrsYWoHiA7JJwDESuhsC3eF8QC9UMvxLXEMsMVh16o98GnKRYz1HCKXrAEWfcrCHyz3bLW1Pdggyowop"],"threshold":2}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "address": "55SoZTKH7D39drxfgT62k8T4adVFjmDLUXnbzEKYf1MoYwnmTNKKaqGfxm4sqeKCHXQ5up7PVxrkoeRzXu83d8xYURouMod", + "multisig_info": "" + } +} +``` + +Example for 2/3 Multisig Wallet: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_multisig","params":{"multisig_info":["MultisigV1MTVm4DZAdJw1PyVutpSy8Q4WisZBCFRAaZY7hhQnMwr5AZ4swzThyaSiVVQM5FHj1JQi3zPKhQ4k81BZkPSEaFjwRJtbfqfJcVvCqRnmBVcWVxhnihX5s8fZWBCjKrzT3CS95spG4dzNzJSUcjheAkLzCpVmSzGtgwMhAS3Vuz9Pas24","MultisigV1TEx58ycKCd6ADCfxF8hALpcdSRAkhZTi1bu4Rs6FdRC98EdB1LY7TAkMxasM55khFgcxrSXivaSr5FCMyJGHmojm1eE4HpGWPeZKv6cgCTThRzC4u6bkkSoFQdbzWN92yn1XEjuP2XQrGHk81mG2LMeyB51MWKJAVF99Pg9mX2BpmYFj"],"threshold":2}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "address": "51sLpF8fWaK1111111111111111111111111111111111ABVbHNf1JFWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDkTRgKS", + "multisig_info": "MultisigxV18jCaYAQQvzCMUJaAWMCaAbAoHpAD6WPmYDmLtBtazD654E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2Sscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskaDKuTAWtdB9VTBGW7iG1cd7Zm1dYgur3CiemkGjRUAj9bL3xTEuyaKGYSDhtpFZFp99HQX57EawhiRHk3qq4hjWX" + } +} +``` + + +### **export_multisig_info** + +Export multisig info for other participants. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *info* - string; Multisig info in hex format for other participants. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "info": "4d6f6e65726f206d756c7469736967206578706f72740105cf6442b09b75f5eca9d846771fe1a879c9a97ab0553ffbcec64b1148eb7832b51e7898d7944c41cee000415c5a98f4f80dc0efdae379a98805bb6eacae743446f6f421cd03e129eb5b27d6e3b73eb6929201507c1ae706c1a9ecd26ac8601932415b0b6f49cbbfd712e47d01262c59980a8f9a8be776f2bf585f1477a6df63d6364614d941ecfdcb6e958a390eb9aa7c87f056673d73bc7c5f0ab1f74a682e902e48a3322c0413bb7f6fd67404f13fb8e313f70a0ce568c853206751a334ef490068d3c8ca0e" + } +} +``` + + +### **import_multisig_info** + +Import multisig info from other participants. + +Alias: *None*. + +Inputs: + +* *info* - array of string; List of multisig info in hex format from other participants. + +Outputs: + +* *n_outputs* - unsigned int; Number of outputs signed with those multisig info. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_multisig_info","params":{"info":["...multisig_info..."]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "n_outputs": 35 + } +} +``` + + +### **finalize_multisig** + +Turn this wallet into a multisig wallet, extra step for N-1/N wallets. + +Alias: *None*. + +Inputs: + +* *multisig_info* - array of string; List of multisig string from peers. +* *password* - string; Wallet password + +Outputs: + +* *address* - string; multisig wallet address. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"finalize_multisig","params":{"multisig_info":["MultisigxV1JNC6Ja2oBt5Sqea9LN2YEF7WYZCpHqr2EKvPG89Trf3X4E8RWkLaGRf29fJ3stU471MELKxwufNYeigP7LoE4tn2McPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZEKVAQ4HPPyQciSCdNjgwsuFRBzrskMdMUwNMgKst1debYfm37i6PSzDoS2tk4kYTYj83kkAdR7kdshet1axQPd6HQ","MultisigxV1Unma7Ko4zdd8Ps3Af4oZwtj2JdWKzwNfP6s2G9ZvXhMoSscwn5g7PyCfcBc1V4ffRHY3Kxqq6VocSCUTncpVeUskMcPr4SbL9q15xNvZT5uwC9YRr7UwjXqSZHmTWN9PBuZE1LTpWxLoC3vPMSrqVVcjnmL9LYfdCZz3fECjNZbCEDq3PHDiUuY5jurQTcNoGhDTio5WM9xaAdim9YByiS5KyqF4"]}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "address": "5B9gZUTDuHTcGGuY3nL3t8K2tDnEHeRVHSBQgLZUTQxtFYVLnho5JJjWJyFp5YZgZRQ44RiviJi1sPHgLVMbckRsDqDx1gV" + } +} +``` + + +### **sign_multisig** + +Sign a transaction in multisig. + +Alias: *None*. + +Inputs: + +* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `transfer` under `multisig_txset`. + +Outputs: + +* *tx_data_hex* - string; Multisig transaction in hex format. +* *tx_hash_list* - array of string; List of transaction Hash. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_multisig","params":{"tx_data_hex":"...multisig_txset..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "tx_data_hex": "...multisig_txset...", + "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] + } +} +``` + + +### **submit_multisig** + +Submit a signed multisig transaction. + +Alias: *None*. + +Inputs: + +* *tx_data_hex* - string; Multisig transaction in hex format, as returned by `sign_multisig` under `tx_data_hex`. + +Outputs: + +* *tx_hash_list* - array of string; List of transaction Hash. + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_multisig","params":{"tx_data_hex":"...tx_data_hex..."}}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "tx_hash_list": ["4996091b61c1be112c1097fd5e97d8ff8b28f0e5e62e1137a8c831bacf034f2d"] + } +} +``` + + +### **get_version** + +Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits. + +Alias: *None*. + +Inputs: *None*. + +Outputs: + +* *version* - unsigned int; RPC version, formatted with `Major * 2^16 + Minor` (Major encoded over the first 16 bits, and Minor over the last 16 bits). + +Example: + +``` +$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_version"}' -H 'Content-Type: application/json' +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "version": 65539 + } +} +```