This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrest_api.yaml
281 lines (281 loc) · 7.94 KB
/
rest_api.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
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
swagger: "2.0"
info:
description: "Ethereum Node API. Interacting with Ethereum network thru a REST API."
version: "0.0.2"
title: "Ethereum Node API"
contact:
email: "[email protected]"
license:
name: "MIT License"
url: "https://raw.githubusercontent.com/improvein/ether-node-api/master/LICENSE"
basePath: "/"
tags:
- name: "node"
description: "Interacting with the Ethereum Node"
- name: "address"
description: "Operations for/with addresses"
- name: "tx"
description: "Operations for/with transactions (Tx)"
- name: "contract"
description: "Operations with Contracts"
schemes:
- "http"
paths:
/node/status:
get:
tags:
- "node"
summary: "Get the current status of the Node"
description: ""
operationId: "getNodeStatus"
produces:
- "application/json"
responses:
200:
description: "Node information"
schema:
type: "object"
properties:
data:
type: object
properties:
connected:
type: boolean
coinbase:
type: string
coinbase_balance:
type: string
500:
description: "An unexpected error ocurred"
schema:
$ref: "#/definitions/APIResponseError"
/node/address/{address}/balance:
get:
tags:
- "address"
summary: "Gets the balance of a specified Address"
description: ""
operationId: "getAddressBalance"
produces:
- "application/json"
parameters:
- name: "address"
in: "path"
description: "Address to check the balance of"
required: true
type: "string"
responses:
200:
description: "Balance of the Address"
schema:
type: "object"
properties:
data:
type: object
properties:
address:
type: string
balance:
type: string
500:
description: "An unexpected error ocurred"
schema:
$ref: "#/definitions/APIResponseError"
/node/tx/{txhash}:
get:
tags:
- "tx"
summary: "Gets information about a specified transaction"
description: ""
operationId: "getTxInfo"
produces:
- "application/json"
parameters:
- name: "txhash"
in: "path"
description: "Tx hash to get information about"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
data:
type: object
properties:
tx:
type: string
500:
description: "An unexpected error ocurred"
schema:
$ref: "#/definitions/APIResponseError"
/node/tx:
post:
tags:
- "tx"
summary: "Creates (sends) a transaction on Ethereum"
description: "Creates (sends) a transaction to send Eth (wei) from an address to another. It could send an arbitrary transaction if only the 'raw' parameter is provided."
operationId: "postNodeTx"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "tx"
description: "Information about the transaction, or the raw transaction in HEX format. Either one. The 'raw' field and the rest are mutually exclusive"
schema:
type: object
properties:
raw:
description: "Tx signed and represented in HEX"
type: "string"
from:
description: "Address to send the Tx from"
type: "string"
private_key:
description: "Private key of the 'from' address"
type: "string"
to:
description: "Destination address"
type: "string"
wei:
description: "Amount (in wei) to transfer"
type: "string"
responses:
200:
description: "Transaction sent"
schema:
type: "object"
properties:
data:
type: object
properties:
tx_hash:
type: string
500:
description: "An unexpected error ocurred"
schema:
$ref: "#/definitions/APIResponseError"
/node/contract/{name}/{address}/call/{method}:
get:
tags:
- "contract"
summary: "Calls a method of a contract (read-only)"
description: ""
operationId: "getContractCallMethod"
produces:
- "application/json"
parameters:
- name: "name"
in: "path"
description: "Name of the Contract"
required: true
type: "string"
- name: "address"
in: "path"
description: "Address of the deployed contract"
required: true
type: "string"
- name: "method"
in: "path"
description: "Method of the contract to call"
required: true
type: "string"
- name: "args"
in: "query"
description: "Optional arguments to pass to the method"
required: false
type: "string"
responses:
200:
description: "Contract method called"
schema:
type: "object"
properties:
data:
type: object
properties:
contract:
type: string
method:
type: string
args:
type: object
result:
type: string
500:
description: "An unexpected error ocurred"
schema:
$ref: "#/definitions/APIResponseError"
/node/contract/{name}/{address}/transact/{method}:
post:
tags:
- "contract"
summary: "Transact with a Contract (broadcasted and impacted in the blockchain)"
description: ""
operationId: "postContractTransactMethod"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "name"
in: "path"
description: "Name of the Contract"
required: true
type: "string"
- name: "address"
in: "path"
description: "Address of the deployed contract"
required: true
type: "string"
- name: "method"
in: "path"
description: "Method of the contract to call"
required: true
type: "string"
- in: "body"
name: "contract_tx"
description: "Transaction for a Contract"
schema:
type: object
properties:
caller_address:
description: "Address of the caller of the method"
type: "string"
private_key:
description: "Private key of the caller of the method"
type: "string"
args:
description: "Arguments to pass to the method"
type: "object"
responses:
200:
description: "Contract transaction call sent"
schema:
type: "object"
properties:
data:
type: object
properties:
contract:
type: string
method:
type: string
args:
type: object
tx_hash:
type: string
500:
description: "An unexpected error ocurred"
schema:
$ref: "#/definitions/APIResponseError"
definitions:
APIResponseError:
type: "object"
properties:
error:
type: "string"