-
Notifications
You must be signed in to change notification settings - Fork 1
/
openapi.yaml
202 lines (202 loc) · 5.32 KB
/
openapi.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
openapi: 3.0.0
info:
title: Faucet API
description: Interface between front-end and back-end.
version: "0"
paths:
/claim:
summary: Claim coins.
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ClaimRequest'
required: true
responses:
"200":
description: Successful claim.
content:
application/json:
schema:
$ref: '#/components/schemas/ClaimSucceeded'
"400":
description: Invalid request or parameters.
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidRequest'
"403":
description: Claim rejected.
content:
application/json:
schema:
$ref: '#/components/schemas/ClaimRejected'
"500":
description: Claim failed.
content:
application/json:
schema:
$ref: '#/components/schemas/RequestFailed'
"503":
description: Service unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
/info:
summary: Query client and service information.
get:
responses:
"200":
description: Client and service information.
content:
application/json:
schema:
$ref: '#/components/schemas/Info'
"500":
description: Internal error.
content:
application/json:
schema:
$ref: '#/components/schemas/RequestFailed'
"503":
description: Service unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailable'
components:
schemas:
ClaimRejected:
required:
- rejectReason
type: object
properties:
rejectReason:
type: string
enum:
- InvalidToken
- MustWait
wait:
type: string
description: The client with this IP address cannot claim coins before the
given time.
format: date-time
example:
rejectReason: MustWait
wait: 2000-01-23T04:56:07Z
ClaimRequest:
required:
- recipient
type: object
properties:
recipient:
type: string
description: Cryptocurrency recipient address.
token:
type: string
description: The token obtained from earlier API call.
example:
recipient: nUvxPtXWKwatQim1dDbjBc6vSSWKwDvYHn
token: WLXhQ7dxIzSNRMseNEFYA
ClaimSucceeded:
required:
- amount
- txid
type: object
properties:
amount:
type: number
description: Actual amount of coins sent.
txid:
type: string
description: Cryptocurrency transaction identifier (hash).
example:
amount: 100
txid: 62a626a004273e0c4e7f526e2381de8a36591feb72b8019d16a75c44e606ea15
Info:
required:
- amount
type: object
properties:
addressVersions:
type: array
description: Accepted recipient address versions. If this parameter is absent,
front-end should accept any address version.
items:
type: integer
amount:
type: number
description: Expected giveaway amount. Actual amount may differ. Zero means
dry or paused faucet.
token:
type: string
description: A token that must be passed to other API calls where specified.
It is valid for at least 1 hour.
wait:
type: string
description: The client with this IP address cannot claim coins before the
given time.
format: date-time
example:
addressVersions:
- 113
- 196
amount: 100
token: WLXhQ7dxIzSNRMseNEFYA
wait: 2000-01-23T04:56:07Z
InvalidRequest:
required:
- requestErrors
type: object
properties:
requestErrors:
type: array
items:
$ref: '#/components/schemas/RequestError'
example:
requestErrors:
- error: InvalidValue
parameter: recipient
RequestError:
required:
- error
type: object
properties:
error:
type: string
description: The problem.
enum:
- InvalidFormat
- InvalidValue
- MissingValue
parameter:
type: string
description: Which request parameter has the problem. This is absent if
overall request is invalid.
RequestFailed:
required:
- error
type: object
properties:
error:
type: string
enum:
- FailedToSend
- InternalError
example:
error: InternalError
ServiceUnavailable:
required:
- error
type: object
properties:
error:
type: string
enum:
- NoFunds
- ServicePaused
- ServiceUnavailable
example:
error: ServiceUnavailable