Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
867 lines (867 loc) · 21.9 KB
/
Copy pathopenapi.yaml
File metadata and controls
867 lines (867 loc) · 21.9 KB
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
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
components:
headers:
XRequestID:
description: >-
Unique identifier for the request. Include this in support requests to correlate client activity with server
logs. If you supply a valid UUID v4 in the `X-Request-ID` request header the server echoes it back; otherwise
the server generates one automatically.
schema:
example: 550e8400-e29b-41d4-a716-446655440000
format: uuid
type: string
XSchemaVersion:
description: >-
Request body schema version. Specify the schema version for request body validation. Defaults to version 1 if
not provided. Supported versions are listed in the X-Schema-Version-Supported response header. Use this header
to maintain backward compatibility when the API evolves.
schema:
example: 1.0.0
type: string
responses:
NotFound:
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
description: Resource not found
Unauthorized:
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
description: Missing or invalid API key
ValidationError:
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: Validation error
schemas:
Error:
properties:
error:
properties:
code:
example: VALIDATION_ERROR
type: string
message:
example: Validation failed
type: string
type: object
success:
example: false
type: boolean
type: object
NotFoundError:
properties:
error:
properties:
code:
example: NOT_FOUND
type: string
message:
example: Resource not found
type: string
type: object
success:
example: false
type: boolean
type: object
PaginationMeta:
properties:
direction:
enum:
- next
- prev
example: next
type: string
limit:
example: 20
type: integer
next_cursor:
example: eyJ0aW1lc3RhbXAiOiIyMDI0LTAxLTAxVDAwOjAwOjAwLjAwMFoiLCJpZCI6IjEifQ==
nullable: true
type: string
prev_cursor:
example: null
nullable: true
type: string
type: object
UnauthorizedError:
properties:
error:
properties:
code:
example: UNAUTHORIZED
type: string
message:
example: Invalid or missing API key
type: string
type: object
success:
example: false
type: boolean
type: object
ValidationError:
allOf:
- $ref: '#/components/schemas/Error'
- properties:
error:
properties:
code:
example: VALIDATION_ERROR
type: string
details:
items:
properties:
field:
type: string
message:
type: string
type: object
type: array
message:
example: Invalid request parameters
type: string
type: object
type: object
securitySchemes:
ApiKeyAuth:
description: API key passed in the x-api-key header. Obtain via `npm run keys:create`.
in: header
name: x-api-key
type: apiKey
info:
description: API for managing micro-donations on the Stellar blockchain network.
title: Stellar Micro-Donation API
version: 1.0.0
openapi: 3.0.0
paths:
/admin/audit-logs/export:
post:
requestBody:
content:
application/json:
schema:
properties:
endDate:
format: date-time
type: string
eventType:
type: string
format:
default: json
enum:
- json
- csv
type: string
startDate:
format: date-time
type: string
type: object
required: true
responses:
'202':
description: Export job queued
'400':
description: Validation error
security:
- ApiKeyAuth: []
summary: Queue an async audit log export job
tags:
- AuditLogExport
/admin/audit-logs/export/{jobId}/download:
get:
parameters:
- in: path
name: jobId
required: true
schema:
type: string
- in: query
name: format
schema:
enum:
- json
- csv
type: string
responses:
'200':
description: Signed download URL
'202':
description: Export not yet complete
'404':
description: Job not found
security:
- ApiKeyAuth: []
summary: Get signed download URL for completed export
tags:
- AuditLogExport
/admin/audit-logs/export/{jobId}/status:
get:
parameters:
- in: path
name: jobId
required: true
schema:
type: string
responses:
'200':
description: Job status
'404':
description: Job not found
security:
- ApiKeyAuth: []
summary: Poll export job status
tags:
- AuditLogExport
/donations:
get:
parameters:
- description: Maximum number of results
in: query
name: limit
schema:
type: integer
- description: Pagination cursor
in: query
name: cursor
schema:
type: string
responses:
'200':
description: List of donations
'401':
description: Unauthorized
security:
- ApiKeyAuth: []
summary: List all donations
tags:
- Donations
post:
requestBody:
content:
application/json:
schema:
properties:
amount:
description: Amount in XLM
type: number
memo:
description: Optional transaction memo
type: string
recipientPublicKey:
description: Stellar public key of the recipient
type: string
senderSecret:
description: Stellar secret key of the sender
type: string
required:
- senderSecret
- recipientPublicKey
- amount
type: object
required: true
responses:
'201':
description: Donation created successfully
headers:
X-Request-ID:
$ref: '#/components/headers/XRequestID'
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Validation error
'401':
description: Unauthorized
security:
- ApiKeyAuth: []
summary: Create a new donation
tags:
- Donations
/donations/limits:
get:
responses:
'200':
description: Donation limits
security:
- ApiKeyAuth: []
summary: Get donation amount limits
tags:
- Donations
/donations/recent:
get:
parameters:
- in: query
name: limit
schema:
default: 10
type: integer
responses:
'200':
description: Recent donations
security:
- ApiKeyAuth: []
summary: Get recent donations
tags:
- Donations
/donations/verify:
post:
requestBody:
content:
application/json:
schema:
properties:
transactionHash:
type: string
required:
- transactionHash
type: object
required: true
responses:
'200':
description: Verification result
security:
- ApiKeyAuth: []
summary: Verify a transaction on the blockchain
tags:
- Donations
/donations/{id}:
get:
parameters:
- in: path
name: id
required: true
schema:
type: integer
responses:
'200':
description: Donation details
'404':
description: Donation not found
security:
- ApiKeyAuth: []
summary: Get a specific donation
tags:
- Donations
/donations/{id}/status:
patch:
parameters:
- in: path
name: id
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
properties:
status:
enum:
- pending
- completed
- failed
type: string
required:
- status
type: object
required: true
responses:
'200':
description: Status updated
'404':
description: Donation not found
security:
- ApiKeyAuth: []
summary: Update donation status
tags:
- Donations
/liquidity-pools/deposit:
post:
requestBody:
content:
application/json:
schema:
properties:
assetA:
description: First asset (e.g. {type:"native"} or {type:"credit_alphanum4",code:"USDC",issuer:"G..."})
type: object
assetB:
description: Second asset
type: object
maxAmountA:
description: Maximum amount of assetA to deposit
type: string
maxAmountB:
description: Maximum amount of assetB to deposit
type: string
secret:
description: Source account secret key
type: string
required:
- secret
- assetA
- assetB
- maxAmountA
- maxAmountB
type: object
required: true
responses:
'200':
content:
application/json:
schema:
properties:
data:
properties:
ledger:
type: integer
poolId:
type: string
sharesReceived:
type: string
transactionId:
type: string
type: object
success:
type: boolean
type: object
description: Deposit successful
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Validation error
'401':
description: Unauthorized
security:
- ApiKeyAuth: []
summary: Deposit assets into a Stellar liquidity pool
tags:
- LiquidityPools
/liquidity-pools/withdraw:
post:
requestBody:
content:
application/json:
schema:
properties:
amount:
description: Number of pool shares to redeem
type: string
poolId:
type: string
secret:
type: string
required:
- secret
- poolId
- amount
type: object
required: true
responses:
'200':
description: Withdrawal successful
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: Validation error
'401':
description: Unauthorized
security:
- ApiKeyAuth: []
summary: Withdraw assets from a Stellar liquidity pool
tags:
- LiquidityPools
/liquidity-pools/{id}/earnings:
get:
parameters:
- description: Pool ID
in: path
name: id
required: true
schema:
type: string
responses:
'200':
description: Pool earnings
'404':
description: Pool not found
security:
- ApiKeyAuth: []
summary: Get earnings for a liquidity pool
tags:
- LiquidityPools
/stats/daily:
get:
responses:
'200':
description: Daily stats
security:
- ApiKeyAuth: []
summary: Get daily donation statistics
tags:
- Statistics
/stats/donors:
get:
responses:
'200':
description: Donor stats
security:
- ApiKeyAuth: []
summary: Get donor statistics
tags:
- Statistics
/stats/recipients:
get:
responses:
'200':
description: Recipient stats
security:
- ApiKeyAuth: []
summary: Get recipient statistics
tags:
- Statistics
/stats/summary:
get:
responses:
'200':
description: Summary analytics
security:
- ApiKeyAuth: []
summary: Get summary analytics
tags:
- Statistics
/stats/weekly:
get:
responses:
'200':
description: Weekly stats
security:
- ApiKeyAuth: []
summary: Get weekly donation statistics
tags:
- Statistics
/stream/create:
post:
requestBody:
content:
application/json:
schema:
properties:
amount:
type: number
donorPublicKey:
type: string
frequency:
enum:
- daily
- weekly
- monthly
type: string
recipientPublicKey:
type: string
required:
- donorPublicKey
- recipientPublicKey
- amount
- frequency
type: object
required: true
responses:
'201':
description: Schedule created
'400':
description: Validation error
security:
- ApiKeyAuth: []
summary: Create a recurring donation schedule
tags:
- Stream
/stream/schedules:
get:
responses:
'200':
description: List of schedules
security:
- ApiKeyAuth: []
summary: List all recurring donation schedules
tags:
- Stream
/stream/schedules/{id}:
delete:
parameters:
- in: path
name: id
required: true
schema:
type: integer
responses:
'200':
description: Schedule cancelled
'404':
description: Schedule not found
security:
- ApiKeyAuth: []
summary: Cancel a recurring donation schedule
tags:
- Stream
get:
parameters:
- in: path
name: id
required: true
schema:
type: integer
responses:
'200':
description: Schedule details
'404':
description: Schedule not found
security:
- ApiKeyAuth: []
summary: Get a specific schedule
tags:
- Stream
/transactions:
get:
parameters:
- in: query
name: limit
schema:
default: 20
type: integer
- in: query
name: cursor
schema:
type: string
responses:
'200':
description: Paginated transaction list
security:
- ApiKeyAuth: []
summary: Get paginated transactions
tags:
- Transactions
/transactions/multisig:
post:
requestBody:
content:
application/json:
schema:
properties:
network_passphrase:
type: string
required_signers:
minimum: 2
type: integer
signer_keys:
items:
type: string
type: array
transaction_xdr:
type: string
required:
- transaction_xdr
- network_passphrase
- required_signers
- signer_keys
type: object
required: true
responses:
'201':
description: Multi-sig transaction created
security:
- ApiKeyAuth: []
summary: Create a pending multi-sig transaction
tags:
- Transactions
/transactions/multisig/collect:
post:
requestBody:
content:
application/json:
schema:
properties:
id:
type: integer
signed_xdr:
type: string
signer:
type: string
required:
- id
- signer
- signed_xdr
type: object
required: true
responses:
'200':
description: Signature collected; submitted if threshold met
'400':
content:
application/json:
schema:
properties:
error:
properties:
code:
example: INSUFFICIENT_SIGNATURES
type: string
collected:
type: integer
remaining:
type: integer
required:
type: integer
type: object
success:
example: false
type: boolean
type: object
description: Insufficient signatures
security:
- ApiKeyAuth: []
summary: Collect a signature for a pending multi-sig transaction
tags:
- Transactions
/transactions/sync:
post:
requestBody:
content:
application/json:
schema:
properties:
publicKey:
type: string
required:
- publicKey
type: object
required: true
responses:
'200':
description: Sync completed
security:
- ApiKeyAuth: []
summary: Sync wallet transactions from Stellar network
tags:
- Transactions
/wallets:
get:
responses:
'200':
description: List of wallets
security:
- ApiKeyAuth: []
summary: List all wallets
tags:
- Wallets
post:
requestBody:
content:
application/json:
schema:
properties:
label:
type: string
publicKey:
description: Stellar public key
type: string
required:
- publicKey
type: object
required: true
responses:
'201':
description: Wallet created
'400':
description: Validation error
security:
- ApiKeyAuth: []
summary: Create wallet metadata
tags:
- Wallets
/wallets/{id}:
get:
parameters:
- in: path
name: id
required: true
schema:
type: integer
responses:
'200':
description: Wallet details
'404':
description: Wallet not found
security:
- ApiKeyAuth: []
summary: Get a specific wallet
tags:
- Wallets
patch:
parameters:
- in: path
name: id
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
properties:
label:
type: string
type: object
required: true
responses:
'200':
description: Wallet updated
security:
- ApiKeyAuth: []
summary: Update wallet metadata
tags:
- Wallets
/wallets/{publicKey}/transactions:
get:
parameters:
- in: path
name: publicKey
required: true
schema:
type: string
responses:
'200':
description: Transaction list
security:
- ApiKeyAuth: []
summary: Get all transactions for a wallet
tags:
- Wallets
security:
- ApiKeyAuth: []
servers:
- description: Current server
url: /
tags:
- description: Create and manage donations on the Stellar network
name: Donations
- description: Wallet metadata management
name: Wallets
- description: Recurring donation schedules
name: Stream
- description: Transaction history and synchronization
name: Transactions
- description: Donation analytics and statistics
name: Statistics
- description: Stellar AMM liquidity pool deposit, withdrawal, and earnings
name: LiquidityPools
- description: Compliance audit log export with async jobs and signed URLs
name: AuditLogExport