wallet-rpc.md 5.2 KB
Newer Older
moneromooo-monero's avatar
moneromooo-monero committed
1
2
3
---
layout: static_page
title: "Wallet RPC documentation"
Mike C's avatar
Mike C committed
4
title-pre-kick: "Developer Guide: "
moneromooo-monero's avatar
moneromooo-monero committed
5
6
7
8
9
10
11
title-kick: "Wallet RPC documentation "
title-post-kick: ""
kick-class: "green-kicks"
icon: "icon_client"
attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->"
---

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
## Introduction

This is a list of the simplewallet RPC calls, their inputs and outputs, and examples of each.

All simplewallet methods use the same JSON RPC interface. For example:

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

### JSON RPC Methods:

* [getbalance](#getbalance)
* [getaddress](#getaddress)
* [getheight](#getheight)
* [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)

---

### getbalance

Return the wallet's balance.

Inputs: *None*.

Outputs:

* *balance* - unsigned int
* *unlocked_balance* - unsigned int

Example:


### getaddress

Return the wallet's address.

Inputs: *None*.

Outputs:

* *address* - string

Example:


### 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:

270