-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
148 lines (148 loc) · 4.26 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
openapi: 3.0.0
info:
title: Rust Playground API
version: 1.0.0
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: http://localhost:8082
description: Local server
paths:
/addresses:
get:
summary: Get addresses
description: Retrieve a list of addresses
operationId: getAddresses
security:
- ApiKeyAuth: []
responses:
'200':
description: A list of addresses
content:
application/json:
schema:
type: array
items:
type: object
title: Address
required:
- address
- balance
properties:
address:
type: string
example: addr1q9w7j8c9g8c9g7j8w7j8c9g8c9g7j8c9g8c9g8c9g8c9g8c9g8c9g8c9g8c9g8
balance:
type: integer
example: 1000000
'400':
description: Invalid request
post:
summary: Store an address
description: Store a new address in the system
operationId: storeAddress
security:
- ApiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
title: Address
required:
- address
- balance
properties:
address:
type: string
description: The unique identifier for the address
example: addr1q9w7j8c9g8c9g7j8w7j8c9g8c9g7j8c9g8c9g8c9g8c9g8c9g8c9g8c9g8c9g8
balance:
type: integer
description: The balance associated with the address
example: 1000000
responses:
'201':
description: Address stored successfully
content: {}
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Invalid address data
/blocks:
get:
summary: Get blocks
description: Retrieve a list of blocks
operationId: getBlocks
security:
- ApiKeyAuth: []
responses:
'200':
description: A list of blocks
content:
application/json:
schema:
type: array
items:
type: object
title: Block
required:
- block_id
- height
properties:
block_id:
type: string
example: 00000000000000000008c14f2c8fbc000d4d1efb1a1c4f7e13e7d233e4513f9b
height:
type: integer
example: 654321
'400':
description: Invalid request
post:
summary: Store a block
description: Store a new block in the system
operationId: storeBlock
security:
- ApiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
title: Block
required:
- block_id
- height
properties:
block_id:
type: string
description: The unique identifier for the block
example: 00000000000000000008c14f2c8fbc000d4d1efb1a1c4f7e13e7d233e4513f9b
height:
type: integer
description: The height of the block in the blockchain
example: 654321
responses:
'201':
description: Block stored successfully
content: {}
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Invalid block data
components: {}