-
Notifications
You must be signed in to change notification settings - Fork 64
RPC Wallet API
On this page you will find description of every method in the Conceal RPC Wallet API. The Conceal RPC Wallet is a HTTP server which provides JSON 2.0 RPC interface for Conceal payment operations and address management. Each method has its own page that can be found by clicking on this method.
More on how to start and operate Conceal RPC Wallet can be found here:
To make a JSON PRC request to your Conceal RPC Wallet you should use POST request that looks like this:
http://<service address>:<service port>/json_rpc
Where:
- <service address> is an IP of Conceal RPC Wallet, if RPC Wallet is located on local machine it is either 127.0.0.1 or localhost,
- <service port> is Conceal RPC Wallet port, by default it is binded to 8070 port, but it can be manually binded to any port you want, read more about this
save method allows you to save your wallet by request.
No input. No output in the event of success.
Input value example:
{
'params':{
},
'jsonrpc':'2.0',
'id':'test',
'method':'save'
}
Output value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
}
}
getBalance method returns a balance for a specified address.
Please note: If address is not specified, returns a cumulative balance of all RPC Wallet's addresses.
Input example:
{
'params':{
'address':'ccx7T5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getBalance'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'lockedAmount':210,
'availableBalance':110
}
}
getBlockHashes method returns an array of block hashes for a specified block range.
Input example:
{
'params':{
'blockCount':5,
'firstBlockIndex':0
},
'jsonrpc':'2.0',
'id':'test',
'method':'getBlockHashes'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'blockHashes':[
'8a6f1cb7ed7a9db4751d7b283a0482baff20567173dbfae136c9bceb188e51c4',
'657cd1c33df7f4250d581c97db665cb4a1856ebfadd6efabaeab745c2c76b1be',
'21047174f74576b6722e72646d7bd553e17d7c9f07fef05151bb1f9df7ed9dd8',
'504b9bfb2cd34531551cb2d68ea3e34e030d991164589ba7ed24e16fed3ea374',
'd9d36b5226d11b2cf60e3cf2038b21032c4ac753eabc32fbdd506158f95a69ca'
]
}
}
getTransactionHashes method returns an array of block and transaction hashes. Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Note: if paymentId parameter is set, getTransactionHashes method returns transaction hashes of transactions that contain specified payment_id. (in the set block range). If addresses parameter is set, getTransactionHashes method returns transaction hashes of transactions that contain transfer from at least one of specified addresses. When both above mentioned parameters are set, getTransactionHashes method returns transaction hashes of transactions that contain both specified payment_id and transfer from at least one of specified addresses.
Input example:
{
'params':{
'blockCount':100,
'firstBlockIndex':0,
'addresses':[
'ccx7T5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt'
]
},
'jsonrpc':'2.0',
'id':'test',
'method':'getTransactionHashes'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'items':[
{
'transactionHashes':[
957dcbf54f327846ea0c7a16b2ae8c24ba3fa8305cc3bbc6424e85e7d358b44b
25bb751814dd39bf46c972bd760e7516e34200f5e5dd02fda696671e11201f78
],
'blockHash':'8a6f1cb7ed7a9db4751d7b283a0482baff20567173dbfae136c9bceb188e51c4'
}
]
}
}
getTransactions method returns an array of block and transaction hashes. Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Note: if paymentId parameter is set, getTransactions method returns transactions that contain specified payment_id. (in the set block range). Also, if addresses parameter is set, getTransactions method returns transactions that contain transfer from at least one of specified addresses. When both above mentioned parameters are set, getTransactions method returns transactions that contain both specified payment_id and transfer from at least one of specified addresses.
Input example:
{
'params':{
'blockCount':1000,
'firstBlockIndex':1,
'addresses':[
'ccx7T5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt',
'ccx7NCZv8CQ5YoUZFLAUpxQhHt9FAo5KhXBEaHGTeaDD1t5ZZsKoEMQ8sgUMcyKbwpFJGaaY73Bwf3bUXVLsgAZa7nCv85k',
'ccx7AonXm7saDTsNEi9uJsb5HswnafrsVLn2vWT1PGGTi1KFbJypdqs7xWrdU54ieXcdQtiV1bDAcVZjYjwFg41v9v7x869'
],
paymentId:'somePaymentId'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getTransactions'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'items':[
{
'blockHash':'01bd06ca731914f27e143bbb902ce0bc05bff13d76faa027ea817e68f217488c',
'transactions':[
{
'fee':-70368475742208,
'extra':'0127cea59bfadc49aa02ed4a225936671e55607b5241621abca2a5e14405906dbb',
'timestamp':1446029698,
'blockIndex':1,
'state':0,
'transactionHash':'06ec210a8359f253f8b2160a0d6040cf89f2a05a553aaa577b7f508ee5d831f9',
'amount':70368475742208,
'unlockTime':11,
'transfers':[
{
'amount':70368475742208,
'type':0,
'address':'ccx7T5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt'
}
],
'paymentId':'',
'isBase':True
}
]
},
{
'blockHash':'28aa7d32f4274f6387969d7671bd4db98fd871bf0dd510a1df5e2ef4b1d41a35',
'transactions':[
{
'fee':-70368207307776,
'extra':'01a8e6e408282b2ddf343e20d5e9aab283723ba10ab7ab7b3131f6981b02a84431',
'timestamp':1446029698,
'blockIndex':2,
'state':0,
'transactionHash':'922d00d2e6eaed63f62d8e3b968cb08b6ea5c555fe0e6af948ab06efe6eb213a',
'amount':70368207307776,
'unlockTime':12,
'transfers':[
{
'amount':70368207307776,
'type':0,
'address':'ccx7T5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt'
}
],
'paymentId':'',
'isBase':True
}
]
}
]
}
}
getUnconfirmedTransactionHashes method returns information about the current unconfirmed transaction pool or for a specified addresses. Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Input example:
{
'params':{
'addresses':[
'ccx7PifEfmQDZAxMxjrkbPPLHtwv1ezGr2GRB3P377ecToxGkrTFTe2EEjAKbhPqA61FPTi14UpkMVMh2pn1et1y8PdDwn4',
'ccx76ryfQdrNFhQ3pwnWw21mKomejKpdVj8diVdu5nAdYh7vft5JcMHjMshEcAqAJGaUSmDvTPKTtSWyGxc52R1c4JFVKUP',
'ccx726MT2R3CtZH6oVHVQJ3J1j6HS7ircHNrJMvSb3tRTqnGEBjqojdUHzPKRigkjecw1iwW15qRp4bWvV2dTuz8QNMdAU8'
]
},
'jsonrpc':'2.0',
'id':'test',
'method':'getUnconfirmedTransactionHashes'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transactionHashes':[
...,
...,
...
]
}
}
getTransaction method returns information about a particular transaction.
Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Input example:
{
'params':{
'transactionHash':'92423b0857d36bd172b3f2effbd47ea477bfe0618a50c29d475542c6d5d1b835'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getTransaction'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transaction':{
'fee':1000000,
'extra':'0130b4472974f2deb9fae7d8fd6602b26396379f3fa05cca2430e10e9e60179f42',
'timestamp':0,
'blockIndex':4294967295,
'state':0,
'transactionHash':'92423b0857d36bd172b3f2effbd47ea477bfe0618a50c29d475542c6d5d1b835',
'amount':-1703701,
'unlockTime':0,
'transfers':[
{
'amount':123456,
'type':0,
'address':'ccx7u9U3F7vdGggu4NQ3CKDhk59vMQyMaFbLtu7TU4TdUkNtuJufqpo67r2e5j5p44SBsBBygaRdmeB4gwH9CF1C3zufGWd'
},
{
'amount':234567,
'type':0,
'address':'ccx7hmn49D4JZED1g4CM98RpszuMbbDEaYNVpCWjUkDuWPVpo8EEUHaReKeHBmpoNdTENs841QUBRNitFHD7W29oDVfV9ze'
},
{
'amount':345678,
'type':0,
'address':'ccx7BzzR28edvZqLv6t8XVY98jeK6YEjS3birBPTHjY1hXSFM5k5pjUNSur6UhbP8EaqhZ69PVJF991KqCtYFox7NUSvcjw'
}
],
'paymentId':'',
'isBase':False
}
}
}
sendTransaction method allows you to send transaction to one or several addresses. Also, it allows you to use a payment_id for a transaction to a single address. If sending from a single address, then the change address is not required.
Example: Multiple transfers in a single transaction
{
"params":{
"anonymity":4,
"fee":1000,
"unlockTime":0,
"addresses":[
"ccx7ZR5167Z9AburnDZ3Wu8712yejVd78TCFZKWn1gTidA1hJfwsVWUYLaAhRjv4qwMBzwGakB6VeGWfV9ZZvkAu8j2ehPA3Sv"
],
"transfers":[
{
"amount":20000000,
"address":"ccx7BtV8DUGNZHxW3k9o2kSzAbwSm33sFMRiR1FRDy2wNuWh5bkFvKeYLaAhRjv4qwMBzwGakB6VeGWfV9ZZvkAu8j2ej6aF7R"
},
{
"amount":20000000,
"address":"ccx7V4GWENfe7A38kWpj9EHJ1qHpaztsNNX8x44Kgo6dHKbDwkM6DMnYLaAhRjv4qwMBzwGakB6VeGWfV9ZZvkAu8j2edna4U6"
},
{
"amount":20000000,
"address":"ccx7eDWHZTgTZy7gbNL3vPgMiv9CZ1ckaCEQRiBkQmXVGQxAXVXVPunYLaAhRjv4qwMBzwGakB6VeGWfV9ZZvkAu8j2eg6ijCG"
}
],
"changeAddress":"ccx7ZR5167Z9AburnDZ3Wu8712yejVd78TCFZKWn1gTidA1hJfwsVWUYLaAhRjv4qwMBzwGakB6VeGWfV9ZZvkAu8j2ehPA3Sv"
},
"jsonrpc":"2.0",
"id":"test",
"method":"sendTransaction"
}
Return value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transactionHash':'93faedc8b8a80a084a02dfeffd163934746c2163f23a1b6022b32423ec9ae08f'
}
}
estimateFusion allows you to check how many inputs you can fuse for a given threshold. Then you can use that information to use sendFusionTransaction. Fusion transactions allow you to optimize your wallet(s) when there are too many small outputs to fit in a transactions.
The threshold is the value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. This value is in atomic units, so 1000 is 0.001000 CCX.
The addresses field is an array of strings, where each string is an address to check for fuse-able outputs. Input example:
{
'params':{
'threshold':1000000,
'addresses':[
'ccx77C9AM1PQataUmbpjmXbZz2KSynxgURYb8moceDPXVWBwt4pjGtvAmfY3qmhcrBZgyKfLGnhGCW8LxBHGiDrrC5GLjhD'
]
},
'jsonrpc':'2.0',
'id':'test',
'method':'estimateFusion'
}
Return value example:
{
"jsonrpc":"2.0",
"id":"test",
"result":{
"totalOutputCount":1000,
"fusionReadyCount":50
}
}
sendFusionTransaction allows you to send a fusion transaction, by taking funds from selected addresses and transferring them to the destination address. If there aren't any outputs that can be optimized, sendFusionTransaction will return an error. You can use estimateFusion to check the outputs, available for the optimization.
The threshold is the value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. This value is in atomic units, so 1000 is 0.001000 CCX.
The addresses field is an array of strings, where each string is an address to take the funds from. If the container or addresses field contains only one address, destinationAddress can be left empty and the funds will return to that address.
Input example:
{
'params':{
'anonymity:0,
'threshold':1000,
'addresses':[
'ccx77C9AM1PQataUmbpjmXbZz2KSynxgURYb8moceDPXVWBwt4pjGtvAmfY3qmhcrBZgyKfLGnhGCW8LxBHGiDrrC5GLjhD'
],
'destinationAddress':'ccx7wr16RtJ5M4wLVM7bnAXSMgimsgxiQtoSTXSBUrsQHQ6CbLKeXwimHyn2iqorN2DqL2b4HcaiJLvPmRbUMVXJTLqbjT'
},
'jsonrpc':'2.0',
'id':'test',
'method':'sendFusionTransaction'
}
Return value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transactionHash':'arf23rfeee21312er21243rfeff3dsv34746c2163f23a1b6022b32423ec9ae08f'
}
}
© 2018-2023 Conceal Network. All rights reserved.
- Conceal API Reference
- General Methods
- Private Key Methods
- Wallet Address Methods
- Deposit Methods
- Transaction Methods
- Delayed Transaction Methods
- Wallet Export Methods