-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode.proto
More file actions
60 lines (53 loc) · 2.01 KB
/
Copy pathnode.proto
File metadata and controls
60 lines (53 loc) · 2.01 KB
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
syntax = "proto3";
package cex_broker;
message ActionRequest {
Action action = 1; // The CCXT method to call (e.g., "fetchBalance", "createOrder")
map<string, string> payload = 2; // Parameters to pass to the CCXT method
string cex = 3; // CEX identifier (e.g., "binance", "bybit")
string symbol = 4; // Optional: trading pair symbol if needed
}
message ActionResponse {
string result = 1; // JSON string of the result data
string proof = 2;
}
message SubscribeRequest {
string cex = 1; // CEX identifier (e.g., "binance", "bybit")
string symbol = 2; // Trading pair symbol (e.g., "BTC/USDT")
SubscriptionType type = 3; // Type of subscription (orderbook, trades, etc.)
map<string, string> options = 4; // Additional subscription options
}
message SubscribeResponse {
string data = 1; // JSON string of the streaming data
int64 timestamp = 2; // Unix timestamp of the data
string symbol = 3; // Trading pair symbol
SubscriptionType type = 4; // Type of subscription
}
enum SubscriptionType {
NO_ACTION=0;
ORDERBOOK = 1; // Order book updates
TRADES = 2; // Recent trades
TICKER = 3; // Ticker information
OHLCV = 4; // OHLCV candlestick data
BALANCE = 5; // Balance updates
ORDERS = 6; // Order updates
}
service cex_service {
rpc ExecuteAction(ActionRequest) returns (ActionResponse);
rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);
}
// Mode enum for price direction
enum Action {
NoAction=0;
Deposit = 1;
Withdraw = 2;
CreateOrder= 3;
GetOrderDetails=4;
CancelOrder=5;
FetchBalances=6;
FetchDepositAddresses=7;
FetchTicker=8;
FetchCurrency=9;
Call=10;
FetchAccountId=11;
FetchFees= 12;
}