Skip to content

Commit 3908dd8

Browse files
committed
Deploying to gh-pages from @ 579bb8a 🚀
1 parent db0286c commit 3908dd8

File tree

2 files changed

+245
-24
lines changed

2 files changed

+245
-24
lines changed

‎openapi.json

Lines changed: 147 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,83 @@
3838
}
3939
},
4040
"responses": {
41-
"204": {
42-
"description": "No content"
41+
"201": {
42+
"description": "Airdrop was created, transaction was queued",
43+
"content": {
44+
"application/vnd.api+json": {
45+
"schema": {
46+
"type": "object",
47+
"required": [
48+
"data"
49+
],
50+
"properties": {
51+
"data": {
52+
"$ref": "#/components/schemas/Airdrop"
53+
}
54+
}
55+
}
56+
}
57+
}
4358
},
44-
"401": {
45-
"$ref": "#/components/responses/invalidAuth"
59+
"400": {
60+
"$ref": "#/components/responses/invalidParameter"
61+
},
62+
"409": {
63+
"description": "Airdrop was already done",
64+
"content": {
65+
"application/vnd.api+json": {
66+
"schema": {
67+
"$ref": "#/components/schemas/Errors"
68+
}
69+
}
70+
}
71+
},
72+
"500": {
73+
"$ref": "#/components/responses/internalError"
74+
}
75+
}
76+
}
77+
},
78+
"/integrations/airdrop-svc/airdrops/{id}": {
79+
"get": {
80+
"tags": [
81+
"Airdrop"
82+
],
83+
"summary": "Create airdrop",
84+
"description": "Create an airdrop for unique user. The proof will be verified.",
85+
"operationId": "createAirdrop",
86+
"parameters": [
87+
{
88+
"in": "path",
89+
"name": "id",
90+
"description": "User nullifier",
91+
"required": true,
92+
"schema": {
93+
"type": "string",
94+
"example": "0x04a32216f2425dc7343031352de3d62a7b0d3b4bf7a66d6c8c2aa8c9f4f2632b"
95+
}
96+
}
97+
],
98+
"responses": {
99+
"200": {
100+
"content": {
101+
"application/vnd.api+json": {
102+
"schema": {
103+
"type": "object",
104+
"required": [
105+
"data"
106+
],
107+
"properties": {
108+
"data": {
109+
"$ref": "#/components/schemas/Airdrop"
110+
}
111+
}
112+
}
113+
}
114+
}
115+
},
116+
"400": {
117+
"$ref": "#/components/responses/invalidParameter"
46118
},
47119
"404": {
48120
"$ref": "#/components/responses/notFound"
@@ -66,6 +138,77 @@
66138
},
67139
"components": {
68140
"schemas": {
141+
"Airdrop": {
142+
"allOf": [
143+
{
144+
"$ref": "#/components/schemas/AirdropKey"
145+
},
146+
{
147+
"type": "object",
148+
"required": [
149+
"attributes"
150+
],
151+
"properties": {
152+
"attributes": {
153+
"type": "object",
154+
"required": [
155+
"address",
156+
"status",
157+
"created_at",
158+
"updated_at"
159+
],
160+
"properties": {
161+
"address": {
162+
"type": "string",
163+
"description": "Destination address for the airdrop",
164+
"example": "rarimo1qlyq3ej7j7rrkw6sluz658pzne88ymf66vjcap"
165+
},
166+
"status": {
167+
"type": "string",
168+
"description": "Status of the airdrop transaction",
169+
"enum": [
170+
"pending",
171+
"completed"
172+
]
173+
},
174+
"created_at": {
175+
"type": "string",
176+
"format": "time.Time",
177+
"description": "RFC3339 UTC timestamp of the airdrop creation",
178+
"example": "2021-09-01T00:00:00Z"
179+
},
180+
"updated_at": {
181+
"type": "string",
182+
"format": "time.Time",
183+
"description": "RFC3339 UTC timestamp of the airdrop successful tx",
184+
"example": "2021-09-01T00:00:00Z"
185+
}
186+
}
187+
}
188+
}
189+
}
190+
]
191+
},
192+
"AirdropKey": {
193+
"type": "object",
194+
"required": [
195+
"id",
196+
"type"
197+
],
198+
"properties": {
199+
"id": {
200+
"type": "string",
201+
"description": "User nullifier",
202+
"example": "0x04a32216f2425dc7343031352de3d62a7b0d3b4bf7a66d6c8c2aa8c9f4f2632b"
203+
},
204+
"type": {
205+
"type": "string",
206+
"enum": [
207+
"airdrop"
208+
]
209+
}
210+
}
211+
},
69212
"CreateAirdrop": {
70213
"allOf": [
71214
{
@@ -179,16 +322,6 @@
179322
}
180323
}
181324
},
182-
"invalidAuth": {
183-
"description": "You must provide a valid authorization params.",
184-
"content": {
185-
"application/vnd.api+json": {
186-
"schema": {
187-
"$ref": "#/components/schemas/Errors"
188-
}
189-
}
190-
}
191-
},
192325
"invalidParameter": {
193326
"description": "One of the parameters is invalid. Refer to the response body for details.",
194327
"content": {

‎openapi.yaml

Lines changed: 98 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,55 @@ paths:
2525
data:
2626
$ref: '#/components/schemas/CreateAirdrop'
2727
responses:
28-
'204':
29-
description: No content
30-
'401':
31-
$ref: '#/components/responses/invalidAuth'
28+
'201':
29+
description: 'Airdrop was created, transaction was queued'
30+
content:
31+
application/vnd.api+json:
32+
schema:
33+
type: object
34+
required:
35+
- data
36+
properties:
37+
data:
38+
$ref: '#/components/schemas/Airdrop'
39+
'400':
40+
$ref: '#/components/responses/invalidParameter'
41+
'409':
42+
description: Airdrop was already done
43+
content:
44+
application/vnd.api+json:
45+
schema:
46+
$ref: '#/components/schemas/Errors'
47+
'500':
48+
$ref: '#/components/responses/internalError'
49+
'/integrations/airdrop-svc/airdrops/{id}':
50+
get:
51+
tags:
52+
- Airdrop
53+
summary: Create airdrop
54+
description: Create an airdrop for unique user. The proof will be verified.
55+
operationId: createAirdrop
56+
parameters:
57+
- in: path
58+
name: id
59+
description: User nullifier
60+
required: true
61+
schema:
62+
type: string
63+
example: '0x04a32216f2425dc7343031352de3d62a7b0d3b4bf7a66d6c8c2aa8c9f4f2632b'
64+
responses:
65+
'200':
66+
content:
67+
application/vnd.api+json:
68+
schema:
69+
type: object
70+
required:
71+
- data
72+
properties:
73+
data:
74+
$ref: '#/components/schemas/Airdrop'
75+
'400':
76+
$ref: '#/components/responses/invalidParameter'
3277
'404':
3378
$ref: '#/components/responses/notFound'
3479
'409':
@@ -41,6 +86,55 @@ paths:
4186
$ref: '#/components/responses/internalError'
4287
components:
4388
schemas:
89+
Airdrop:
90+
allOf:
91+
- $ref: '#/components/schemas/AirdropKey'
92+
- type: object
93+
required:
94+
- attributes
95+
properties:
96+
attributes:
97+
type: object
98+
required:
99+
- address
100+
- status
101+
- created_at
102+
- updated_at
103+
properties:
104+
address:
105+
type: string
106+
description: Destination address for the airdrop
107+
example: rarimo1qlyq3ej7j7rrkw6sluz658pzne88ymf66vjcap
108+
status:
109+
type: string
110+
description: Status of the airdrop transaction
111+
enum:
112+
- pending
113+
- completed
114+
created_at:
115+
type: string
116+
format: time.Time
117+
description: RFC3339 UTC timestamp of the airdrop creation
118+
example: '2021-09-01T00:00:00Z'
119+
updated_at:
120+
type: string
121+
format: time.Time
122+
description: RFC3339 UTC timestamp of the airdrop successful tx
123+
example: '2021-09-01T00:00:00Z'
124+
AirdropKey:
125+
type: object
126+
required:
127+
- id
128+
- type
129+
properties:
130+
id:
131+
type: string
132+
description: User nullifier
133+
example: '0x04a32216f2425dc7343031352de3d62a7b0d3b4bf7a66d6c8c2aa8c9f4f2632b'
134+
type:
135+
type: string
136+
enum:
137+
- airdrop
44138
CreateAirdrop:
45139
allOf:
46140
- $ref: '#/components/schemas/CreateAirdropKey'
@@ -119,12 +213,6 @@ components:
119213
application/vnd.api+json:
120214
schema:
121215
$ref: '#/components/schemas/Errors'
122-
invalidAuth:
123-
description: You must provide a valid authorization params.
124-
content:
125-
application/vnd.api+json:
126-
schema:
127-
$ref: '#/components/schemas/Errors'
128216
invalidParameter:
129217
description: One of the parameters is invalid. Refer to the response body for details.
130218
content:

0 commit comments

Comments
 (0)