Wallet RPC guide refresh + Finalized for all languages (except PL):

- get_balance;
- get_address;
- get_address_index;
- create_address;
- label_address;
- get_accounts;
- create_account;
- label_account;
- get_account_tags;
- tag_accounts;
- untag_accounts;
- set_account_tag_description;
- get_height;
- transfer;
- transfer_split;
- sign_transfer;
- submit_transfer;
- sweep_dust;
- sweep_all;
- sweep_single;
- relay_tx;
- store;
- get_payments;
- get_bulk_payments;
- incoming_transfers;
- query_key;
- make_integrated_address;
- split_integrated_address;
- stop_wallet;
- rescan_blockchain;
- set_tx_notes;
- get_tx_notes;
- set_attribute;
- get_attribute;
- get_tx_key;
- check_tx_key;
- get_tx_proof;
- check_tx_proof;
- get_spend_proof;
- check_spend_proof;
- get_reserve_proof;
- check_reserve_proof;
- get_transfers; (including clarification proposed in #703)
- get_transfer_by_txid;
- sign;
- verify;
- export_outputs;
- import_outputs;
- export_key_images;
- import_key_images;
- make_uri;
- parse_uri;
- get_address_book;
- add_address_book;
- delete_address_book;
- refresh;
- rescan_spent;
- start_mining;
- stop_mining;
- get_languages;
- create_wallet;
- open_wallet;
- close_wallet;
- change_wallet_password;
- is_multisig;
- prepare_multisig;
- make_multisig;
- export_multisig_info;
- import_multisig_info;
- finalize_multisig;
- sign_multisig;
- submit_multisig;
- get_version;
parent a1a3fd14
{% assign version = '1.2.0' | split: '.' %} {% assign version = '2.1.0' | split: '.' %}
{% include disclaimer.html translated="false" version=page.version %} {% include disclaimer.html translated="false" version=page.version %}
## Introduction ## Introduction
...@@ -33,64 +33,98 @@ curl \ ...@@ -33,64 +33,98 @@ curl \
Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 @atomic-units.** 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: ### Index of JSON RPC Methods:
* [getbalance](#getbalance) * [get_balance](#get_balance)
* [getaddress](#getaddress) * [get_address](#get_address)
* [getheight](#getheight) * [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](#transfer)
* [transfer_split](#transfer_split) * [transfer_split](#transfer_split)
* [sign_transfer](#sign_transfer)
* [submit_transfer](#submit_transfer)
* [sweep_dust](#sweep_dust) * [sweep_dust](#sweep_dust)
* [sweep_all](#sweep_all) * [sweep_all](#sweep_all)
* [sweep_single](#sweep_single)
* [relay_tx](#relay_tx)
* [store](#store) * [store](#store)
* [get_payments](#get_payments) * [get_payments](#get_payments)
* [get_bulk_payments](#get_bulk_payments) * [get_bulk_payments](#get_bulk_payments)
* [get_transfers](#get_transfers)
* [get_transfer_by_txid](#get_transfer_by_txid)
* [incoming_transfers](#incoming_transfers) * [incoming_transfers](#incoming_transfers)
* [query_key](#query_key) * [query_key](#query_key)
* [make_integrated_address](#make_integrated_address) * [make_integrated_address](#make_integrated_address)
* [split_integrated_address](#split_integrated_address) * [split_integrated_address](#split_integrated_address)
* [stop_wallet](#stop_wallet) * [stop_wallet](#stop_wallet)
* [make_uri](#make_uri)
* [parse_uri](#parse_uri)
* [rescan_blockchain](#rescan_blockchain) * [rescan_blockchain](#rescan_blockchain)
* [set_tx_notes](#set_tx_notes) * [set_tx_notes](#set_tx_notes)
* [get_tx_notes](#get_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) * [sign](#sign)
* [verify](#verify) * [verify](#verify)
* [export_outputs](#export_outputs)
* [import_outputs](#import_outputs)
* [export_key_images](#export_key_images) * [export_key_images](#export_key_images)
* [import_key_images](#import_key_images) * [import_key_images](#import_key_images)
* [make_uri](#make_uri)
* [parse_uri](#parse_uri)
* [get_address_book](#get_address_book) * [get_address_book](#get_address_book)
* [add_address_book](#add_address_book) * [add_address_book](#add_address_book)
* [delete_address_book](#delete_address_book) * [delete_address_book](#delete_address_book)
* [refresh](#refresh)
* [rescan_spent](#rescan_spent) * [rescan_spent](#rescan_spent)
* [start_mining](#start_mining) * [start_mining](#start_mining)
* [stop_mining](#stop_mining) * [stop_mining](#stop_mining)
* [get_languages](#get_languages) * [get_languages](#get_languages)
* [create_wallet](#create_wallet) * [create_wallet](#create_wallet)
* [open_wallet](#open_wallet) * [open_wallet](#open_wallet)
* [get_accounts](#get_accounts) * [close_wallet](#close_wallet)
* [create_account](#create_account) * [change_wallet_password](#change_wallet_password)
* [label_account](#label_account) * [is_multisig](#is_multisig)
* [create_address](#create_address) * [prepare_multisig](#prepare_multisig)
* [label_address](#label_address) * [make_multisig](#make_multisig)
* [get_account_tags](#get_account_tags) * [export_multisig_info](#export_multisig_info)
* [tag_accounts](#tag_accounts) * [import_multisig_info](#import_multisig_info)
* [untag_accounts](#untag_accounts) * [finalize_multisig](#finalize_multisig)
* [set_account_tag_description](#set_account_tag_description) * [sign_multisig](#sign_multisig)
* [submit_multisig](#submit_multisig)
* [get_version](#get_version)
--- ---
## JSON RPC Methods: ## JSON RPC Methods:
### **getbalance** ### **get_balance**
Return the wallet's balance. Return the wallet's balance.
Alias: *getbalance*.
Inputs: Inputs:
* *account_index* - unsigned int; Return balance for this account. * *account_index* - unsigned int; Return balance for this account.
* *address_indices* - array of unsigned int; (Optional) Return balance detail for those subaddresses.
Outputs: Outputs:
...@@ -108,32 +142,40 @@ Outputs: ...@@ -108,32 +142,40 @@ Outputs:
Example: Example:
``` ```
$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance","params":{"account_index":0}}' -H 'Content-Type: application/json' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"balance": 140000000000, "balance": 157443303037455077,
"unlocked_balance": 50000000000,
"multisig_import_needed": false, "multisig_import_needed": false,
"per_subaddress": { "per_subaddress": [{
"address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"address_index": 0, "address_index": 0,
"address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQGaDsaBA", "balance": 157360317826255077,
"balance": 140000000000, "label": "Primary account",
"unlocked_balance": 50000000000, "num_unspent_outputs": 5281,
"unlocked_balance": 157360317826255077
},{
"address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o",
"address_index": 1,
"balance": 59985211200000,
"label": "", "label": "",
"num_unspent_outputs": 42 "num_unspent_outputs": 1,
} "unlocked_balance": 59985211200000
}],
"unlocked_balance": 157443303037455077
} }
} }
``` ```
### **getaddress** ### **get_address**
Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses. Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses.
Alias: *getaddress*.
Inputs: Inputs:
* *account_index* - unsigned int; Return subaddresses for this account. * *account_index* - unsigned int; Return subaddresses for this account.
...@@ -142,1001 +184,1935 @@ Inputs: ...@@ -142,1001 +184,1935 @@ Inputs:
Outputs: Outputs:
* *address* - string; The 95-character hex address string of the monero-wallet-rpc in session. * *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: Example:
``` ```
$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress","params":{"account_index":0,"address_index":[0,1]}}' -H 'Content-Type: application/json' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQGaDsaBA", "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"addresses": [{ "addresses": [{
"address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQGaDsaBA", "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"address_index": 0, "address_index": 0,
"label": "Primary account", "label": "Primary account",
"used": false "used": true
},{ },{
"address": "88bV1uo76AaKZaWD389kCf5EfPxKFYEKUQbs9ZRJm23E2X2oYgV9bQ54FiY6hAB83aDXMUSZF6KWyfeQqzLqaAeeFrk9iic", "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o",
"address_index": 1, "address_index": 1,
"label": "", "label": "",
"used": false "used": true
}] },{
"address": "77xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5",
"address_index": 4,
"label": "test2",
"used": true
}]
} }
} }
``` ```
### **getheight**
Returns the wallet's current block height. ### **get_address_index**
Inputs: *None*. Get account and address indexes from a specific (sub)address
Alias: *None*.
Inputs:
* *address* - String; (sub)address to look for.
Outputs: 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. * *index* - subaddress informations
* *major* unsigned int; Account index.
* *minor* unsigned int; Address index.
Example: Example:
``` ```
$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getheight"}' -H 'Content-Type: application/json' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"height": 994310 "index": {
"major": 0,
"minor": 1
}
} }
} }
``` ```
### **transfer** ### **create_address**
Send monero to a number of recipients. Create a new address for an account. Optionally, label the new address.
Inputs: Alias: *None*.
* *destinations* - array of destinations to receive XMR: Inputs:
* *amount* - unsigned int; Amount to send to each destination, in @atomic-units.
* *address* - string; Destination public address.
* *account_index* - unsigned int; Transfer from this account index.
* *subaddr_indices* - array of unsigned int; Transfer from this set of subaddresses.
* *fee* - unsigned int; Ignored, will be automatically calculated.
* *mixin* - unsigned int; Number of outpouts from the blockchain to mix with (0 means no mixing).
* *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.
* *priority* - unsigned int; Set a priority for the transaction. 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 transaction as hex string after sending
* *get_tx_metadata* - boolean; Return the metadata needed to relay the transaction.
* *account_index* - unsigned int; Create a new address for this account.
* *label* - string; (Optional) Label for the new address.
Outputs: Outputs:
* *fee* - Integer value of the fee charged for the txn. * *address* - string; Newly created address. Base58 representation of the public keys.
* *tx_hash* - String for the publically searchable transaction hash * *address_index* - unsigned int; Index of the new address under the input account.
* *tx_key* - String for the transaction key if get_tx_key is true, otherwise, blank string.
* *amount* - Amount transferred for the transaction.
* *tx_blob* - Raw transaction represented as hex string, if get_tx_hex is true.
* *tx_metadata* - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true.
* *multisig_txset* - Set of multisig transactions in the process of being signed (empty for non-multisig).
Example: Example:
``` ```
$ 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' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"fee": 48958481211, "address": "7BG5jr9QS5sGMdpbBrZEwVLZjSKJGJBsXdZLt8wiXyhhLjy7x2LZxsrAnHTgD8oG46ZtLjUGic2pWc96GFkGNPQQDA3Dt7Q",
"tx_hash": "985180f468637bc6d2f72ee054e1e34b8d5097988bb29a2e0cb763e4464db23c", "address_index": 5
"tx_key": "8d62e5637f1fcc9a8904057d6bed6c697618507b193e956f77c31ce662b2ee07",
"amount": 300000000,
"tx_blob": "",
"tx_metadata": "",
"multisig_txset": ""
} }
} }
``` ```
### **transfer_split** ### **label_address**
Same as transfer, but can split into more than one tx if necessary. Label an address.
Inputs: Alias: *None*.
* *destinations* - array of destinations to receive XMR: Inputs:
* *amount* - unsigned int; Amount to send to each destination, in @atomic-units.
* *address* - string; Destination public address.
* *account_index* - unsigned int; Transfer from this account.
* *subaddr_indices* - array of unsigned int; Transfer from this set of subaddresses.
* *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. -- Ignored
* *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: * *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.
* *fee_list* - array of: integer. The amount of fees paid for every transaction. Outputs: *None*.
* *tx_hash_list* - array of: string. The tx hashes of every transaction.
* *tx_blob_list* - array of: string. The tx as hex string for every transaction.
* *amount_list* - array of: integer. The amount transferred for every transaction..
* *tx_key_list* - array of: string. The transaction keys 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).
Example: Example:
``` ```
$ 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' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"fee_list": [97916962422],
"tx_hash_list": ["c5c389846e701c27aaf1f7ab8b9dc457b471fcea5bc9710e8020d51275afbc54"]
} }
} }
``` ```
### **get_accounts**
### **sweep_dust** Get all accounts for a wallet. Optionally filter accounts by tag.
Send all dust outputs back to the wallet's, to make them easier to spend (and mix). Alias: *None*.
Inputs: *None*. Inputs:
Outputs: * *tag* - string; (Optional) Tag for filtering accounts.
* *tx_hash_list* - list of: string Outputs:
Example (In this example, `sweep_dust` returns an error due to insufficient funds to sweep): * *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://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust"}' -H 'Content-Type: application/json' $ 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'
{ {
"error": {
"code": -4,
"message": "not enough money"
},
"id": "0", "id": "0",
"jsonrpc": "2.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
}
} }
``` ```
### **sweep_all**
Send all unlocked balance to an address. ### **create_account**
Create a new account with an optional label.
Alias: *None*.
Inputs: Inputs:
* *address* - string; Destination public address. * *label* - string; (Optional) Label for the account.
* *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).
* *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.
* *get_tx_hex* - boolean; (Optional) return the transactions as hex encoded string.
* *get_tx_metadata* - boolean; (Optional) return the transaction metadata as a string.
Outputs: Outputs:
* *tx_hash_list* - array of string; List of transaction hashes used as transaction IDs. * *account_index* - unsigned int; Index of the new account.
* *tx_key_list* - array of string; List of public and private transaction keys. * *address* - string; Address for this account. Base58 representation of the public keys.
* *tx_blob_list* - array of string; List of transactions represented as a hex blob.
* *tx_metadata_list* - array of string; Transaction metadata needed for relaying.
* *multisig_txset* - string; Set of multisig transactions in the process of being signed.
Example: Example:
``` ```
$ 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' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"tx_hash_list": ["53a3648797d5524dd037d4105e067fa61468faecab41927fc43adbb26c202d22"], "account_index": 1,
"tx_key_list": ["e83b3b78235e36cd7e4d9695efd81a3b3e64c7d1f1ebd61892f0a7add6a50301"] "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp"
} }
} }
``` ```
### **store**
Save the blockchain. ### **label_account**
Inputs: *None*. 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*. Outputs: *None*.
Example: 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' $ 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", "id": "0",
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"account_tags": [{
"accounts": [0,1],
"label": "",
"tag": "myTag"
}]
} }
} }
``` ```
### **get_payments** ### **get_account_tags**
Get a list of incoming payments using a given payment id. Get a list of user-defined account tags.