JSON RPC Methods
Introduction
This is a list of the xcash-wallet-rpc calls, their inputs and outputs, and examples of each. The program xcash-wallet-rpc replaced the rpc interface that was in simplewallet and then xcash-wallet-rpc.
All xcash-wallet-rpc methods use the same JSON RPC interface. For example:
Copy IP=127.0.0.1PORT=18082METHOD="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 xcash-wallet-rpc was executed with the --rpc-login
argument as username:password
, then follow this example:
Copy IP=127.0.0.1PORT=18082METHOD="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 XCASH according to the xcashd implementation. 1 XCASH = 1e6 atomic units **.**
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 xcash-wallet-rpc in session.
unlocked_balance - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the X-Cash 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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance"}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"balance" : 562072541031,
"multisig_import_needed" : false ,
"per_subaddress" : [
{
"address": "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe",
"address_index" : 0,
"balance" : 562072541031,
"label" : "Primary account" ,
"num_unspent_outputs" : 3,
"unlocked_balance" : 562072541031
}
],
"unlocked_balance" : 562072541031
}
}
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 xcash-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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address"}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"address" : "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe" ,
"addresses" : [
{
"address": "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe",
"address_index" : 0,
"label" : "Primary account" ,
"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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"83nWyFM8HtqikdcFPXhfj3Z7Jvh1LDjfe7B1Fo6bUNUZMjm1JTXcnyzb3iiqUHLkcAQ5t6b5u8WhgTFNuzEpL27C3CvD1d8"}}' -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:
Copy $ curl -X POST http://localhost:18285/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" : "83nWyFM8HtqikdcFPXhfj3Z7Jvh1LDjfe7B1Fo6bUNUZMjm1JTXcnyzb3iiqUHLkcAQ5t6b5u8WhgTFNuzEpL27C3CvD1d8" ,
"address_index" : 1
}
}
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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"label_address","params":{"index":{"major":0,"minor":1},"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 :
Copy $ curl -X POST http://localhost:18285/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" : 100000000000,
"base_address": "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe",
"label" : "Primary account" ,
"tag" : "myTag" ,
"unlocked_balance" : 100000000000
},
{
"account_index" : 1,
"balance" : 0,
"base_address": "83nWyFM8HtqikdcFPXhfj3Z7Jvh1LDjfe7B1Fo6bUNUZMjm1JTXcnyzb3iiqUHLkcAQ5t6b5u8WhgTFNuzEpL27C3CvD1d8",
"label" : "Secondary account" ,
"tag" : "myTag" ,
"unlocked_balance" : 0
}
],
"total_balance" : 100000000000,
"total_unlocked_balance" : 100000000000
}
}
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 :
Copy $ curl -X POST http://localhost:18285/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" : "83nWyFM8HtqikdcFPXhfj3Z7Jvh1LDjfe7B1Fo6bUNUZMjm1JTXcnyzb3iiqUHLkcAQ5t6b5u8WhgTFNuzEpL27C3CvD1d8"
}
}
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 :
Copy $ curl -X POST http://localhost:18285/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" : "label"
}
]
}
}
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 :
Copy $ curl -X POST http://localhost:18285/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"
}
]
}
}
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 :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/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 xcash-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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"height" : 425000
}
}
transfer
Send XCASH to a number of recipients.
Alias : None .
Inputs :
destinations - array of destinations to receive XCASH:
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 XCASH 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 X-Cash 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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":100000000000,"address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe"}],"ring_size":21,"get_tx_keys": true}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"amount" : 100000000000,
"fee" : 1348040,
"multisig_txset" : "" ,
"tx_hash" : "cd97adf7372e620cda46ed623f89fca1411873f5d7251359ab468c287d8f9fee" ,
"tx_key" : "8037f31fd7b9c76d432e6c0c14b549ea68fdd84537f75c6e9a066890f7840d0b" ,
"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 XCASH:
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 XCASH 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 X-Cash 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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations":[{"amount":100000000000,"address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe"}],"ring_size":21,"get_tx_keys": true}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"amount_list" : [
100000000000
],
"fee_list" : [
1348040
],
"multisig_txset" : "" ,
"tx_hash_list" : [
"cd97adf7372e620cda46ed623f89fca1411873f5d7251359ab468c287d8f9fee"
],
"tx_key_list" : [
"8037f31fd7b9c76d432e6c0c14b549ea68fdd84537f75c6e9a066890f7840d0b"
],
"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:
Copy curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign_transfer","params":{"unsigned_txset":"0200010200158b9c3dc885308d9024ec8302c2e5109ad803d3f801de53d21493738e1f90e701dc5e801302d8161a8105be042aa807cb560557a7d0d4898cc6fd0c0d35e77bcf839ba9b235ec3674bf00cb90f32a8b0200020b85f8bb5eae185399c32fee2ef11e3a10fed9b998280d9ef2161c70b1f353c50002417be46e074735ed3d5c7147aa472e9c14a401b9ebd58985d20e5f6eeb70e4d72101f27d6926626deaf4506c94ff24f0abe117dbd54c4f28da7a1b13047b6b2878a403fae733aa829ee9d1fc948e393f3d7368cb537e00290732c46adc46e441d2c275cdd606c19730f020ee0da02dbd90d4cd4ce7abac0413c8d51f21f7fea951a963cb33083359a00a3180d734589aec044d7d37278fb3f469fdde70156a8803df822a1e0f441426e7d933e18aeb25e58acc8e58b36d33927775501bbf1bbf32483a1ce00b21795f315cd231b11fe58e6c8407bb21d19250b91754a94606e73e12a88c7600115b5af4112e3830928dec18a552ecee1640ecdd7157f37b5fe9aeb83321c7c7010000004fda960fdb48fd706038d36af0e134ff6e770993295261af08feca3ef13394a32999b0ed41d8628b3d474a91fbec325cfef5ed11e8f3bd77e7d9a9a66e4adafc0385491182a5ef73957497f1dd3c2b680b8e63ad869efa209f43b6322770d58220ed31a3f7a9489535a75a88f9f06c5a63d1028a5b56e72e2ae152f15ac65e12e3bd1cc54f2a6bb8383c8850c29a525a30d5f99d41788fb5a7f5eef69244ec06820d2ec4507b4ca2d15970d063fc8e1edef757a647f225b865092295252ab10d07559ce962bab5b5317d9e5714b2423c7b2181fe989071f858dec30ecf1ab5e4430b8764c2a6f6190c9806563ae80090adf044d28316731f7e4e56a75dcee9e5640f27cf889413e22971496edacf434ea5dc1acee029be37f71c1531ccf5af45632f658a5406a6c0de9804fc12ccb40168f2dbddf7f086e58ac6acd79c868ef865f037cd75d072466b892df28812b4ad0c397b0dc1bc1b2ba6a924117f210851419a1f95fb63f88afdf1bdd52e1d65d010632b119bedbc2ea91ea99886bec9612047f4210c3b608edaf97ee6734a7cf22a6dde09c6a36b628f67f7058614f67444076003291b8df917842102167bbf28a9c6d074e68ecfc40ba55371355f2231b5363304836b9faf7fdeeb16f5739c05b310d434235044bf1216a242fcc6faeee198a12480283e8b438c02a3f0ff9cae741a1d4207c26799f0df255639d36ba3a0546f0e7017ca557ad680f77d5ff77ba434ae55db821c5579cf00d63185c1c477bee35e8a2cce838939b0e849182c486d8915f003f130f16d233f3f404ffac45f8436e80058e1b81ce3c3b326f57bd878d6b748914d670557353bca7f98d53fdf57782c65223aed33d0aeadc777120979ade3fb429b5a5486c967f4c2c63b5686a6a38cf329858f82b4d33be6df08419e97c1872a6c6191d5811b679d2827fb3306f9b634f7898b0207868c77e0a6033df229ec2ee28cd2c79ba01e49b67955300891e95765c53c25d3a7ceca2d4fab3944d30407797e01996d23b1ef2188bfd00662251c3f137bab02e4a831c47d722043ba4c780e5fa7d70e36968b7254b36d04ed82577fffb738086390eae9be1b800e8c19df14565ab13f4cda135220bf4a087604caa94cb26bf32ec920a2d19899b16c7d48acf285b80ebf412ed76b485f0c0b87cd272fe6fc80a82c98326397bcd408013113cbecca24ba03c36142ceb40d9d7b3ce7c9eeb71fa8c21e52cade31567c20acfa535250d1d95493c6f1e18902a5afbb5efc96a62b9d03a782536399f67a068c60d5b87144702debde82652c0f60e8298b66130176e39ef2dc754e11e498363b43a50655fc5d8a0ad07b93710d653e9ba5bda4772b2fef001990babfcaef513cb2b4f7dfc4d14cd79ca7cc6306545ac279b87a08dcedfabba270505fa6b60de12c29dd62d6bda33614e0ff6d00fd143259ae424d7a74b506b13cec4d16cd6519199862dfe2d768b6024c2a0703260e696f84a755b96272b314d2c9614c90ed4389beae781b9abed3801e047b042c5f6c1c7273737835b94c281766a7086692c339c9a18425cbc4060f1c1b9f0e3eab4bc3f891bc7c245aec18045eb0ed133acec748c390469470efc2f1a33c04f0879e027f878b7407ca7f42a847b180972d918d8eb2f8d06369d9dba6c5990b845ead58e131475206ff350764eebc4139f19d154eb08a7de8cb462f8d844f04f62a2548dd3db4810adf6cecbf310567e37c024e7f0593819b76c1c762b41c022a761c2dc9908e2dc478413ca6856b2436df96fc642e16766dfe531f19153c05923e3400b0f901194368f58bbcd3484fff84c470d883fc92568d8c3a7148aa07710fcfe514c713656dd14a088affafab9dede3a944690a4829d1a68e1edc7600c383de90edd1953fbf6a3c15e84ec051099748972b8f500e802ae4863bdde60240423a915ecec3eab9510d8aca86799400d8cd04e973f80d63431aeec1566d0240e744ba43acdb16c5b7207f42709f3880c2ac29610612bc182a81a85979ad0f4f2fdbc1c473910b9c3ae4266e72f84a08ccd566fa784d6da09d1666678eba0ad949d8c7bc57a81ba1b2fcff0fc5ecdacf42a04536fbac5293e27311aa5d0203fca71abb60ed9a6d0061855a6df3eb4a99dda032c3556a9dd4acffa42757230aa24d4cae9dae3e81e1e426ff8ae861691c08e62af5c9b7fee1bb589c98f42f0cc4ce92b77c6e4e5831cc7f1ea0e25dd5bcb9d348eee806867fc80345c2e0e80ff842faf0c679f972278112e2d12a6639229df57df429a49874ce2f419a60f801a50026424729413455372aa1adf14b8c33b194e91ec303a4448c4eadf9a1070d668c71c5b8bae28fbb4a7b6ee9924a351ddbd6cef575b5a68afcb0cd218d480861a3fa8dc4075acd9efa7909da095a030e2fc03be2400ae1a4e93778c0ca7f0ba4daf0f80c4308012f209d1ae36970ac8e70a17378ae981b8f12ea534948fe056b51a3dc4e2b69090d8dac19d80b00bf9f4f0a3d895e8df59c62c9eda4919e0e9080d32848a4b390b106ae3584c552b75719bd43bbeacb6632ba0938ecf5500998beae51b9993323ab0f9757f3b0c0495f5869d3b0baefac8fc41796290df30b8890f75a1d814329e26851c510cf8e8c4f38492638426491e05c68ad08c0480faf2f0713de768f50e4d98aeb16b6b40943bf4e59f872e8e97a3ff18efae11e0593af8a09401e3afbb43256e1514001c529bfa6b6b2ef1c0822baa5ede92c2c08a0464f4330811390bfe0e52bd296225b5ab0c232078961f2d27dc834b1f61c05b06f213c0623e4d924ff7e1658680ef61263b17a16b3730b2f007f1e01a39e00c7048f8bb0ad785c8f3b0e54f0453dc47f96103d4440cda66f6c508a251907034d7c051d328006bf561133f3f13972fdfc0ba2392baf6852bc106ffc7c2d3d0f9d487e464971ca43827b60cee910a5e51c81235c3b0c8fc217ccba75698f6a02aa5fba840617f4f412e288f90f3b5a26cee7ebe25d603b8d69ac4ee98e6e927d"}}' -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:
Copy curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"submit_transfer","params":{"tx_data_hex":"0200010200158b9c3dc885308d9024ec8302c2e5109ad803d3f801de53d21493738e1f90e701dc5e801302d8161a8105be042aa807cb560557a7d0d4898cc6fd0c0d35e77bcf839ba9b235ec3674bf00cb90f32a8b0200020b85f8bb5eae185399c32fee2ef11e3a10fed9b998280d9ef2161c70b1f353c50002417be46e074735ed3d5c7147aa472e9c14a401b9ebd58985d20e5f6eeb70e4d72101f27d6926626deaf4506c94ff24f0abe117dbd54c4f28da7a1b13047b6b2878a403fae733aa829ee9d1fc948e393f3d7368cb537e00290732c46adc46e441d2c275cdd606c19730f020ee0da02dbd90d4cd4ce7abac0413c8d51f21f7fea951a963cb33083359a00a3180d734589aec044d7d37278fb3f469fdde70156a8803df822a1e0f441426e7d933e18aeb25e58acc8e58b36d33927775501bbf1bbf32483a1ce00b21795f315cd231b11fe58e6c8407bb21d19250b91754a94606e73e12a88c7600115b5af4112e3830928dec18a552ecee1640ecdd7157f37b5fe9aeb83321c7c7010000004fda960fdb48fd706038d36af0e134ff6e770993295261af08feca3ef13394a32999b0ed41d8628b3d474a91fbec325cfef5ed11e8f3bd77e7d9a9a66e4adafc0385491182a5ef73957497f1dd3c2b680b8e63ad869efa209f43b6322770d58220ed31a3f7a9489535a75a88f9f06c5a63d1028a5b56e72e2ae152f15ac65e12e3bd1cc54f2a6bb8383c8850c29a525a30d5f99d41788fb5a7f5eef69244ec06820d2ec4507b4ca2d15970d063fc8e1edef757a647f225b865092295252ab10d07559ce962bab5b5317d9e5714b2423c7b2181fe989071f858dec30ecf1ab5e4430b8764c2a6f6190c9806563ae80090adf044d28316731f7e4e56a75dcee9e5640f27cf889413e22971496edacf434ea5dc1acee029be37f71c1531ccf5af45632f658a5406a6c0de9804fc12ccb40168f2dbddf7f086e58ac6acd79c868ef865f037cd75d072466b892df28812b4ad0c397b0dc1bc1b2ba6a924117f210851419a1f95fb63f88afdf1bdd52e1d65d010632b119bedbc2ea91ea99886bec9612047f4210c3b608edaf97ee6734a7cf22a6dde09c6a36b628f67f7058614f67444076003291b8df917842102167bbf28a9c6d074e68ecfc40ba55371355f2231b5363304836b9faf7fdeeb16f5739c05b310d434235044bf1216a242fcc6faeee198a12480283e8b438c02a3f0ff9cae741a1d4207c26799f0df255639d36ba3a0546f0e7017ca557ad680f77d5ff77ba434ae55db821c5579cf00d63185c1c477bee35e8a2cce838939b0e849182c486d8915f003f130f16d233f3f404ffac45f8436e80058e1b81ce3c3b326f57bd878d6b748914d670557353bca7f98d53fdf57782c65223aed33d0aeadc777120979ade3fb429b5a5486c967f4c2c63b5686a6a38cf329858f82b4d33be6df08419e97c1872a6c6191d5811b679d2827fb3306f9b634f7898b0207868c77e0a6033df229ec2ee28cd2c79ba01e49b67955300891e95765c53c25d3a7ceca2d4fab3944d30407797e01996d23b1ef2188bfd00662251c3f137bab02e4a831c47d722043ba4c780e5fa7d70e36968b7254b36d04ed82577fffb738086390eae9be1b800e8c19df14565ab13f4cda135220bf4a087604caa94cb26bf32ec920a2d19899b16c7d48acf285b80ebf412ed76b485f0c0b87cd272fe6fc80a82c98326397bcd408013113cbecca24ba03c36142ceb40d9d7b3ce7c9eeb71fa8c21e52cade31567c20acfa535250d1d95493c6f1e18902a5afbb5efc96a62b9d03a782536399f67a068c60d5b87144702debde82652c0f60e8298b66130176e39ef2dc754e11e498363b43a50655fc5d8a0ad07b93710d653e9ba5bda4772b2fef001990babfcaef513cb2b4f7dfc4d14cd79ca7cc6306545ac279b87a08dcedfabba270505fa6b60de12c29dd62d6bda33614e0ff6d00fd143259ae424d7a74b506b13cec4d16cd6519199862dfe2d768b6024c2a0703260e696f84a755b96272b314d2c9614c90ed4389beae781b9abed3801e047b042c5f6c1c7273737835b94c281766a7086692c339c9a18425cbc4060f1c1b9f0e3eab4bc3f891bc7c245aec18045eb0ed133acec748c390469470efc2f1a33c04f0879e027f878b7407ca7f42a847b180972d918d8eb2f8d06369d9dba6c5990b845ead58e131475206ff350764eebc4139f19d154eb08a7de8cb462f8d844f04f62a2548dd3db4810adf6cecbf310567e37c024e7f0593819b76c1c762b41c022a761c2dc9908e2dc478413ca6856b2436df96fc642e16766dfe531f19153c05923e3400b0f901194368f58bbcd3484fff84c470d883fc92568d8c3a7148aa07710fcfe514c713656dd14a088affafab9dede3a944690a4829d1a68e1edc7600c383de90edd1953fbf6a3c15e84ec051099748972b8f500e802ae4863bdde60240423a915ecec3eab9510d8aca86799400d8cd04e973f80d63431aeec1566d0240e744ba43acdb16c5b7207f42709f3880c2ac29610612bc182a81a85979ad0f4f2fdbc1c473910b9c3ae4266e72f84a08ccd566fa784d6da09d1666678eba0ad949d8c7bc57a81ba1b2fcff0fc5ecdacf42a04536fbac5293e27311aa5d0203fca71abb60ed9a6d0061855a6df3eb4a99dda032c3556a9dd4acffa42757230aa24d4cae9dae3e81e1e426ff8ae861691c08e62af5c9b7fee1bb589c98f42f0cc4ce92b77c6e4e5831cc7f1ea0e25dd5bcb9d348eee806867fc80345c2e0e80ff842faf0c679f972278112e2d12a6639229df57df429a49874ce2f419a60f801a50026424729413455372aa1adf14b8c33b194e91ec303a4448c4eadf9a1070d668c71c5b8bae28fbb4a7b6ee9924a351ddbd6cef575b5a68afcb0cd218d480861a3fa8dc4075acd9efa7909da095a030e2fc03be2400ae1a4e93778c0ca7f0ba4daf0f80c4308012f209d1ae36970ac8e70a17378ae981b8f12ea534948fe056b51a3dc4e2b69090d8dac19d80b00bf9f4f0a3d895e8df59c62c9eda4919e0e9080d32848a4b390b106ae3584c552b75719bd43bbeacb6632ba0938ecf5500998beae51b9993323ab0f9757f3b0c0495f5869d3b0baefac8fc41796290df30b8890f75a1d814329e26851c510cf8e8c4f38492638426491e05c68ad08c0480faf2f0713de768f50e4d98aeb16b6b40943bf4e59f872e8e97a3ff18efae11e0593af8a09401e3afbb43256e1514001c529bfa6b6b2ef1c0822baa5ede92c2c08a0464f4330811390bfe0e52bd296225b5ab0c232078961f2d27dc834b1f61c05b06f213c0623e4d924ff7e1658680ef61263b17a16b3730b2f007f1e01a39e00c7048f8bb0ad785c8f3b0e54f0453dc47f96103d4440cda66f6c508a251907034d7c051d328006bf561133f3f13972fdfc0ba2392baf6852bc106ffc7c2d3d0f9d487e464971ca43827b60cee910a5e51c81235c3b0c8fc217ccba75698f6a02aa5fba840617f4f412e288f90f3b5a26cee7ebe25d603b8d69ac4ee98e6e927d"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"tx_hash_list" : [
"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8"
]
}
}
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 X-Cash 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):
Copy $ curl -X POST http://localhost:18285/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 XCASH 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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params":{"address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe","ring_size":21}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"amount_list" : [
100000000000
],
"fee_list" : [
1348040
],
"multisig_txset" : "" ,
"tx_hash_list" : [
"cd97adf7372e620cda46ed623f89fca1411873f5d7251359ab468c287d8f9fee"
],
"tx_key_list" : [
"8037f31fd7b9c76d432e6c0c14b549ea68fdd84537f75c6e9a066890f7840d0b"
],
"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 XCASH 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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_single","params":{"destinations":[{"amount":100000000000,"address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe"}],"ring_size":21,"get_tx_keys": true}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"amount" : 100000000000,
"fee" : 1348040,
"multisig_txset" : "" ,
"tx_hash" : "cd97adf7372e620cda46ed623f89fca1411873f5d7251359ab468c287d8f9fee" ,
"tx_key" : "8037f31fd7b9c76d432e6c0c14b549ea68fdd84537f75c6e9a066890f7840d0b" ,
"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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"relay_tx","params":{"hex":"0200010200158b9c3dc885308d9024ec8302c2e5109ad803d3f801de53d21493738e1f90e701dc5e801302d8161a8105be042aa807cb560557a7d0d4898cc6fd0c0d35e77bcf839ba9b235ec3674bf00cb90f32a8b0200020b85f8bb5eae185399c32fee2ef11e3a10fed9b998280d9ef2161c70b1f353c50002417be46e074735ed3d5c7147aa472e9c14a401b9ebd58985d20e5f6eeb70e4d72101f27d6926626deaf4506c94ff24f0abe117dbd54c4f28da7a1b13047b6b2878a403fae733aa829ee9d1fc948e393f3d7368cb537e00290732c46adc46e441d2c275cdd606c19730f020ee0da02dbd90d4cd4ce7abac0413c8d51f21f7fea951a963cb33083359a00a3180d734589aec044d7d37278fb3f469fdde70156a8803df822a1e0f441426e7d933e18aeb25e58acc8e58b36d33927775501bbf1bbf32483a1ce00b21795f315cd231b11fe58e6c8407bb21d19250b91754a94606e73e12a88c7600115b5af4112e3830928dec18a552ecee1640ecdd7157f37b5fe9aeb83321c7c7010000004fda960fdb48fd706038d36af0e134ff6e770993295261af08feca3ef13394a32999b0ed41d8628b3d474a91fbec325cfef5ed11e8f3bd77e7d9a9a66e4adafc0385491182a5ef73957497f1dd3c2b680b8e63ad869efa209f43b6322770d58220ed31a3f7a9489535a75a88f9f06c5a63d1028a5b56e72e2ae152f15ac65e12e3bd1cc54f2a6bb8383c8850c29a525a30d5f99d41788fb5a7f5eef69244ec06820d2ec4507b4ca2d15970d063fc8e1edef757a647f225b865092295252ab10d07559ce962bab5b5317d9e5714b2423c7b2181fe989071f858dec30ecf1ab5e4430b8764c2a6f6190c9806563ae80090adf044d28316731f7e4e56a75dcee9e5640f27cf889413e22971496edacf434ea5dc1acee029be37f71c1531ccf5af45632f658a5406a6c0de9804fc12ccb40168f2dbddf7f086e58ac6acd79c868ef865f037cd75d072466b892df28812b4ad0c397b0dc1bc1b2ba6a924117f210851419a1f95fb63f88afdf1bdd52e1d65d010632b119bedbc2ea91ea99886bec9612047f4210c3b608edaf97ee6734a7cf22a6dde09c6a36b628f67f7058614f67444076003291b8df917842102167bbf28a9c6d074e68ecfc40ba55371355f2231b5363304836b9faf7fdeeb16f5739c05b310d434235044bf1216a242fcc6faeee198a12480283e8b438c02a3f0ff9cae741a1d4207c26799f0df255639d36ba3a0546f0e7017ca557ad680f77d5ff77ba434ae55db821c5579cf00d63185c1c477bee35e8a2cce838939b0e849182c486d8915f003f130f16d233f3f404ffac45f8436e80058e1b81ce3c3b326f57bd878d6b748914d670557353bca7f98d53fdf57782c65223aed33d0aeadc777120979ade3fb429b5a5486c967f4c2c63b5686a6a38cf329858f82b4d33be6df08419e97c1872a6c6191d5811b679d2827fb3306f9b634f7898b0207868c77e0a6033df229ec2ee28cd2c79ba01e49b67955300891e95765c53c25d3a7ceca2d4fab3944d30407797e01996d23b1ef2188bfd00662251c3f137bab02e4a831c47d722043ba4c780e5fa7d70e36968b7254b36d04ed82577fffb738086390eae9be1b800e8c19df14565ab13f4cda135220bf4a087604caa94cb26bf32ec920a2d19899b16c7d48acf285b80ebf412ed76b485f0c0b87cd272fe6fc80a82c98326397bcd408013113cbecca24ba03c36142ceb40d9d7b3ce7c9eeb71fa8c21e52cade31567c20acfa535250d1d95493c6f1e18902a5afbb5efc96a62b9d03a782536399f67a068c60d5b87144702debde82652c0f60e8298b66130176e39ef2dc754e11e498363b43a50655fc5d8a0ad07b93710d653e9ba5bda4772b2fef001990babfcaef513cb2b4f7dfc4d14cd79ca7cc6306545ac279b87a08dcedfabba270505fa6b60de12c29dd62d6bda33614e0ff6d00fd143259ae424d7a74b506b13cec4d16cd6519199862dfe2d768b6024c2a0703260e696f84a755b96272b314d2c9614c90ed4389beae781b9abed3801e047b042c5f6c1c7273737835b94c281766a7086692c339c9a18425cbc4060f1c1b9f0e3eab4bc3f891bc7c245aec18045eb0ed133acec748c390469470efc2f1a33c04f0879e027f878b7407ca7f42a847b180972d918d8eb2f8d06369d9dba6c5990b845ead58e131475206ff350764eebc4139f19d154eb08a7de8cb462f8d844f04f62a2548dd3db4810adf6cecbf310567e37c024e7f0593819b76c1c762b41c022a761c2dc9908e2dc478413ca6856b2436df96fc642e16766dfe531f19153c05923e3400b0f901194368f58bbcd3484fff84c470d883fc92568d8c3a7148aa07710fcfe514c713656dd14a088affafab9dede3a944690a4829d1a68e1edc7600c383de90edd1953fbf6a3c15e84ec051099748972b8f500e802ae4863bdde60240423a915ecec3eab9510d8aca86799400d8cd04e973f80d63431aeec1566d0240e744ba43acdb16c5b7207f42709f3880c2ac29610612bc182a81a85979ad0f4f2fdbc1c473910b9c3ae4266e72f84a08ccd566fa784d6da09d1666678eba0ad949d8c7bc57a81ba1b2fcff0fc5ecdacf42a04536fbac5293e27311aa5d0203fca71abb60ed9a6d0061855a6df3eb4a99dda032c3556a9dd4acffa42757230aa24d4cae9dae3e81e1e426ff8ae861691c08e62af5c9b7fee1bb589c98f42f0cc4ce92b77c6e4e5831cc7f1ea0e25dd5bcb9d348eee806867fc80345c2e0e80ff842faf0c679f972278112e2d12a6639229df57df429a49874ce2f419a60f801a50026424729413455372aa1adf14b8c33b194e91ec303a4448c4eadf9a1070d668c71c5b8bae28fbb4a7b6ee9924a351ddbd6cef575b5a68afcb0cd218d480861a3fa8dc4075acd9efa7909da095a030e2fc03be2400ae1a4e93778c0ca7f0ba4daf0f80c4308012f209d1ae36970ac8e70a17378ae981b8f12ea534948fe056b51a3dc4e2b69090d8dac19d80b00bf9f4f0a3d895e8df59c62c9eda4919e0e9080d32848a4b390b106ae3584c552b75719bd43bbeacb6632ba0938ecf5500998beae51b9993323ab0f9757f3b0c0495f5869d3b0baefac8fc41796290df30b8890f75a1d814329e26851c510cf8e8c4f38492638426491e05c68ad08c0480faf2f0713de768f50e4d98aeb16b6b40943bf4e59f872e8e97a3ff18efae11e0593af8a09401e3afbb43256e1514001c529bfa6b6b2ef1c0822baa5ede92c2c08a0464f4330811390bfe0e52bd296225b5ab0c232078961f2d27dc834b1f61c05b06f213c0623e4d924ff7e1658680ef61263b17a16b3730b2f007f1e01a39e00c7048f8bb0ad785c8f3b0e54f0453dc47f96103d4440cda66f6c508a251907034d7c051d328006bf561133f3f13972fdfc0ba2392baf6852bc106ffc7c2d3d0f9d487e464971ca43827b60cee910a5e51c81235c3b0c8fc217ccba75698f6a02aa5fba840617f4f412e288f90f3b5a26cee7ebe25d603b8d69ac4ee98e6e927d"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"tx_hash" : "f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8"
}
}
store
Save the wallet file.
Alias : None .
Inputs : None .
Outputs : None .
Example :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"0000000000000000000000000000000000000000000000000000000000000000"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"payments" : [
{
"address" : "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe" ,
"amount" : 12000000000,
"block_height" : 358092,
"payment_id" : "0000000000000000000000000000000000000000000000000000000000000000" ,
"subaddr_index" : {
"major" : 0,
"minor" : 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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["0000000000000000000000000000000000000000000000000000000000000000"],"min_block_height":"120000"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"payments" : [
{
"address" : "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe" ,
"amount" : 12000000000,
"block_height" : 358092,
"payment_id" : "0000000000000000000000000000000000000000000000000000000000000000" ,
"subaddr_index" : {
"major" : 0,
"minor" : 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:
Copy $ curl -X POST http://localhost:18285/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" : 362070234101,
"global_index" : 2864114,
"key_image" : "1fbc053e189764f562afcb27299f4b48c8c8658d08dd528abe2e0826ee5e91d7" ,
"spent" : false ,
"subaddr_index" : {
"major" : 0,
"minor" : 0
},
"tx_hash" : "f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8"
}
]
}
}
Example , get available transfers:
Copy $ curl -X POST http://localhost:18285/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:
Copy $ curl -X POST http://localhost:18285/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 OR "spend_key" - the spend key
Outputs :
key - string; The view key will be hex encoded, while the mnemonic will be a string of words.
Example (Query view key):
Copy $ curl -X POST http://localhost:18285/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" : "93d7bf52dfea9da0b35b7da923bd1ca9d4db4cf5c925c261ba0b6274c3fa9208"
}
}
Example (Query mnemonic key):
Copy $ curl -X POST http://localhost:18285/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": "arena eight cool bugs sieve bovine feline pledge affair aptitude yeti gnaw gadget saved cunning sadness apricot pruned foxes gags eagle pelican hippo hunter gags"
}
}
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):
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address"}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"integrated_address": "XCBzxZ866QF438An6FUXHM1RGetpTT4Ek9kaA9afPTXaetKq9wsacaEc3rb5TM85kJBn1qv2NxPw12Mr24uB2cDwBt6ZwDMxS9rfRf6W4oTcwC",
"payment_id" : "f8784e5de5ba9075"
}
}
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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address": "XCBzxZ866QF438An6FUXHM1RGetpTT4Ek9kaA9afPTXaetKq9wsacaEc3rb5TM85kJBn1qv2NxPw12Mr24uB2cDwBt6ZwDMxS9rfRf6W4oTcwC"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"is_subaddress" : false ,
"payment_id" : "f8784e5de5ba9075" ,
"standard_address": "XCA1TzWy4E57dGZtVdciKsNV3rbAVTxgsEiH1bqv5aX3NNSVGavL2zUQN3k1i7pFifKFQ91ZtDjzf6TC7i6FwABA1Wr2ffSy6R"
}
}
stop_wallet
Stops the wallet, storing the current state.
Alias : None .
Inputs : None .
Outputs : None .
Example :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8"],"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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8"]}}' -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 :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"tx_key" : "81ba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06"
}
}
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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_key","params":{"txid":"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8","tx_key":"81ba662cf8fb6d0d0da18fc9b70ab28e01cc76311278fdd7fe7ab16360762b06","address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"confirmations" : 0,
"in_pool" : false ,
"received" : 100000000000
}
}
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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8","address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe","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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_tx_proof","params":{"txid":"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8","address":"XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe","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
}
}
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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_spend_proof","params":{"txid":"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8","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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_spend_proof","params":{"txid":"f00426a332ab8eea7b0d8d219fd955b87debb49b1ff4d18d831bbe25426152e8","message":"this is my transaction","signature":"SpendProofV1aSh8Todhk54736iXgV6vJAFP7egxByuMWZeyNDaN2JY737S95X5zz5mNMQSuCNSLjjhi5HJCsndpNWSNVsuThxwv285qy1KkUrLFRkxMSCjfL6bbycYN33ScZ5UB4Fzseceo1ndpL393T1q638VmcU3a56dhNHF1RPZFiGPS61FA78nXFSqE9uoKCCoHkEz83M1dQVhxZV5CEPF2P6VioGTKgprLCH9vvj9k1ivd4SX19L2VSMc3zD1u3mkR24ioETvxBoLeBSpxMoikyZ6inhuPm8yYo9YWyFtQK4XYfAV9mJ9knz5fUPXR8vvh7KJCAg4dqeJXTVb4mbMzYtsSZXHd6ouWoyCd6qMALdW8pKhgMCHcVYMWp9X9WHZuCo9rsRjRpg15sJUw7oJg1JoGiVgj8P4JeGDjnZHnmLVa5bpJhVCbMhyM7JLXNQJzFWTGC27TQBbthxCfQaKdusYnvZnKPDJWSeceYEFzepUnsWhQtyhbb73FzqgWC4eKEFKAZJqT2LuuSoxmihJ9acnFK7Ze23KTVYgDyMKY61VXADxmSrBvwUtxCaW4nQtnbMxiPMNnDMzeixqsFMBtN72j5UqhiLRY99k6SE7Qf5f29haNSBNSXCFFHChPKNTwJrehkofBdKUhh2VGPqZDNoefWUwfudeu83t85bmjv8Q3LrQSkFgFjRT5tLo8TMawNXoZCrQpyZrEvnodMDDUUNf3NL7rxyv3gM1KrTWjYaWXFU2RAsFee2Q2MTwUW7hR25cJvSFuB1BX2bfkoCbiMk923tHZGU2g7rSKF1GDDkXAc1EvFFD4iGbh1Q5t6hPRhBV8PEncdcCWGq5uAL5D4Bjr6VXG8uNeCy5oYWNgbZ5JRSfm7QEhPv8Fy9AKMgmCxDGMF9dVEaU6tw2BAnJavQdfrxChbDBeQXzCbCfep6oei6n2LZdE5Q84wp7eoQFE5Cwuo23tHkbJCaw2njFi3WGBbA7uGZaGHJPyB2rofTWBiSUXZnP2hiE9bjJghAcDm1M4LVLfWvhZmFEnyeru3VWMETnetz1BYLUC5MJGFXuhnHwWh7F6r74FDyhdswYop4eWPbyrXMXmUQEccTGd2NaT8g2VHADZ76gMC6BjWESvcnz2D4n8XwdmM7ZQ1jFwhuXrBfrb1dwRasyXxxHMGAC2onatNiExyeQ9G1W5LwqNLAh9hvcaNTGaYKYXoceVzLkgm6e5WMkLsCwuZXvB"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"good" : true
}
}
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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_reserve_proof","params":{"all":true}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NwZ1xM1HTAd84ePcZSqFX6xBVieiDSoxYpCckL4DReogi9MTV113UXUtguEFV1zrU82oHgTV2eBjikYMnJEowkxibHPkk18K4Gye8tcr4u8ZBoTvdAV347nXpxxGjmUVvN7f9jnthihEETtjHWgP113kpYmq9tnad9iWuq79GzfaYSnCJwTSELA7ZYpovkgUTCGimj7eXR5JcC7tdrnFNT2yZyrvwdkhhU5f1QhYASkT8bEUjmm8FWMEfzPzq5A5pFFMdv8NQNYap7HZnQRCkxvEZUByvoDUUVoWSf9Fjnrs8tCyXh28yo3cjf8gg1SNtPXo6kohKwxNgaL1Ak9UAcoRJR7dGZtVdciKsNV3rbAVTxgsEiH1bqv5aX3NNSV6nnejGkeMJFg8VicB8CCAQDJ2rkUXiKwJsBuutypLEBu6frBYGmAVRSFt224VKfJfnVbx8M6k6Xq6Yu4pmcBJ4gZCDy"
}
}
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:
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"check_reserve_proof","params":{"address":"XCA1TzWy4E57dGZtVdciKsNV3rbAVTxgsEiH1bqv5aX3NNSVGavL2zUQN3k1i7pFifKFQ91ZtDjzf6TC7i6FwABA1Wr2ffSy6R","signature":"ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE1111112VKmH111118NwZ1xM1HTAd84ePcZSqFX6xBVieiDSoxYpCckL4DReogi9MTV113UXUtguEFV1zrU82oHgTV2eBjikYMnJEowkxibHPkk18K4Gye8tcr4u8ZBoTvdAV347nXpxxGjmUVvN7f9jnthihEETtjHWgP113kpYmq9tnad9iWuq79GzfaYSnCJwTSELA7ZYpovkgUTCGimj7eXR5JcC7tdrnFNT2yZyrvwdkhhU5f1QhYASkT8bEUjmm8FWMEfzPzq5A5pFFMdv8NQNYap7HZnQRCkxvEZUByvoDUUVoWSf9Fjnrs8tCyXh28yo3cjf8gg1SNtPXo6kohKwxNgaL1Ak9UAcoRJR7dGZtVdciKsNV3rbAVTxgsEiH1bqv5aX3NNSV6nnejGkeMJFg8VicB8CCAQDJ2rkUXiKwJsBuutypLEBu6frBYGmAVRSFt224VKfJfnVbx8M6k6Xq6Yu4pmcBJ4gZCDy"}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"good" : true ,
"spent" : 0,
"total" : 1000000000
}
}
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 :
Copy $ curl -X POST http://localhost:18285/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true}}' -H 'Content-Type: application/json'
{
"id" : "0" ,
"jsonrpc" : "2.0" ,
"result" : {
"in" : [
{
"address" : "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe" ,
"amount" : 50000000,
"confirmations" : 102498,
"double_spend_seen" : false ,
"fee" : 1953096,
"height" : 328037,
"note" : "" ,
"payment_id" : "19295438056b27dd16fc6cb42a1c26eedff915e1210e1596dec67fd787912f3b" ,
"subaddr_index" : {
"major" : 0,
"minor" : 0
},
"suggested_confirmations_threshold" : 1,
"timestamp" : 1555972854,
"txid" : "35f9dccaf21dfe1df0945ebfc8b3ef28977b4ea1a78b3726c9f866facd27f7ad" ,
"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 :
Copy $ curl -X POST http://localhost:18285/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" : "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe" ,
"amount" : 300000000000,
"confirmations" : 1,
"destinations" : [
{
"address": "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe",
"amount" : 100000000000
},
{
"address": "XCA1kzoR3ZLNg5zxNmxrY8FYKtgEvPZqC2xoRpm1axCpQcrrZfoKTSkSNsASDspdt3j1WcEnQJyuuB5VPSB56WWy36A4sQtQhe",
"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" : "c36258a27600253a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a" ,
"type" : "out" ,
"unlock_time" : 0
}
}