This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.http
280 lines (203 loc) · 6.91 KB
/
api.http
1
2
3
4
5
6
7
8
9
10
11
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
270
271
272
273
274
275
276
277
278
279
280
### use with vscode plugin humao.rest client
### health check
GET http://localhost:6789/health
### monero quote
GET http://localhost:6789/quote/xmr
Content-Type: application/json
{
"address": "54gqcJZAtgzBFnQWEQHec3RoWfmoHqL4H8sASqdQMGshfqdpG1fzT5ddCpz9y4C2MwQkB5GE2o6vUVCGKbokJJa6S6NSatn",
"amount": 0.123,
"multisigInfo": "",
"preimageHash": []
}
### Validate Monero address
POST http://localhost:18082/json_rpc
Content-Type: application/json
{
"jsonrpc":"2.0",
"id":"0",
"method":"validate_address",
"params": {
"address":"42go2d3XqA9Mx4HjZoqr93BHspcMxwAUBivs3yJKV1FyTycEcbgjNyEaGNEcgnUE9DDDAXNanzB16YgMt88Sa8cFSm2QcHK",
"any_net_type": true,
"allow_openalias": true
}
}
### Add hold invoice
POST https://localhost:8180/v2/invoices/hodl
Grpc-Metadata-macaroon:
{
"hash": [224, 199, 253, 44, 149, 34, 254, 240, 249, 243, 120, 108, 140, 190, 74, 38, 149, 157, 65,141, 117, 176, 47, 166, 199, 59, 185, 30, 217, 113, 161, 236],
"value": "10000",
"expiry": "600"
}
### Settle hold invoice
POST https://localhost:8180/v2/invoices/settle
Grpc-Metadata-macaroon:
{
"preimage": [0, 7, 139, 10, 57, 237, 235, 242,
118, 158, 49, 50, 190, 190, 47, 105,
129, 221, 23, 245, 73, 164, 155, 247,
156, 161, 114, 203, 240, 65, 20, 53]
}
### perform xmr swap v0.1.0-beta
POST http://localhost:6789/swap/xmr
Content-Type: application/json
{
"hash": "2161997ea4adcaa2806c0a0e66f30b3ac48ed9f969108742a6b163148f5c7b6c"
}
### get balances of xmr wallet
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,0]}}
### is_multisig check for xmr wallet
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"is_multisig"}
### xmr get_tx_proof
POST http://127.0.0.1:18082/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"get_tx_proof","params":{"txid":"03c12740cea72d8bfd94be86c083ba962470e06b6d32236589763b15c11f6487",
"address": "54gqcJZAtgzBFnQWEQHec3RoWfmoHqL4H8sASqdQMGshfqdpG1fzT5ddCpz9y4C2MwQkB5GE2o6vUVCGKbokJJa6S6NSatn"}}
### xmr get_transfers
POST http://127.0.0.1:18082/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"out":true,"account_index":0}}
### bitcoin quote
GET http://localhost:6789/quote/btc
Content-Type: application/json
{
"paymentRequest": "",
"refundAddress": ""
}
### create wallet
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"mass","language":"English"}}
### open wallet
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"3ac451b7910267ed82d656cd738fdb05994820ecc90a86b1a3a5c4699910ec071631480869"}}
### close wallet
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"close_wallet","params":{"filename":"3ac451b7910267ed82d656cd738fdb05994820ecc90a86b1a3a5c4699910ec071631480869"}}
### export multisig info
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"export_multisig_info"}
### sign multisig
POST http://localhost:18083/json_rpc
Content-Type: application/json
{
"jsonrpc":"2.0","id":"0","method":"sign_multisig",
"params": {
"tx_data_hex": ""
}
}
### submit multisig
POST http://localhost:18083/json_rpc
Content-Type: application/json
{
"jsonrpc":"2.0","id":"0","method":"submit_multisig",
"params": {
"tx_data_hex": ""
}
}
### transfer
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":900000000000,"address":"54ZGkxaYG7WXN6FFjapkMp7CyxSSjZq4uYvY9DnXejPSLv554Vxm7eR8Kydz3zBA2xan3dpJF1suMMriBJWShnwZVX6Bo8Y"}],"account_index":0,"subaddr_indices":[0],"priority":0,"ring_size":11}}
### sweep all
POST http://localhost:18083/json_rpc
Content-Type: application/json
{
"jsonrpc":"2.0","id":"0","method":"sweep_all",
"params":{
"address":"5BG7NvDurzu1Mnrb5akNfdZwrQK95m9g8JW61mnxbeFTDHHCoRmt8fQPuHjENNBSRKGtssLyH4xkrhbHKoSzquKpUFcgA3C","account_index":0,"priority":0,"ring_size":11
}
}
### import multisig info
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"import_multisig_info",
"params": {
"info": [""]
}
}
### describe transer
POST http://localhost:18083/json_rpc
Content-Type: application/json
{"jsonrpc":"2.0","id":"0","method":"describe_transfer","params":{"multisig_txset":""}}
### /swap/fund/xmr
POST http://localhost:6789/swap/fund/xmr
Content-Type: application/json
{
"hash": "",
"makeMultisigInfo": ""
}
### /swap/initialize/xmr (don't send import info when cancelling)
POST http://localhost:6789/swap/initialize/xmr
Content-Type: application/json
{
"hash": "4e10d70616a930e2a6cbb80e6de735a5f6eeee9f970d9a5737607c052afa7ffb"
}
### execute swap w/ multsig v0.2.0-beta+
POST http://localhost:6789/swap/xmr
Content-Type: application/json
{
"hash": "",
"preimage": []
}
### cancel xmr swap (no need to send preimage to cancel, initialize first!)
POST http://localhost:6789/swap/cancel/xmr
Content-Type: application/json
{
"hash": "4e10d70616a930e2a6cbb80e6de735a5f6eeee9f970d9a5737607c052afa7ffb"
}
### btc quote
GET http://localhost:6789/quote/btc
Content-Type: application/json
{
"amount": 0.123,
"proofAddress": "59Cr7SVrqbW9Nej2EAnqUFTugNZhkETdEG5MMMRtqSnZbAZx4Hiv5272MvZM5jjgWedwSQTiEnvsGCjFnXiomdTjPd2uAbC",
"proofSignature": "",
"refundAddress": "59Cr7SVrqbW9Nej2EAnqUFTugNZhkETdEG5MMMRtqSnZbAZx4Hiv5272MvZM5jjgWedwSQTiEnvsGCjFnXiomdTjPd2uAbC",
"swapMultisigInfos": ["", ""]
}
### fund xmr -> btc
POST http://localhost:6789/swap/fund/btc
Content-Type: application/json
{
"hash": "3ac451b7910267ed82d656cd738fdb05994820ecc90a86b1a3a5c4699910ec07",
"makeMultisigInfos": ["",""]
}
### /swap/initialize/btc
POST http://localhost:6789/swap/initialize/btc
Content-Type: application/json
{
"hash": "3ac451b7910267ed82d656cd738fdb05994820ecc90a86b1a3a5c4699910ec07",
"importInfos": ["",""],
"paymentRequest": ""
}
### swap
### fund xmr -> btc
POST http://localhost:6789/swap/btc
Content-Type: application/json
{
"hash": "3ac451b7910267ed82d656cd738fdb05994820ecc90a86b1a3a5c4699910ec07",
"txset": "...long hex..."
}
### integrity
GET http://localhost:6789/integrity
### rate check
GET http://localhost:6789/rate
### I2P
### add peer
POST http://5rndva7adxvok4s44g6yelvggdihxz3vat46lxpsd6rlfqlsyeda.b32.i2p/peer/add
Content-Type: application/json
{
"peerId": "wtsythnq4l3dqg5kzdwdl2ml4stta6iu24ygmredg4gzbnlo7ujq.b32.i2p"
}
### view peer
GET http://5rndva7adxvok4s44g6yelvggdihxz3vat46lxpsd6rlfqlsyeda.b32.i2p/peer/view