-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
307 lines (306 loc) · 7.88 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
openapi: 3.0.3
info:
title: Librty Development Kit
description: >-
This document is based on the OpenAPI 3.0 specification.
The api endpoints described in this document needs an API key. Contact us to get your api key
termsOfService: none
contact:
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
externalDocs:
description: none
url: none
servers:
- url: https://ldk.librty.xyz
- url: https://ldk.staging.librty.xyz
tags:
- name: wallet
description: Access from Game Client
externalDocs:
description: none
url: none
paths:
/wallet/getAccessToken:
post:
tags:
- wallet
summary: Login to the librty backend and get access token
description: Verify access to wallet and get a JWT token
requestBody:
description: Signed message
content:
application/json:
schema:
$ref: '#/components/schemas/Signature'
required: true
responses:
'200':
description: Successfull Login
content:
application/json:
schema:
$ref: '#/components/schemas/Jwt'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- api_key: []
/wallet/refreshAccessToken:
get:
tags:
- wallet
summary: refresh your access token
description: If your access token is expired you can refresh it using this api
responses:
'200':
description: Successfully Refreshed
content:
application/json:
schema:
$ref: '#/components/schemas/Jwt'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- api_key: []
bearerAuth: []
/wallet/tokenGrant:
post:
tags:
- wallet
summary: grant tokens to a verified user
description: Grants tokens to a user
requestBody:
description: address
content:
application/json:
schema:
$ref: '#/components/schemas/TokenGrant'
required: true
responses:
'200':
description: Grant Response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenGrantResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- api_key: []
bearerAuth: []
/wallet/tokenDeduct:
post:
tags:
- wallet
summary: get tokens deduct transaction for a user
description: get tokens transfer transaction
requestBody:
description: address
content:
application/json:
schema:
$ref: '#/components/schemas/TokenDeduct'
required: true
responses:
'200':
description: Deduct Response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenDeductResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- api_key: []
bearerAuth: []
/wallet/tokenGrantStatus:
post:
tags:
- wallet
summary: status of grant tokens
description: get status of the granted tokens to an address
requestBody:
description: transaction id
content:
application/json:
schema:
$ref: '#/components/schemas/TokenGrantStatus'
required: true
responses:
'200':
description: Successfully granted
content:
application/json:
schema:
$ref: '#/components/schemas/TokenGrantStatusResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- api_key: []
bearerAuth: []
components:
schemas:
TokenGrant:
type: object
properties:
address:
type: string
example: 0xQWERTYUIOPASDFGHJKLZXCVBNM123456
tokens:
type: string
example: '1000'
TokenDeduct:
type: object
properties:
address:
type: string
example: 0xQWERTYUIOPASDFGHJKLZXCVBNM123456
amount:
type: string
example: '1000'
TokenGrantStatus:
type: object
properties:
address:
type: string
example: 0xQWERTYUIOPASDFGHJKLZXCVBNM123456
txnId:
type: string
example: 'asdasFECdcmsnf'
Signature:
type: object
properties:
signer:
type: string
example: 0xQWERTYUIOPASDFGHJKLZXCVBNM123456
message:
type: string
example: verify me
signature:
type: string
example: 0xSHJGRSKNGJRKHJKNJDSKNFJSKNGFDFSD
Jwt:
type: object
properties:
address:
type: string
example: 0xQWERTYUIOPASDFGHJKLZXCVBNM123456
accessToken:
type: string
example: FDJSKLF.FDKSLFS.FDSFSF
refreshToken:
type: string
example: FDJSKLF.FDKSLFS.FDSFSF
TokenGrantResponse:
type: object
properties:
address:
type: string
example: 0xQWERTYUIOPASDFGHJKLZXCVBNM123456
txnId:
type: string
example: 'asdasFECdcmsnf'
TokenDeductResponse:
type: object
properties:
type:
type: string
example: 0x0
nonce:
type: string
example: 0xb
gasPrice:
type: string
example: 0x763948fb
maxPriorityFeePerGas:
type: string
example: 0x763948fb
maxFeePerGas:
type: string
example: 0x763948fb
gas:
type: string
example: 0x5444
value:
type: string
example: 0x0
input:
type: string
example: 0xa9059cbb00000000000000000000000052b50644a9fef330ffc7a93d92a4b7591d5a3903000000000000000000000000000000000000000000000000000000000000000a
v:
type: string
example: 0x0
r:
type: string
example: 0x0
s:
type: string
example: 0x0
to:
type: string
example: 0x8b0bca2bb41b126a2bd43453cc0c25a4b8f7cc31
hash:
type: string
example: 0x8230b1e3e701e677666b9b4a6f4a66793f99a2a4f7c9a3a593dcb7a019d2a52a
TokenGrantStatusResponse:
type: object
properties:
txnId:
type: string
example: 'asdasFECdcmsnf'
status:
type: string
example: 'processing'
Error:
type: object
properties:
code:
type: string
example: error
message:
type: string
example: some error occured
required:
- code
- message
responses:
NotFound:
description: The specified resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
BadRequest:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
api_key:
type: apiKey
name: X-API-KEY
in: header
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT