-
Notifications
You must be signed in to change notification settings - Fork 16
/
swagger.yml
284 lines (284 loc) · 7.19 KB
/
swagger.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
#Not up to date
swagger: '2.0'
info:
title: Transaction builder API
description: The transaction builder API write transactions in the permissioned blockchain
version: 1.0.0
contact:
email: [email protected]
consumes:
- application/json
produces:
- application/json
schemes:
- http
host: localhost:3000
paths:
/wallet/create:
get:
tags:
- Wallet
summary: Generate an ethereum wallet, fuel it and save it in the vault
parameters:
- in: query
name: funderAddress
required: false
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/Wallet'
400:
description: Bad Input
500:
description: Unexpected error
/generic/get-user-address:
get:
tags:
- Generic
summary: Get the default ethereum address unlocked in api-smart-contract
parameters:
- in: query
name: identifierWalletID
required: false
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/Address'
500:
description: Unexpected error
/generic/get-contract-default-address:
get:
tags:
- Generic
summary: Get the ethereum address where the fetched contract is deployed
parameters:
- in: query
name: contractName
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/Address'
400:
description: Bad Input
404:
description: Not Found
500:
description: Unexpected error
/generic/get-contract-abi:
get:
tags:
- Generic
summary: Get the ABI associated to the contract name fetched
parameters:
- in: query
name: contractName
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/ABI'
400:
description: Bad Input
404:
description: Not Found
500:
description: Unexpected error
/generic/get-contract-balance:
get:
tags:
- Generic
summary: Get the balance associated to the contract deployed at the fetched address
parameters:
- in: query
name: contractAddress
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/Balance'
400:
description: Bad Input
500:
description: Unexpected error
/contract/deploy:
post:
tags:
- Contract
summary: Deploy the contract provided as an input
parameters:
- in: body
name: contract
description: Contract data
schema:
$ref: '#/definitions/Contract'
responses:
200:
description: Transaction hash
schema:
$ref: '#/definitions/TransactionReceipt'
500:
description: Unexpected error
/contract/transaction/{contract_name}/{function_name}:
post:
tags:
- Contract
summary: Send a transaction to trigger a non-view function
parameters:
- in: body
name: contract
description: Contract data
schema:
$ref: '#/definitions/NonViewFunction'
responses:
200:
description: Call return
schema:
$ref: '#/definitions/TransactionReceipt'
500:
description: Unexpected error
/contract/call/{contract_name}/{function_name}:
post:
tags:
- Contract
summary: Send a transaction to call a view function
parameters:
- in: path
name: contract_name
description: Name of the contract to call
- in: path
name: function_name
description: Name of the contract function to call
- in: query
name: contractAddress
type: string
description: Address of the contract to call
- in: query
name: signerAddress
type: string
description: Address of the signer making the call
- in: query
name: parameter1
type: string
description: First parameter of the function to call
- in: query
name: parameter2
type: string
description: Second parameter of the function to call
- in: query
name: parameter3
type: string
description: Etc.
responses:
200:
description: Security created
schema:
$ref: '#/definitions/TransactionReceipt'
500:
description: Unexpected error
/healthcheck:
get:
tags:
- Healthcheck
summary: endpoint allowing kuberneties to check if the API is up and live
responses:
200:
description: API is live
500:
description: Unexpected error
definitions:
Wallet:
type: object
properties:
address:
type: string
example: '0xf24339a4451510a461563F5044260Bffffffffff'
transactionHash:
type: string
example: '0x54f4f1b1cdef187a81b4aeeae6858633ac1f502973ee2e62b73c4d3de3624d6d'
Address:
type: string
example: '0xf24339a4451510a461563F5044260Bffffffffff'
ABI:
type: object
Balance:
type: integer
example: 34
TransactionReceipt:
type: object
Error:
type: object
properties:
status:
type: string
example: 'error'
message:
type: string
example: 'The following user was not found: Johnny Cadillac'
Contract:
type: object
properties:
contractName:
type: string
example: 'ERC1400ERC20'
signerAddress:
type: string
example: '0xF35015Ffba922b644DcA3b8e0D1b31d840792290'
arguments:
type: array
items:
type: string
description: parameters to be provided to the contract's constructor method
example:
- 'ERC1400TokenName'
- 'ERC1400TokenSymbol'
- 'Etc.'
NonViewFunction:
type: object
properties:
contractAddress:
type: string
example: '0x5e69478155B103aD3F79B647290695a4e875FE1E'
signerAddress:
type: string
example: '0xF35015Ffba922b644DcA3b8e0D1b31d840792290'
parameter1:
type: string
example: 'xxx'
parameter2:
type: string
example: 'yyy'
parameter3:
type: string
example: 'zzz'
etc:
type: string
example: 'etc.'
ViewFunction:
type: object
properties:
contractAddress:
type: string
example: '0x5e69478155B103aD3F79B647290695a4e875FE1E'
signerAddress:
type: string
example: '0xF35015Ffba922b644DcA3b8e0D1b31d840792290'
parameter1:
type: string
example: 'xxx'
parameter2:
type: string
example: 'yyy'
parameter3:
type: string
example: 'zzz'
etc:
type: string
example: 'etc.'