Wallet RPC Documentation


#1

This is a list of the Electroneum-wallet-rpc calls, their Inputs and Outputs, and examples of each. The program Electroneum-wallet-rpc replaced the rpc interface that was in simplewallet and then Electroneum-wallet-cli.

Please note that “atomic units” refer to the smallest fraction of 1 ETN according to the Electroneumd implementation. 1 ETN = 100 atomic units.

All Electroneum-wallet-rpc methods use the same JSON RPC interface. For example:

IP=127.0.0.1
PORT=26969
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 Electroneum-wallet-rpc was executed with the --rpc-login argument as username:password, then follow this example:

IP=127.0.0.1
PORT=26969
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'

Index of JSON RPC Methods:

getbalance
getaddress
getheight
transfer
transfer_split
sweep_dust
sweep_all
store
get_payments
get_bulk_payments
get_transfers
get_transfer_by_txid
incoming_transfers
query_key
make_integrated_address
split_integrated_address
stop_wallet
make_uri
parse_uri
rescan_blockchain
set_tx_notes
get_tx_notes
sign
verify
export_key_images
import_key_images
get_address_book
add_address_book
delete_address_book
rescan_spent
start_mining
stop_mining
get_languages
create_wallet
open_wallet
open_wallet_password

JSON RPC Methods:

getbalance

Return the wallet's balance.

Inputs: None.
Outputs:

  • balance - unsigned int; The total balance of the current Electroneum-wallet-rpc in session.
  • unlocked_balance - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Electroneum blockchain to be considered safe to spend.
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'

image

getaddress

Return the wallet's address.

Inputs: None.
Outputs:

  • address - string; The 95-character hex address string of the Electroneum-wallet-rpc in session.
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'

getheight

Returns the wallet's current block height.

Inputs: None.
Outputs:

  • height - unsigned int; The current Electroneum-wallet-rpc’s blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon.
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getheight"}' -H 'Content-Type: application/json'

image

transfer

Send Electroneum to a number of recipients.

Inputs:

  • destinations - array of destinations to receive ETN:
  • amount - unsigned int; Amount to send to each destination, in atomic units.
  • address - string; Destination public address.
  • fee - unsigned int; Ignored, will be automatically calculated.
  • mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing). From ETN v6 onwards, this is capped at 0 regardless of choice.
  • unlock_time - unsigned int; Number of blocks before the Electroneum 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.
  • priority - unsigned int; Set a priority for the transaction. 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 Electroneum network. (Defaults to false)
  • get_tx_hex - boolean; Return the transaction as hex string after sending

Outputs:

  • fee - Integer value of the fee charged for the txn.
  • tx_hash - String for the publicly searchable transaction hash
  • tx_key - String for the transaction key if get_tx_key is true, otherwise, blank string.
  • tx_blob - Transaction as hex string if get_tx_hex is true
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations": [{"amount":10,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"},{"amount":10,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"}],"mixin":4,"get_tx_key": true, "get_tx_hex": false}}' -H 'Content-Type: application/json'

image

transfer_split

Same as transfer but can split into more than one tx if necessary.

Inputs:

  • destinations - array of destinations to receive ETN:
  • amount - unsigned int; Amount to send to each destination, in atomic units.
  • address - string; Destination public address.
  • fee - unsigned int; Ignored, will be automatically calculated.
  • mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing).
  • unlock_time - unsigned int; Number of blocks before the Electroneum 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. – Ignored
  • 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 Electroneum 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.

Outputs:

  • fee_list - array of: integer. The amount of fees paid for every transaction.
  • tx_hash_list - array of: string. The tx hashes of every transaction.
  • tx_blob_list - array of: string. The tx as hex string for every transaction.
  • amount_list - array of: integer. The amount transferred for every transaction.
  • tx_key_list - array of: string. The transaction keys for every transaction.
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"destinations": [{"amount":10,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"},{"amount":20,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"},{"amount":20,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"},{"amount":20,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"},{"amount":20,"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk"}],"mixin":4,"get_tx_key": true, "new_algorithm": true}}' -H 'Content-Type: application/json'

sweep_dust

Send all dust **Outputs** back to the wallet's, to make them easier to spend (and mix).

Inputs: None.
Outputs:

  • tx_hash_list - list of: string
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_dust"}' -H 'Content-Type: application/json'

image

sweep_all

Send all unlocked balance to an address.

Inputs:

  • address - string; Destination public address.
  • priority - unsigned int; (Optional)
  • mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing).
  • unlock_time - unsigned int; Number of blocks before the Electroneum 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)
  • do_not_relay - boolean; (Optional)
  • get_tx_hex - boolean; (Optional) return the transactions as hex encoded string.

Outputs:

  • tx_hash_list - array of string;
  • tx_key_list - array of string;
  • tx_blob_list - array of string;
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sweep_all","params": {"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk","mixin":2,"unlock_time":0,"get_tx_keys":true}}' -H 'Content-Type: application/json'

store

Save the blockchain.

Inputs: None.
Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json'

image

get_payments

Get a list of incoming payments using a given payment id.

Inputs:

  • payment_id - string

Outputs:

  • payments - list of:
  • payment_id - string
  • tx_hash - string
  • amount - unsigned int
  • block_height - unsigned int
  • unlock_time - unsigned int
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030"}}' -H 'Content-Type: application/json'

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.

Inputs:

  • payment_ids - array of: string
  • min_block_height - unsigned int; The block height at which to start looking for payments.

Outputs:

  • payments - list of:
  • payment_id - string
    • tx_hash - string
    • amount - unsigned int
    • block_height - unsigned int
    • unlock_time - unsigned int
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["4ca8a395e101a094c7d4926dbd076d962903224209398a873833b27984da46b0"],"min_block_height":100}}' -H 'Content-Type: application/json'

get_transfers

Returns a list of transfers.

Inputs:

  • in - boolean;
  • out - boolean;
  • pending - boolean;
  • failed - boolean;
  • pool - boolean;
  • filter_by_height - boolean;
  • min_height - unsigned int;
  • max_height - unsigned int;

Outputs:

  • in array of transfers:
  • txid - string;
  • payment_id - string;
  • height - unsigned int;
  • timestamp - unsigned int;
  • amount - unsigned int;
  • fee - unsigned int;
  • note - string;
  • destinations - std::list;
  • type - string;
  • out - array of transfers
  • pending - array of transfers
  • failed - array of transfers
  • pool - array of transfers
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"pool":true}}' -H 'Content-Type: application/json'

image

get_transfer_by_txid

Show information about a transfer to/from this address.

Inputs:

  • txid - string

Outputs:

  • transfer - JSON object containing parment information:
  • amount - unsigned int
  • fee - unsigned int
  • height - unsigned int
  • note - string
  • payment_id - string
  • timestamp - unsigned int
  • txid - string
  • type - string
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"f2d33ba969a09941c6671e6dfe7e9456e5f686eca72c1a94a3e63ac6d7f27baf"}}' -H 'Content-Type: application/json'

image

get_tx_key

Return the private key for a transaction. This will not work if you delete the .keys file associated with the wallet you're interested in.

Inputs:

  • txid - string; the id of the transaction you would like the private key for

Outputs:

  • tx_key - string; the private key for the transaction
curl -X POST http://localhost:40000/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_key","params":{"txid":"4cbce5528ea9c7202f134718132dbb635f35afb2e8b6ad47c17a465d0c43827b"}}' -H 'Content-Type: application/json'

image

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.

Outputs:

  • transfers - list of:
    • amount - unsigned int
    • spent - boolean
    • global_index - unsigned int; Mostly internal use, can be ignored by most users.
    • tx_hash - string; Several incoming transfers may share the same hash if they were in the same transaction.
    • tx_size - unsigned int

Example (Return “all” transaction types):

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"all"}}' -H 'Content-Type: application/json'

Example (Return “available” transactions):

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"available"}}' -H 'Content-Type: application/json'

Example (Return “unavailable” transaction. Note that this example returns 0 unavailable transactions):

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"incoming_transfers","params":{"transfer_type":"unavailable"}}' -H 'Content-Type: application/json'

image

query_key

Return the spend or view private key.

Inputs:

  • key_type - string; Which key to retrieve: “mnemonic” - the mnemonic seed (older wallets do not have one) OR “view_key” - the view key

Outputs:

  • key - string; The view key will be hex encoded, while the mnemonic will be a string of words.

Example (Query view key):

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"view_key"}}' -H 'Content-Type: application/json'

image

Example (Query mnemonic key):

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json'

image

make_integrated_address

Make an integrated address from the wallet address and a payment id.

Inputs:

  • payment_id - string; hex encoded; can be empty, in which case a random payment id is generated

Outputs:

  • integrated_address - string

Example (Payment ID is empty, use a random ID):

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"payment_id":""}}' -H 'Content-Type: application/json'

split_integrated_address

Retrieve the standard address and payment id corresponding to an integrated address.

Inputs:

  • integrated_address - string

Outputs:

  • standard_address - string
  • payment - string; hex encoded
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address":"f4VR4X3k4CJ5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dj2UsLyVCfaEAgRv5HkzuH"}}' -H 'Content-Type: application/json'

stop_wallet

Stops the wallet, storing the current state.

Inputs: None.
Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_wallet"}' -H 'Content-Type: application/json'

image

make_uri

Create a payment URI using the official URI spec.

Inputs:

  • address - wallet address string
  • amount (optional) - the integer amount to receive, in atomic units
  • payment_id (optional) - 16 or 64 character hexadecimal payment id string
  • recipient_name (optional) - string name of the payment recipient
  • tx_description (optional) - string describing the reason for the tx

Outputs:

  • uri - a string containing all the payment input information as a properly formatted payment URI
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_uri","params": {"address":"etnk4JPm2p14pkhgMKvJVaJ8RuAPRHEotJos2ZHoPKzSJfQ4y3V2Qk3AWM289t9vLXGwLfC9i84rRbCeXikxZCbe6kwnvkBdk3","amount":10,"payment_id":"4fff1fe417ff6f36","tx_description":"Testing out the make_uri function.","recipient_name":"Electroneum Project donation address"}}' -H 'Content-Type: application/json'

parse_uri

Parse a payment URI to get payment information.

Inputs:

  • uri - a string containing all the payment input information as a properly formatted payment URI

Outputs:

  • uri - JSON object containing payment information:
    • address - wallet address string
    • amount - the decimal amount to receive, in coin units (0 if not provided)
    • payment_id - 16 or 64 character hexadecimal payment id string (empty if not provided)
    • recipient_name - string name of the payment recipient (empty if not provided)
    • tx_description - string describing the reason for the tx (empty if not provided)
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"parse_uri","params":{"uri":"electroneum:etnk4JPm2p14pkhgMKvJVaJ8RuAPRHEotJos2ZHoPKzSJfQ4y3V2Qk3AWM289t9vLXGwLfC9i84rRbCeXikxZCbe6kwnvkBdk3?tx_payment_id=4fff1fe417ff6f36&tx_amount=0.10&recipient_name=Electroneum%20Project%20donation%20address&tx_description=Testing%20out%20the%20make_uri%20function."}}' -H 'Content-Type: application/json'

rescan_blockchain

Rescan blockchain from scratch.

Inputs: None.
Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_blockchain"}' -H 'Content-Type: application/json'

image

set_tx_notes

Set arbitrary string notes for transactions.

Inputs:

  • txids - array of string; transaction ids
  • notes - array of string; notes for the transactions

Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"set_tx_notes","params":{"txids":["6a1a100c079c236e2cbf36f7760e8ef1a9e8357c434aa790a8c78de653ec4cf2"],"notes":["This is an example"]}}' -H 'Content-Type: application/json'

image

get_tx_notes

Get string notes for transactions.

Inputs:

  • txids - array of string; transaction ids

Outputs:

  • notes - array of string; notes for the transactions
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_tx_notes","params":{"txids":["6a1a100c079c236e2cbf36f7760e8ef1a9e8357c434aa790a8c78de653ec4cf2"]}}' -H 'Content-Type: application/json'

image

sign

Sign a string.

Inputs:

  • data - string;

Outputs:

  • signature - string;
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"This is sample data to be signed"}}' -H 'Content-Type: application/json'

verify

Verify a signature on a string.

Inputs:

  • data - string;
  • address - string;
  • signature - string;

Outputs:

  • good - boolean;
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"verify","params":{"data":"This is sample data to be signed","address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk","signature":"SigV1Xp61ZkGguxSCHpkYEVw9eaWfRfSoAf36PCsSCApx4DUrKWHEqM9CdNwjeuhJii6LHDVDFxvTPijFsj3L8NDQp1TV"}}' -H 'Content-Type: application/json'

image

export_key_images

Export a signed set of key images.

Inputs: None.
Outputs:

  • signed_key_images - array of signed key images:
  • key_image - string;
  • signature - string;
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"export_key_images"}' -H 'Content-Type: application/json'

import_key_images

Import signed key images list and verify their spent status.

Inputs:

  • signed_key_images - array of signed key images:
  • key_image - string;
  • signature - string;

Outputs:

  • height - unsigned int;
  • spent - unsigned int;
  • unspent - unsigned int;
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_key_images", "params":{"signed_key_images":[{"key_image":"63b83df78cafd99e23b5ad3f667bc6f8d38813d9e84c7bb6c223a556dfd34af","signature":"b87b7e989aa86aa2a7a7cd8adcb3a848d3512ff718b168e15217ff3e5da29c0183c0328b97cc052fcb5ee3548aa5e41e530ba9d854199ea19d7ddaf6a54a4c0a"},{"key_image":"44ec12fbc56c533a30b09de8ae26febd515528c4957dfe875430377a7e212b4e","signature":"91105f15be0b25bc2a94bd78a7e261608974d6d888080b9f1815655b98af190340325ea1a0840a5951dacf913d4de1b2bd33ea59c1cb7bce1b6648afa7133d03"}]}}' -H 'Content-Type: application/json'

image

get_address_book

Retrieves entries from the address book.

Inputs:

  • entries - array of unsigned int; indices of the requested address book entries. Importantly, this must be one less than the index returned when you added an address – i.e it’s the index of the array slot (beginning with 0) that you must pass in.

Outputs:

  • entries - array of entries:
    • address - string;
    • description - string;
    • index - unsigned int;
    • payment_id - string;
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_book","params":{"entries":[1,2]}}' -H 'Content-Type: application/json'

add_address_book

Add an entry to the address book.

Inputs:

  • address - string;
  • payment_id - (optional) string, defaults to “0000000000000000000000000000000000000000000000000000000000000000”;
  • description - (optional) string, defaults to “”;

Outputs:

  • index - unsigned int; The index of the address book entry.
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"add_address_book","params":{"address":"etnk3iEFSvn5XV2t8o8UA47Md1yg2MSeA5W6wSdJR1PKUxz9VMSJEVR9M6fm4F4WnHdRFAsvCmk9TXmfk2TJ521dAXF22eD7xk","description":"Donation address for the Electroneum project"}}' -H 'Content-Type: application/json'

image

delete_address_book

Delete an entry from the address book.

Inputs:

  • index - unsigned int; The index of the address book entry.

Importantly, this must be one less than the index returned when you added an address – i.e it’s the index of the array slot (beginning with 0) that you must pass in.

Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"delete_address_book","params":{"index":0}}' -H 'Content-Type: application/json'

image

rescan_spent

Rescan the blockchain for spent **Outputs**.

Inputs: None.
Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"rescan_spent"}' -H 'Content-Type: application/json'

image

start_mining

Start mining in the Electroneum daemon.

Inputs:

  • threads_count - unsigned int; Number of threads created for mining
  • do_background_mining - boolean;
  • ignore_battery - boolean;
    Outputs: None.
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"start_mining","params":{"threads_count":1,"do_background_mining":true,"ignore_battery":true}}' -H 'Content-Type: application/json'

image

stop_mining

Stop mining in the Electroneum daemon.

Inputs: None.
Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"stop_mining"}' -H 'Content-Type: application/json'

image

get_languages

Get a list of available languages for your wallet's seed.

Inputs: None.
Outputs:

  • languages - array of string; List of available languages
$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_languages"}' -H 'Content-Type: application/json'

create_wallet

Create a new wallet. You need to have set the argument "–wallet-dir" when launching Electroneum-wallet-rpc to make this work.

Inputs:

  • filename - string;
  • struct - string;
  • language - string; Language for your wallets’ seed.

Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mytestwallet","password":"mytestpassword","language":"English"}}' -H 'Content-Type: application/json'

image

open_wallet

Open a wallet. You need to have set the argument "–wallet-dir" when launching Electroneum-wallet-rpc to make this work.

Inputs:

  • filename - string;
  • password - string;

Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"mytestwallet","password":"mytestpassword"}}' -H 'Content-Type: application/json'

image

change_wallet_password

Change the password for a wallet. You need to have set the argument "–wallet-dir" when launching Electroneum-wallet-rpc to make this work.

Inputs:

  • filename - string;
  • old_password - string;
  • new_password

Outputs: None.

$ curl -X POST http://127.0.0.1:26969/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"change_wallet_password","params":{"filename":"testnetwallet2","old_password":"mytestpassword","new_password":"mynewtestpassword"}}' -H 'Content-Type: application/json'

image