-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpld-openapi-docs.yaml
603 lines (600 loc) · 16.5 KB
/
pld-openapi-docs.yaml
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
openapi: 3.0.3
info:
title: Pkt Lightning Network Daemon (pld)
description: |-
this is the API functionality for the pld features to create and unlock a wallet, create addresses, send pkt between addresses, and to inspect addresses ad transactions
Note that ALL REQUESTS require a `Content-Type: application/json` HTTP header to ffunction properly
Some useful links:
- [Pkt software](https://github.com/pkt-cash/pktd)
termsOfService: http://swagger.io/terms/
contact:
email: [email protected]
license:
name: ISC
url: https://github.com/pkt-cash/pktd/blob/develop/LICENSE
version: develop
externalDocs:
description: Find out more about PKT
url: http://pkt.cash
servers:
- url: https://localhost:8080
tags:
- name: address
description: Address information
- name: wallet
description: Create and unlock wallet
- name: transactions
description: Send PKT and get transaction information
paths:
/api/v1/util/seed/create:
post:
tags:
- wallet
summary: UpdateCreate a 15-word seed phrase
description: Create a 15-word seed phrase. Cannot be done after a wallet is created
operationId: genSeed
requestBody:
description: Create a new seed phrase
content:
application/json:
schema:
$ref: '#/components/schemas/Empty'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/SeedWords'
/api/v1/wallet/seed:
get:
tags:
- wallet
summary: Get a user's wallet seed. Wallet unlock required
description: Get a user's wallet seed. Wallet unlock required
operationId: getSeed
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/SeedWords'
/api/v1/wallet/create:
post:
tags:
- wallet
summary: Create a wallet.
description: Create a wallet from an existing seed and password. Optional "seed passphrase" encrypts seed
operationId: createwallet
requestBody:
description: Create a wallet
content:
application/json:
schema:
$ref: '#/components/schemas/CreateWallet'
required: true
responses:
'200':
description: successful operation
/api/v1/wallet/unlock:
post:
tags:
- wallet
summary: Unlock wallet
description: Unlock a wallet. Can only be done once. Throws an error on second unlock
operationId: unlockWallet
requestBody:
description: Unlock a wallet, optional seed passphrase encrypts 15-word seed phrase
content:
application/json:
schema:
$ref: '#/components/schemas/UnlockWallet'
required: true
responses:
'200':
description: successful operation
'500':
description: Wallet already unlocked
/api/v1/wallet/changepassphrase:
post:
tags:
- wallet
summary: Change wallet password.
description: Change wallet password. Note that passwords are base64-encoded. Wallet unlock required.
operationId: changePassphrase
requestBody:
description: Change wallet password. Note that passwords are base64-encoded.
content:
application/json:
schema:
$ref: '#/components/schemas/ChangePassword'
required: true
responses:
'200':
description: successful operation
'500':
description: invalid current password
/api/v1/wallet/address/create:
post:
tags:
- addresses
summary: Create new PKT address
description: Create a new PKT address from a wallet master private key. Wallet unlock required.
operationId: createAddress
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
/api/v1/wallet/address/balances:
post:
tags:
- addresses
summary: List addresses
description: List addresses and balances in a wallet. Wallet unlock required.
operationId: listAddresses
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ListAddressRequest'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Addresses'
/api/v1/wallet/balance:
get:
tags:
- addresses
summary: Get total balance
description: Get total balance in wallet, denominated in satoshis. Wallet unlock required.
operationId: getTotalbalance
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/TotalBalance'
/api/v1/wallet/transaction/sendfrom:
post:
tags:
- transactions
summary: Send PKT
description: Send PKT from one address to another. Amount denominated in PKT. Wallet unlock required.
operationId: sendFrom
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SendRequest'
responses:
'200':
description: successful operation
content:
application/text:
example: "093e8ac60e197e12a50c52489c1ec163e55cbbcd40d208f0d89077ba4bbc5c1b"
/api/v1/wallet/transaction/query:
post:
tags:
- transactions
summary: List transactions
description: List all transactions. Wallet unlock required
operationId: listTransactions
requestBody:
description: List all transactions
content:
application/json:
schema:
$ref: '#/components/schemas/ListTransactionRequest'
responses:
default:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/QueryTransactionsResponse'
/pkt/v1/gettransaction/:
post:
tags:
- transactions
summary: Inspect a single transaction
description: Inspect a single transaction. Wallet unlock required.
operationId: getTransaction
requestBody:
description: List all transactions
content:
application/json:
schema:
$ref: '#/components/schemas/GetTransactionRequest'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/QueryTransactionResponse'
/api/v1/meta/getinfo:
get:
tags:
- wallet
summary: Get wallet and syncing inffo
description: Get wallet ind syncing info. Wallet unlock *not* required, but different information returned when wallet is unlocked
operationId: getInfo
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/WalletInfoResponse'
components:
schemas:
Tag:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
xml:
name: tag
Empty:
type: object
SeedWords:
required:
- seed
type: object
properties:
seed:
type: array
items:
type: string
example: ["island","play","toy","rose","approve","spatial","hurt","cricket","awkward","catch","shock","egg","first","extra","almost"]
CreateWallet:
required:
- walletPassphrase
- walletSeed
type: object
properties:
walletPassphrase:
type: string
example: "password123!"
seedPassphrase:
type: string
example: "optionalEncryptSeedPhrase123!"
walletSeed:
type: array
items:
type: string
example: ["island","play","toy","rose","approve","spatial","hurt","cricket","awkward","catch","shock","egg","first","extra","almost"]
UnlockWallet:
required:
- walletPassphrase
type: object
properties:
walletPassphrase:
type: string
example: "password123!"
ChangePassword:
required:
- currentPassphrase
- newPassphrase
type: object
properties:
currentPassphrase:
type: string
format: base64
example: "cGFzc3dvcmQxMjMh"
newPassphrase:
type: string
format: base64
example: "bmV3UGFzc3dvcmQxMjM="
Address:
required:
- address
type: object
properties:
address:
type: string
example: "pkt1q7j6ufe2dktp7gxgjycugvzlm44t6jcztlhqf8m"
ListAddressRequest:
required:
- showzerobalance
type: object
properties:
showzerobalance:
type: boolean
description: true if you want to list addresses with empty balances
example: true
Addresses:
required:
- addrs
type: object
properties:
addrs:
type: string
TotalBalance:
required:
- totalBalance
type: object
properties:
totalBalance:
type: number
format: int64
example: 123456
SendRequest:
required:
- amount
- toAddress
- fromAddress
type: object
properties:
amount:
type: number
format: float
example: 12.3456
toAddress:
type: string
example: "pkt1q7j6ufe2dktp7gxgjycugvzlm44t6jcztlhqf8m"
fromAddress:
type: string
example: "pkt1q7j6ufe2dktp7gxgjycugvzlm44t6jcztlhqf8m"
ListTransactionRequest:
required:
- coinbase
- startHeight
- endHeight
type: object
properties:
coinbase:
description: 1 to exclude mining transactions, 0 to show mining transactions
type: number
format: int32
example: 1
startHeight:
description: highest block to start reading
type: number
format: int32
example: 1204302345
endHeight:
description: lowest block to start reading from
type: number
format: int32
example: 1
txnsSkip:
description: paginate by skipping `txnsSkip` transactions
type: number
format: int32
example: 1000
txnsLimit:
description: show only `txnsLimit` transactions
type: number
format: int32
example: 50
SimpleTransaction:
required:
- abandoned
- account
- address
- amount
- blockhash
- blocktime
- category
- confirmations
- fee
- time
- timereceived
- trusted
- txid
- vout
- walletconflicts
type: object
properties:
abandoned:
type: boolean
example: false
account:
type: string
example: ''
address:
type: string
example: 'pkt1qwpw7pd44r6ghl9whr0sgsnz8t66zm27ejqm5ka'
amount:
type: number
format: int64
example: -29700
blockhash:
type: string
example: 'c3877f15eeeaf3aa6371d15e47890e89e36fbf49425b555d7a0bd0a6019d6472'
blocktime:
type: number
format: timestamp
example: 1629036261,
category:
type: string
example: 'send'
confirmations:
type: number
example: 2926
fee:
type: number
format: float
example: -1.3131648302078247e-07
time:
type: number
format: timestamp
example: 1629036261
timereceived:
type: number
format: timestamp
example: 1629036261
trusted:
type: boolean
example: false
txid:
type: string
example: '093e8ac60e197e12a50c52489c1ec163e55cbbcd40d208f0d89077ba4bbc5c1b'
vout:
type: number
example: 0
walletconflicts:
type: array
items:
type: string
example: []
QueryTransactionsResponse:
required:
- transactions
type: object
properties:
transactions:
type: array
items:
$ref: '#/components/schemas/SimpleTransaction'
DetailedTransaction:
required:
- amount
- fee
- confirmations
- blockhash
- blockindex
- blocktime
- txid
- walletconflicts
- time
- timereceived
- details
- hex
type: object
properties:
amount:
type: number
format: float
example: 599.9999998686835
fee:
type: number
format: int64
example: 1.3131648302078247e-7
confirmations:
type: number
format: int32
example: 2936
blockhash:
type: string
example: "c3877f15eeeaf3aa6371d15e47890e89e36fbf49425b555d7a0bd0a6019d6472"
blockindex:
type: number
format: int32
example: 0
blocktime:
type: number
format: timestamp
example: 1629036261
txid:
type: string
example: "093e8ac60e197e12a50c52489c1ec163e55cbbcd40d208f0d89077ba4bbc5c1b"
walletconflicts:
type: array
items:
type: string
example: []
time:
type: number
format: timestamp
example: 1629036261
timereceived:
type: number
format: timestamp
example: 1629036261
details:
type: array
items:
type: object
properties:
account:
type: string
example: "default"
amount:
type: number
format: float
example: 599.9999998686835
category:
type: string
example: "send"
vout:
type: number
format: int32
example: 0
hex:
type: string
example: "0100000001b82dce307016b6bbdbcd0854afc347c4fda74d3c37d9d584128a69c272d355c00000000000ffffffff0200000000011d0000160014705de0b6b51e917f95d71be0884c475eb42dabd973ffffff950000001600140bce1c1dbbb738780b4b37dfd16d58c85d2e979a00000000"
GetTransactionRequest:
required:
- txid
type: object
properties:
txid:
type: string
example: "093e8ac60e197e12a50c52489c1ec163e55cbbcd40d208f0d89077ba4bbc5c1b"
QueryTransactionResponse:
required:
- transactions
type: object
properties:
transaction:
$ref: '#/components/schemas/DetailedTransaction'
WalletInfoResponse:
required:
- neutrino
- height
- version
type: object
properties:
version:
type: string
example: "0.0.0-unknown"
height:
type: number
format: int32
example: 10223000232
neutrino:
type: object
properties:
isSyncing:
type: boolean
example: false
height:
type: number
format: int32
example: 10223000232
peers:
type: array
items:
type: object
properties:
lastBlock:
type: number
format: int32
example: 10223000232
wallet:
type: object
properties:
currentHeight:
type: number
format: int32
example: 10223000232
walletStats:
type: object
properties:
syncing:
type: boolean
example: false