Documentación del Monedero RPC

Esta página aún no ha sido traducida. Si deseas ayudar a traducirla, por favor lee el archivo README.

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:


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": ["ab4b6b65cc8cd8c9dd317d0b90d97582d6