Wallet RPC Guide - Old
This is a list of the beldex-wallet-rpc calls, their inputs and outputs, and examples of each. The program beldex-wallet-rpc replaced the rpc interface that was in simplewallet and then beldex-wallet-cli.
All beldex-wallet-rpc methods use the same JSON RPC interface. For example:
IP=127.0.0.1
PORT=19092
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 beldex-wallet-rpc was executed with the
--rpc-login
argument as username:password
, then follow this example:IP=127.0.0.1
PORT=19092
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 BDX according to the beldexd implementation. 1 BDX = 1e9 atomic units.
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 beldex-wallet-rpc in session.
- unlocked_balance - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the beldex 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:19092/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": "83LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"address_index": 0,
"balance": 157360317826255077,
"label": "Primary account",
"num_unspent_outputs": 5281,
"unlocked_balance": 157360317826255077
},{
"address": "8BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o",
"address_index": 1,
"balance": 59985211200000,
"label": "",
"num_unspent_outputs": 1,
"unlocked_balance": 59985211200000
}],
"unlocked_balance": 157443303037455077
}
}
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 beldex-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:19092/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": "83LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"addresses": [{
"address": "83LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"address_index": 0,
"label": "Primary account",
"used": true
},{
"address": "8BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o",
"address_index": 1,
"label": "",
"used": true
},{
"address": "87xa6Dha7kzCQuvmd8iB5VYoMkdenwCNRU9khGhExXQ8KLL3z1N1ZATBD1sFPenyHWT9cm4fVFnCAUApY53peuoZFtwZiw5",
"address_index": 4,
"label": "test2",
"used": true
}]
}
}
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:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"8BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}}' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"index": {
"major": 0,
"minor": 1
}
}
}
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:19092/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 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:19092/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 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:19092/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": "83LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"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 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:19092/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 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:19092/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 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:19092/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"
}]
}
}
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:19092/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": {
}
}
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:19092/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 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:19092/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": {
}
}
Returns the wallet's current block height.
Alias: getheight.
Inputs: None.
Outputs:
- height - unsigned int; The current beldex-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:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"height": 145545
}
}
Send beldex to a number of recipients.
Alias: None.
Inputs:
- destinations - array of destinations to receive BDX:
- 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 0)
- priority - unsigned int; Set a priority for the transaction. Accepted Values are: 0 and 1 for: flash and unimportant.
- 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 beldex 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 beldex 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:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"8BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":200000000000,"address":"75sNpRwUtekcJGejMuLSGA71QFuK1qcCVLZnYRTfQLgFU5nJ7xiAHtR5ihioS53KMe8pBhH61moraZHyLoG4G7fMER8xkNv"}],"account_index":0,"subaddr_indices":[0],"priority":1,"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": ""
}
}
Same as transfer, but can split into more than one tx if necessary.
Alias: None.
Inputs:
- destinations - array of destinations to receive BDX:
- 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 0)
- 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 beldex 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 beldex 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:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":1000000000000,"address":"8BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"},{"amount":2000000000000,"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_list": [3000000000000],
"fee_list": [85106400000],
"multisig_txset": "",
"tx_hash_list": ["c8d815f48f27d53fdaf198a74b292a91bfaf87529a9a9a9ee66079a890b3b58b"],
"unsigned_txset": ""
}
}
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:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000000000000,"address":"8BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o"}],"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:19092/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 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:19092/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"]
}
}
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 beldex 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:19092/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": ""
}
}
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 beldex 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:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"83LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt","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": ""
}
}
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 beldex 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:19092/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 a transaction previously created with
"do_not_relay":true
.Alias: None.
Inputs:
- hex - string; transaction metadata returned from a
transfer
method withget_tx_metadata
set totrue
.
Outputs:
- tx_hash - String for the publically searchable transaction hash.
Example:
$ curl -X POST http://localhost:19092/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"
}
}
Save the wallet file.
Alias: None.
Inputs: None.
Outputs: None.
Example:
$ curl -X POST http://127.0.0.1:19092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json'
{
"id": "0",
"jsonrpc": "2.0",
"result": {
}
}
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:19092/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",