-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
278 lines (273 loc) · 8.41 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
openapi: 3.0.0
info:
title: Wallet Core API
description: An all-in-one cryptocurrency service that enables users to effortlessly generate HD wallets, access wallet information, retrieve transaction details, broadcast transactions, and offers various other cutting-edge features for seamless cryptocurrency management.
version: 0.0.0
servers:
- url: http://127.0.0.1:3000
paths:
/health:
get:
tags:
- Health
summary: Health
description: This endpoint will check the readiness and liveness of the service.
operationId: Health
responses:
204:
description: No Content response.
/v1/hdwallet:
post:
tags:
- HDWallet
summary: Create an HDWallet
description: By using this endpoint, you can create an HDWallet using request parameters.
operationId: CreateHDWallet
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateHDWalletRequest'
responses:
200:
description: Response to creating an HDWallet.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateHDWalletResponse'
400:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v1/{symbol}/transaction/{transactionId}:
get:
tags:
- Transaction
summary: Get Transaction Info
description: By using this endpoint, you can retrieve the transaction info.
operationId: GetTransactionInfo
parameters:
- name: symbol
in: path
required: true
schema:
type: string
example: BTC
- name: network
in: query
required: false
schema:
type: string
example: Bitcoin
- name: transactionId
in: path
required: true
schema:
type: string
example: 'bbd4a06ba81cd97a8f1e7ab4fd9fea9f324f5d2c83c50de2b19d6f3dc7197c4d'
responses:
200:
description: Response to getting the transaction info.
content:
application/json:
schema:
$ref: '#/components/schemas/GetTransactionInfoResponse'
400:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v1/{symbol}/wallet/{walletId}:
get:
tags:
- Wallet
summary: Get Wallet Info
description: You can retrieve the wallet info and its last ten transactions using this endpoint.
operationId: GetWalletInfo
parameters:
- name: symbol
in: path
required: true
schema:
type: string
example: ETH
- name: network
in: query
required: false
schema:
type: string
example: Ethereum
- name: walletId
in: path
required: true
schema:
type: string
example: '0xb3aafc07e4ea2a66866b2d2d1a8e28deee400770'
responses:
200:
description: Response to getting the wallet info.
content:
application/json:
schema:
$ref: '#/components/schemas/GetWalletInfoResponse'
400:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v1/transaction/broadcast:
post:
tags:
- Transaction
summary: Broadcast a Transaction
description: By using this endpoint, you can broadcast a transaction to the network.
operationId: BroadcastTransaction
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BroadcastTransactionRequest'
responses:
204:
description: Response to broadcasting a transaction.
400:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
ErrorResponse:
type: object
properties:
errors:
type: array
items:
type: string
example:
- Something Went Wrong!
CreateHDWalletRequest:
type: object
properties:
symbol:
type: string
example: BTC
network:
type: string
example: Bitcoin
accountIndex:
type: integer
format: int64
default: 0
minimum: 0
example: 0
externalChain:
type: integer
format: int64
default: 0
minimum: 0
example: 0
addressIndex:
type: integer
format: int64
default: 0
minimum: 0
example: 1
required:
- symbol
CreateHDWalletResponse:
type: object
properties:
address:
type: string
example: '0xb315B05d06f74b27D3869219f41119585Fcb8656'
publicKey:
type: string
example: '04a6f1596c27229b369e92feab4345cabc6b057baadf53211650b27aa7f1b760f9d3f0cb892067c4b9a0aaa7464a9797aa805c77fdca73da49899c295f47355990'
privateKey:
type: string
example: '3e421d9c54e97085b18dd39a9c9eee29eb3f9a289088a1b19ebbdc81e696a28a'
GetTransactionInfoResponse:
type: object
properties:
confirmed:
type: boolean
example: true
confirmations:
type: integer
format: int64
example: 26
requireConfirmations:
type: integer
format: int64
example: 10
url:
type: string
example: 'https://blockchair.com/dogecoin/transaction/bbd4a06ba81cd97a8f1e7ab4fd9fea9f324f5d2c83c50de2b19d6f3dc7197c4d'
GetWalletInfoResponse:
type: object
properties:
balance:
type: number
format: double
example: -41.5
transactions:
type: array
items:
type: object
properties:
transactionHash:
type: string
example: '0xd7ce8996bc3b56d3c7e378acbd4529fdaaba87264efc3f128a5d3baa7533ec4d'
timestamp:
type: integer
format: int64
example: 1689163103
balanceChange:
type: number
format: double
example: -41.5
BroadcastTransactionRequest:
type: object
properties:
symbol:
type: string
example: DOGE
network:
type: string
example: Dogecoin
signedTransactionHex:
type: string
example: '01000000024f8459c39f1454a035f5dfb5a3080b961dc07b9ee464d7454251e2efd52dc6d8000000006a47304402207ce248afd39ae4f558a7bb50d2fcb0744b22a71b93fb3476add57231e25449040220028d151e6c5a3d24581570d21917c1eaf82c621fac9bcbb62125e44503d92ed8012103204ac306eda7509174a9d2969d68c76c2cf2af61cd489bbd9b5e15c0bc1f702700000000d3c71144b59780191ca6631f428b9e1d1878c4bfb45eaca18c78751e8252936a010000006a473044022050a659cad3814ce51087ef3b73472b35135fddf7976bdbde427dee36400d08b002203c798194be659535f155a4305bbffc1153cc912b8c523420ff1810d482bf3bb3012103204ac306eda7509174a9d2969d68c76c2cf2af61cd489bbd9b5e15c0bc1f70270000000001045e85cc010000001976a914f223f74dc558724d9ac930dcba9df2ac1266e09588ac00000000'
required:
- symbol
- signedTransactionHex