Wallet RPC API documentation
This is a list of the virel-wallet-cli RPC calls, their inputs and outputs, and examples of each. All the RPC calls use the wallet’s JSON RPC interface, as demonstrated below. The wallet implements the jsonrpc 2.0 standard.
Note: “atomic units” refer to the smallest fraction of 1 XST according to the implementation. 1 XST = 1e9 atomic units.
Methods
get_balance
Inputs:
- No inputs
Outputs:
balance
uint64: the wallet balance (excluding mempool transactions)mempool_balance
uint64: the unconfirmed balance
Example:
curl http://127.0.0.1:6318/json_rpc -u user:pass -d '{"jsonrpc":"2.0","id":0,"method":"get_balance","params":{}}' -H 'Content-Type: application/json'
get_history
Inputs:
subaddress
(string, optional): The subaddress to query transactions for.include_tx_data
(bool): Whether to include transaction data in the response.include_incoming
(bool): Whether to include incoming transactions.include_outgoing
(bool): Whether to include outgoing transactions.
Outputs:
incoming
([]TxInfo): List of incoming transactions (if enabled).outgoing
([]TxInfo): List of outgoing transactions (if enabled).
Example:
curl http://127.0.0.1:6318/json_rpc -u user:pass -d
'{"jsonrpc":"2.0","id":0,"method":"get_history","params":{"subaddress":"SUBADDRESS","include_tx_data":true,"include_incoming":true,"include_outgoing":true}' -H 'Content-Type: application/json'
create_transaction
Inputs:
destination
(address.Integrated): The integrated address of the transaction destination.amount
(uint64): The amount to send in the transaction.
Outputs:
tx_blob
(enc.Hex): Hex-encoded transaction blob.txid
(util.Hash): Hash of the created transaction.
Example:
curl http://127.0.0.1:6318/json_rpc -u user:pass -d
'{"jsonrpc":"2.0","id":0,"method":"create_transaction","params":{"destination":"integrated_address","amount":1000000}}' -H 'Content-Type:
application/json'
submit_transaction
Inputs:
tx_blob
(enc.Hex): Hex-encoded transaction blob to submit.
Outputs:
txid
(util.Hash): Hash of the submitted transaction.
Example:
curl http://127.0.0.1:6318/json_rpc -u user:pass -d '{"jsonrpc":"2.0","id":0,"method":"submit_transaction","params":{"tx_blob":"0x..."}}' -H
'Content-Type: application/json'