-
Notifications
You must be signed in to change notification settings - Fork 3
/
api.proto
455 lines (410 loc) · 15.5 KB
/
api.proto
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
syntax = "proto3";
option go_package = "github.com/MinterTeam/node-grpc-gateway/gen/go;api_pb";
package api_pb;
import "google/protobuf/empty.proto";
import "resources.proto";
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
service ApiService {
// Subscribe
//
// Subscribe returns a subscription for events by query. Only supported in WS and gRPC methods.
rpc Subscribe (SubscribeRequest) returns (stream SubscribeResponse) {
option (google.api.http) = {
get: "/subscribe"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "WebSockets";
}
// Halts
//
// Halts returns the candidate votes for stopping the network at block.
rpc Halts (HaltsRequest) returns (HaltsResponse) {
option (google.api.http) = {
get: "/halts/{height}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Vote";
}
// Genesis
//
// Genesis returns genesis file.
rpc Genesis (google.protobuf.Empty) returns (GenesisResponse) {
option (google.api.http) = {
get: "/genesis"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// MinGasPrice
//
// MinGasPrice returns current min gas price.
rpc MinGasPrice (google.protobuf.Empty) returns (MinGasPriceResponse) {
option (google.api.http) = {
get: "/min_gas_price"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// NetInfo
//
// NetInfo returns network info
rpc NetInfo (google.protobuf.Empty) returns (NetInfoResponse) {
option (google.api.http) = {
get: "/net_info"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// Status
//
// Status returns node status including pubkey, latest block.
rpc Status (google.protobuf.Empty) returns (StatusResponse) {
option (google.api.http) = {
get: "/status"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// Address
//
// Address returns coins list, balance and transaction count of an address.
rpc Address (AddressRequest) returns (AddressResponse) {
option (google.api.http) = {
get: "/address/{address}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Balance";
}
// Addresses
//
// Addresses returns list of addresses.
rpc Addresses (AddressesRequest) returns (AddressesResponse) {
option (google.api.http) = {
get: "/addresses"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Balance";
}
// Block
//
// Block returns block data at given height.
rpc Block (BlockRequest) returns (BlockResponse) {
option (google.api.http) = {
get: "/block/{height}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// Candidate
//
// Candidate returns candidate’s info by provided public key.
//
// {{import "fields.md"}}
rpc Candidate (CandidateRequest) returns (CandidateResponse) {
option (google.api.http) = {
get: "/candidate/{public_key}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Validator";
}
// Candidates
//
// Candidates returns list of candidates.
rpc Candidates (CandidatesRequest) returns (CandidatesResponse) {
option (google.api.http) = {
get: "/candidates"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Validator";
}
// CoinInfoById
//
// CoinInfoById returns information about coin ID.
rpc CoinInfoById (CoinIdRequest) returns (CoinInfoResponse) {
option (google.api.http) = {
get: "/coin_info_by_id/{id}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// CoinInfo
//
// CoinInfo returns information about coin symbol.
rpc CoinInfo (CoinInfoRequest) returns (CoinInfoResponse) {
option (google.api.http) = {
get: "/coin_info/{symbol}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// EstimateCoinBuy
//
// EstimateCoinBuy returns estimate of buy coin transaction.
rpc EstimateCoinBuy (EstimateCoinBuyRequest) returns (EstimateCoinBuyResponse) {
option (google.api.http) = {
get: "/estimate_coin_buy"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// EstimateCoinSell
//
// EstimateCoinSell returns estimate of sell coin transaction.
rpc EstimateCoinSell (EstimateCoinSellRequest) returns (EstimateCoinSellResponse) {
option (google.api.http) = {
get: "/estimate_coin_sell"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// EstimateCoinSellAll
//
// EstimateCoinSellAll returns estimate of sell all coin transaction.
rpc EstimateCoinSellAll (EstimateCoinSellAllRequest) returns (EstimateCoinSellAllResponse) {
option (google.api.http) = {
get: "/estimate_coin_sell_all"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// EstimateTxCommission
//
// EstimateTxCommission returns estimate of transaction.
rpc EstimateTxCommission (EstimateTxCommissionRequest) returns (EstimateTxCommissionResponse) {
option (google.api.http) = {
get: "/estimate_tx_commission/{tx}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// Events
//
// Events returns events at given height.
rpc Events (EventsRequest) returns (EventsResponse) {
option (google.api.http) = {
get: "/events/{height}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Event";
}
// MaxGasPrice
//
// MaxGasPrice returns current max gas.
rpc MaxGasPrice (MaxGasPriceRequest) returns (MaxGasPriceResponse) {
option (google.api.http) = {
get: "/max_gas_price"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// MissedBlocks
//
// MissedBlocks returns missed blocks by validator public key.
rpc MissedBlocks (MissedBlocksRequest) returns (MissedBlocksResponse) {
option (google.api.http) = {
get: "/missed_blocks/{public_key}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Validator";
}
// SendTransaction
//
// SendTransaction returns the result of sending signed tx. To ensure that transaction was successfully committed to the blockchain, you need to find the transaction by the hash and ensure that the status code equals to 0.
//
rpc SendTransaction (SendTransactionRequest) returns (SendTransactionResponse) {
option (google.api.http) = {
get: "/send_transaction/{tx}"
additional_bindings {
post: "/send_transaction"
body: "*"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).external_docs = {
url: "https://www.minter.network/docs#transactions"
description: "More about Minter transactions"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// Transaction
//
// Transaction returns transaction info.
rpc Transaction (TransactionRequest) returns (TransactionResponse) {
option (google.api.http) = {
get: "/transaction/{hash}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// Transactions
//
// Transactions returns transactions by query.
rpc Transactions (TransactionsRequest) returns (TransactionsResponse) {
option (google.api.http) = {
get: "/transactions"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// UnconfirmedTxs
//
// UnconfirmedTxs returns unconfirmed transactions.
rpc UnconfirmedTxs (UnconfirmedTxsRequest) returns (UnconfirmedTxsResponse) {
option (google.api.http) = {
get: "/unconfirmed_txs"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// Validators
//
// Validators returns list of active validators.
rpc Validators (ValidatorsRequest) returns (ValidatorsResponse) {
option (google.api.http) = {
get: "/validators"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Validator";
}
// Frozen
//
// Frozen returns frozen balance.
// Deprecated: Use FrozenAll instead.
rpc Frozen (FrozenRequest) returns (FrozenResponse) {
option (google.api.http) = {
get: "/frozen/{address}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Balance";
}
// FrozenAll
//
// FrozenAll returns frozen balance.
rpc FrozenAll (FrozenAllRequest) returns (FrozenResponse) {
option (google.api.http) = {
get: "/frozen_all"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Balance";
}
// WaitList
//
// WaitList returns the list of address stakes in waitlist.
rpc WaitList (WaitListRequest) returns (WaitListResponse) {
option (google.api.http) = {
get: "/waitlist/{address}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Balance";
}
// WaitLists
//
// WaitLists returns the list addresses and stakes in waitlist.
rpc WaitLists (WaitListsRequest) returns (WaitListsResponse) {
option (google.api.http) = {
get: "/waitlists"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Balance";
}
// TestBlock
//
// TestBlock returns the list of example transactions in block. Available only testnet mode.
rpc TestBlock (google.protobuf.Empty) returns (BlockResponse) {
option (google.api.http) = {
get: "/test/block"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Test";
}
// SwapPool
//
// SwapPool returns total supply and reserves.
rpc SwapPool (SwapPoolRequest) returns (SwapPoolResponse) {
option (google.api.http) = {
get: "/swap_pool/{coin0}/{coin1}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// SwapPools
//
// SwapPools returns list of all pools.
rpc SwapPools (SwapPoolsRequest) returns (SwapPoolsResponse) {
// option (google.api.method_visibility).restriction = "INTERNAL";
option (google.api.http) = {
get: "/swap_pools"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// SwapPoolProvider
//
// SwapPoolProvider returns reserves and liquidity balance of provider.
rpc SwapPoolProvider (SwapPoolProviderRequest) returns (SwapPoolResponse) {
option (google.api.http) = {
get: "/swap_pool/{coin0}/{coin1}/{provider}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// PriceCommission
//
// PriceCommission returns commissions.
rpc PriceCommission (PriceCommissionRequest) returns (PriceCommissionResponse) {
option (google.api.http) = {
get: "/price_commissions"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
// VersionNetwork
//
// VersionNetwork returns versions network.
rpc VersionNetwork (VersionNetworkRequest) returns (VersionNetworkResponse) {
option (google.api.http) = {
get: "/version_network"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// CommissionVotes
//
// CommissionVotes returns votes for update commissions.
rpc CommissionVotes (CommissionVotesRequest) returns (CommissionVotesResponse) {
option (google.api.http) = {
get: "/commission_votes/{target_version}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Vote";
}
// UpdateVotes
//
// UpdateVotes returns votes for update network.
rpc UpdateVotes (UpdateVotesRequest) returns (UpdateVotesResponse) {
option (google.api.http) = {
get: "/update_votes/{target_version}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Vote";
}
// Blocks
//
// Blocks returns blocks at given interval.
rpc Blocks (BlocksRequest) returns (BlocksResponse) {
option (google.api.http) = {
get: "/blocks"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Blockchain";
}
// LimitOrder
//
// LimitOrder returns order by ID.
rpc LimitOrder (LimitOrderRequest) returns (LimitOrderResponse) {
option (google.api.http) = {
get: "/limit_order/{order_id}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// LimitOrdersOfPool
//
// LimitOrdersOfPool returns sell orders for a pair of coins.
rpc LimitOrdersOfPool (LimitOrdersOfPoolRequest) returns (LimitOrdersOfPoolResponse) {
option (google.api.http) = {
get: "/limit_orders/{sell_coin}/{buy_coin}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// LimitOrders
//
// LimitOrders returns orders by IDs.
rpc LimitOrders (LimitOrdersRequest) returns (LimitOrdersResponse) {
option (google.api.http) = {
get: "/limit_orders"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// LimitOrdersByOwner
//
// LimitOrdersByOwner returns orders by owner.
rpc LimitOrdersByOwner (LimitOrdersByOwnerRequest) returns (LimitOrdersResponse) {
option (google.api.http) = {
get: "/limit_orders_by_owner/{address}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Coin";
}
// BestTrade
//
// BestTrade returns optimal exchange route.
rpc BestTrade (BestTradeRequest) returns (BestTradeResponse) {
// option (google.api.method_visibility).restriction = "INTERNAL";
option (google.api.http) = {
get: "/best_trade/{sell_coin}/{buy_coin}/{type}/{amount}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation).tags = "Price";
}
}