Re-style wallet-rpc dev guide; prep for examples

This commit is contained in:
Mike C 2016-03-11 22:17:09 -07:00
parent 520963feaa
commit dd5897bba1

View file

@ -9,16 +9,14 @@ icon: "icon_client"
attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->" attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->"
--- ---
### This is a list of the daemon and wallet RPC calls, along with their inputs and outputs. ## Introduction
bitmonerod This is a list of the simplewallet RPC calls, their inputs and outputs, and examples of each.
TODO All simplewallet methods use the same JSON RPC interface. For example:
simplewallet
Wallet RPC commands are in JSON format, and can be accessed like this:
IP=127.0.0.1
PORT=18082
METHOD="make_integrated_address" METHOD="make_integrated_address"
PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}"
curl \ curl \
@ -26,139 +24,247 @@ simplewallet
-d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \
-H 'Content-Type: application/json' -H 'Content-Type: application/json'
getbalance ### JSON RPC Methods:
return the wallet's balance
outputs:
balance: unsigned int
unlocked_balance: unsigned int
getaddress * [getbalance](#getbalance)
return the wallet's address * [getaddress](#getaddress)
outputs: * [getheight](#getheight)
address: string * [transfer](#transfer)
* [transfer_split](#transfer_split)
* [sweep_dust](#sweep_dust)
* [store](#store)
* [get_payments](#get_payments)
* [get_bulk_payments](#get_bulk_payments)
* [incoming_transfers](#incoming_transfers)
* [query_key](#query_key)
* [make_integrated_address](#make_integrated_address)
* [split_integrated_address](#split_integrated_address)
* [stop_wallet](#stop_wallet)
getheight ---
returns the current block height
outputs:
height: string
transfer ### getbalance
send monero to a number of recipients
inputs:
destinations: array of:
amount: unsigned int
address: string
fee: unsigned int
ignored, will be automatically calculated
mixin: unsigned int
number of outpouts from the blockchain to mix with (0 means no mixing)
unlock_time: unsigned int
number of blocks before the monero can be spent (0 to not add a lock)
payment_id: string
outputs:
tx_hash: array of:
string
transfer_split Return the wallet's balance.
same as transfer, but can split into more than one tx if necessary
inputs:
destinations: array of:
amount: unsigned int
address: string
fee: unsigned int
ignored, will be automatically calculated
mixin: unsigned int
number of outpouts from the blockchain to mix with (0 means no mixing)
unlock_time: unsigned int
number of blocks before the monero can be spent (0 to not add a lock)
payment_id: string
new_algorithm: boolean
true to use the new transaction construction algorithm, defaults to false
outputs:
tx_hash: array of:
string
sweep_dust Inputs: *None*.
send all dust outputs back to the wallet's, to make them easier to spend (and mix)
outputs:
tx_hash_list: list of:
string
store Outputs:
save the blockchain
get_payments * *balance* - unsigned int
get a list of incoming payments using a given payment id * *unlocked_balance* - unsigned int
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
get_bulk_payments Example:
get a list of incoming payments using a given payment id, or a list of payments ids, from a given height
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
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
"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
query_key ### getaddress
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)
"view_key": the view key
outputs:
key: string
the view key will be hex encoded
make_integrated_address Return the wallet's 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
split_integrated_address Inputs: *None*.
retrieve the standard address and payment id corresponding to an integrated address
inputs: Outputs:
integrated_address: string
outputs: * *address* - string
standard_address: string
payment: string Example:
hex encoded
### getheight
Returns the wallet's current block height.
Inputs: *None*.
Outputs:
* *height* - string
Example:
### transfer
Send monero to a number of recipients.
Inputs:
* *destinations* - array of:
* *amount* - unsigned int
* *address* - string
* *fee* - unsigned int; Ignored, will be automatically calculated.
* *mixin* - unsigned int; Number of outpouts from the blockchain to mix with (0 means no mixing).
* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock).
* *payment_id* - string
Outputs:
* *tx_hash* - array of: string
Example:
### transfer_split
Same as transfer, but can split into more than one tx if necessary.
Inputs:
* *destinations* - array of:
* *amount* - unsigned int
* *address* - string
* *fee* - unsigned int; Ignored, will be automatically calculated.
* *mixin* - unsigned int; Number of outpouts from the blockchain to mix with (0 means no mixing).
* *unlock_time* - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock).
* *payment_id* - string
* *new_algorithm* - boolean; True to use the new transaction construction algorithm, defaults to false.
Outputs:
* *tx_hash* - array of: string
Example:
### 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
Example:
### store
Save the blockchain.
Inputs: *None*.
Outputs:
Example:
### 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
Example:
### get_bulk_payments
Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height.
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
Example:
### 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:
### 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
Example:
### 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:
### 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
Example:
### stop_wallet
Stops the wallet, storing the current state.
Inputs: *None*.
Outputs:
Example:
stop_wallet
stops the wallet, storing the current state