-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
629 lines (627 loc) · 15.2 KB
/
openapi.yml
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
openapi: 3.0.0
info:
title: Warp Sync API
version: 1.2.15
description: |-
This is the fast synchronization, multi account and multi currency
wallet for Ycash and Zcash.
contact:
name: Hanh Huynh Huu
url: "https://ywallet.app"
tags:
- name: config
description: |-
Set the current account. Account methods use the current account.
- Zcash: coin = 0
- Ycash: coin = 1
- name: sync
description: Blockchain Synchronization
- name: account
description: Account Management
- name: payment_uri
description: Payment URI
paths:
/set_active:
post:
tags: [ config ]
operationId: set_active
description: set the current account for a given coin
parameters:
- name: coin
in: query
required: true
schema:
type: integer
format: uint8
minimum: 0
- name: id_account
in: query
required: true
schema:
type: integer
format: uint32
minimum: 1
responses:
'200':
description: ''
/new_account:
post:
tags: [ account ]
operationId: new_account
description: create a new account from a given seed/secret key/viewing key
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AccountSeed'
required: true
responses:
'200':
description: 'account id'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/accounts:
get:
operationId: list_accounts
tags: [ account ]
description: get a list of all accounts
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AccountRec'
'500':
description: 'error message'
/sync:
post:
operationId: sync
tags: [ sync ]
description: Synchronizes with the tip of the blockchain
parameters:
- name: offset
in: query
description: |-
Number of blocks to synchronize from the tip of the blockchain.
For example:
- If 0, sync catches up with the latest block
- If 1, sync synchronizes up to the latest block height - 1
Creates a new checkpoint
schema:
type: integer
format: uint32
minimum: 0
nullable: true
responses:
'200':
description: ''
'500':
description: 'error message'
/rewind:
post:
operationId: rewind
tags: [ sync ]
description: Rewind the blockchain to a previous height
parameters:
- name: height
in: query
description: |-
Requested height to rewind to. Note that this will be rounded
to the nearest checkpoint before this height.
required: true
schema:
type: integer
format: uint32
minimum: 0
responses:
'200':
description: ''
'500':
description: 'error message'
/latest_height:
get:
operationId: get_latest_height
tags: [ sync ]
description: Latest block height and current synced height
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Heights'
'500':
description: 'error message'
/backup:
get:
operationId: get_backup
tags: [ account ]
description: |-
Get the account information needed to make a backup.
The `allow_backup` option must be set in the config file
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Backup'
'500':
description: 'error message'
/balance:
get:
operationId: get_balance
tags: [ account ]
description: Get the account balance in zats
responses:
'200':
description: 'zats'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/address:
get:
operationId: get_address
tags: [ account ]
description: Get the account address (z-addr)
responses:
'200':
description: 'zaddr'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/tx_history:
get:
operationId: get_tx_history
tags: [ account ]
description: Get the account history
responses:
'200':
description: 'transactions'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TxRec'
'500':
description: 'error message'
/pay:
post:
operationId: pay
tags: [ account ]
description: Make a payment. The `allow_send` flag must be set in the config file
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
required: true
responses:
'200':
description: ''
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/mark_synced:
post:
operationId: mark_synced
tags: [ sync ]
description: |-
Create a checkpoint at the current latest height without actually
doing any synchronization work. Only use it if you have a new account
and you are sure there are no prior transactions.
responses:
'200':
description: ''
'500':
description: 'error message'
/create_offline_tx:
post:
operationId: create_offline_tx
tags: [ account ]
description: Create a transaction for offline signing
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Tx'
'500':
description: 'error message'
/sign_offline_tx:
post:
operationId: sign_offline_tx
tags: [ account ]
description: |-
Sign an offline transaction. Tx object must be created by calling
`create_offline_tx` and the secret key must be available in the current
account
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Tx'
required: true
responses:
'200':
description: 'signed raw transaction'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/broadcast_tx:
post:
operationId: broadcast_tx
tags: [ account ]
parameters:
- name: tx_hex
in: query
required: true
description: 'signed raw transaction'
schema:
type: string
responses:
'200':
description: 'txid'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/new_diversified_address:
get:
operationId: new_diversified_address
tags: [ account ]
description: get a new diversified address
responses:
'200':
description: 'diversified address'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/make_payment_uri:
post:
operationId: make_payment_uri
tags: [ payment_uri ]
description: create a payment uri
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentURI'
required: true
responses:
'200':
description: 'payment uri'
content:
text/plain:
schema:
type: string
'500':
description: 'error message'
/parse_payment_uri:
get:
operationId: parse_payment_uri
tags: [ payment_uri ]
description: decode a payment uri
parameters:
- name: uri
in: query
description: 'payment uri'
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentURI'
'500':
description: 'error message'
components:
schemas:
AccountSeed:
type: object
required:
- coin
- name
properties:
coin:
type: integer
format: uint8
minimum: 0
description: |-
- 0 for zcash,
- 1 for ycash
name:
type: string
description: account name
key:
type: string
nullable: true
description: |-
seed phrase, secret key or viewing key. null for a new account
from a random seed phrase.
index:
type: integer
format: uint32
minimum: 0
nullable: true
description: |-
if key is a seed phrase, this is the index of the sub account.
0 by default
AccountRec:
type: object
required:
- address
- id_account
- name
properties:
id_account:
type: integer
format: uint32
minimum: 1
description: account id
name:
type: string
description: account name
address:
type: string
description: z-address
Heights:
type: object
required:
- latest
- synced
properties:
latest:
description: Latest block height
type: integer
format: uint32
minimum: 0
synced:
description: Latest checkpoint height
type: integer
format: uint32
minimum: 0
Backup:
type: object
required:
- fvk
properties:
seed:
type: string
nullable: true
description: Seed phrase
sk:
type: string
nullable: true
description: Secret key
fvk:
type: string
description: Full viewing key
TxRec:
type: object
required:
- address
- height
- memo
- timestamp
- txid
- value
properties:
txid:
type: string
description: transaction id
height:
type: integer
format: uint32
minimum: 0
description: block height
timestamp:
type: integer
format: uint32
minimum: 0
description: timestamp in secs since epoch
value:
type: integer
format: int64
description: value in zats
address:
type: string
description: zaddr
memo:
type: string
description: memo text
Payment:
type: object
required:
- confirmations
- recipients
properties:
recipients:
type: array
items:
$ref: '#/components/schemas/Recipient'
confirmations:
type: integer
format: uint32
minimum: 0
description: number of confirmations required for a note to be eligible for spending
Recipient:
type: object
required:
- address
- amount
- max_amount_per_note
- memo
- reply_to
- subject
properties:
address:
type: string
description: destination z-addr
amount:
type: integer
format: uint64
minimum: 0
description: amount in zats
reply_to:
type: boolean
description: if true, include sender addr in memo
subject:
type: string
description: subject included in the memo
memo:
type: string
description: memo text
max_amount_per_note:
type: integer
format: uint64
minimum: 0
description: split note if it exceeds this amount
Tx:
type: object
required:
- change
- height
- inputs
- outputs
- ovk
- t_inputs
properties:
height:
type: integer
format: uint32
minimum: 0
description: tx height
t_inputs:
description: transparent inputs
type: array
items:
$ref: '#/components/schemas/TTxIn'
inputs:
description: shielded inputs
type: array
items:
$ref: '#/components/schemas/TxIn'
outputs:
description: outputs
type: array
items:
$ref: '#/components/schemas/TxOut'
change:
description: change addr
type: string
ovk:
description: outgoing viewing key
type: string
TTxIn:
type: object
required:
- amount
- 'n'
- op
- script
properties:
op:
type: string
'n':
type: integer
format: uint32
minimum: 0
amount:
type: integer
format: uint64
minimum: 0
script:
type: string
TxIn:
type: object
required:
- amount
- diversifier
- fvk
- rseed
- witness
properties:
diversifier:
type: string
fvk:
type: string
amount:
type: integer
format: uint64
minimum: 0
rseed:
type: string
witness:
type: string
TxOut:
type: object
required:
- addr
- amount
- memo
- ovk
properties:
addr:
type: string
amount:
type: integer
format: uint64
minimum: 0
ovk:
type: string
memo:
type: string
PaymentURI:
type: object
required:
- address
- amount
- memo
properties:
address:
description: recipient address (taddr or zaddr)
type: string
amount:
description: amount in zats
type: integer
format: uint64
minimum: 0
memo:
description: memo text
type: string