@usherlabs/cex-broker 0.1.16 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -13
- package/dist/commands/cli.js +14946 -12659
- package/dist/index.js +18860 -38145
- package/dist/index.js.map +63 -155
- package/dist/proto/node.descriptor.ts +125 -0
- package/dist/proto/node.proto +9 -7
- package/package.json +5 -3
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Auto-generated from src/proto/node.proto. Do not edit manually.
|
|
2
|
+
const descriptor = {
|
|
3
|
+
"nested": {
|
|
4
|
+
"cex_broker": {
|
|
5
|
+
"nested": {
|
|
6
|
+
"ActionRequest": {
|
|
7
|
+
"fields": {
|
|
8
|
+
"action": {
|
|
9
|
+
"type": "Action",
|
|
10
|
+
"id": 1
|
|
11
|
+
},
|
|
12
|
+
"payload": {
|
|
13
|
+
"keyType": "string",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"id": 2
|
|
16
|
+
},
|
|
17
|
+
"cex": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"id": 3
|
|
20
|
+
},
|
|
21
|
+
"symbol": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"id": 4
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"ActionResponse": {
|
|
28
|
+
"fields": {
|
|
29
|
+
"result": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"id": 1
|
|
32
|
+
},
|
|
33
|
+
"proof": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"id": 2
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"SubscribeRequest": {
|
|
40
|
+
"fields": {
|
|
41
|
+
"cex": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"id": 1
|
|
44
|
+
},
|
|
45
|
+
"symbol": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"id": 2
|
|
48
|
+
},
|
|
49
|
+
"type": {
|
|
50
|
+
"type": "SubscriptionType",
|
|
51
|
+
"id": 3
|
|
52
|
+
},
|
|
53
|
+
"options": {
|
|
54
|
+
"keyType": "string",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"id": 4
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"SubscribeResponse": {
|
|
61
|
+
"fields": {
|
|
62
|
+
"data": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"id": 1
|
|
65
|
+
},
|
|
66
|
+
"timestamp": {
|
|
67
|
+
"type": "int64",
|
|
68
|
+
"id": 2
|
|
69
|
+
},
|
|
70
|
+
"symbol": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"id": 3
|
|
73
|
+
},
|
|
74
|
+
"type": {
|
|
75
|
+
"type": "SubscriptionType",
|
|
76
|
+
"id": 4
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"SubscriptionType": {
|
|
81
|
+
"values": {
|
|
82
|
+
"NO_ACTION": 0,
|
|
83
|
+
"ORDERBOOK": 1,
|
|
84
|
+
"TRADES": 2,
|
|
85
|
+
"TICKER": 3,
|
|
86
|
+
"OHLCV": 4,
|
|
87
|
+
"BALANCE": 5,
|
|
88
|
+
"ORDERS": 6
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"cex_service": {
|
|
92
|
+
"methods": {
|
|
93
|
+
"ExecuteAction": {
|
|
94
|
+
"requestType": "ActionRequest",
|
|
95
|
+
"responseType": "ActionResponse"
|
|
96
|
+
},
|
|
97
|
+
"Subscribe": {
|
|
98
|
+
"requestType": "SubscribeRequest",
|
|
99
|
+
"responseType": "SubscribeResponse",
|
|
100
|
+
"responseStream": true
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"Action": {
|
|
105
|
+
"values": {
|
|
106
|
+
"NoAction": 0,
|
|
107
|
+
"Deposit": 1,
|
|
108
|
+
"Withdraw": 2,
|
|
109
|
+
"CreateOrder": 3,
|
|
110
|
+
"GetOrderDetails": 4,
|
|
111
|
+
"CancelOrder": 5,
|
|
112
|
+
"FetchBalances": 6,
|
|
113
|
+
"FetchDepositAddresses": 7,
|
|
114
|
+
"FetchTicker": 8,
|
|
115
|
+
"FetchCurrency": 9,
|
|
116
|
+
"Call": 10,
|
|
117
|
+
"FetchAccountId": 11
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
} as const;
|
|
124
|
+
|
|
125
|
+
export default descriptor;
|
package/dist/proto/node.proto
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
|
-
package cex_broker;
|
|
2
|
+
package cex_broker;
|
|
3
3
|
|
|
4
4
|
message ActionRequest {
|
|
5
5
|
Action action = 1; // The CCXT method to call (e.g., "fetchBalance", "createOrder")
|
|
@@ -10,7 +10,7 @@ message ActionRequest {
|
|
|
10
10
|
|
|
11
11
|
message ActionResponse {
|
|
12
12
|
string result = 1; // JSON string of the result data
|
|
13
|
-
string proof = 2;
|
|
13
|
+
string proof = 2;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
message SubscribeRequest {
|
|
@@ -46,12 +46,14 @@ service cex_service {
|
|
|
46
46
|
enum Action {
|
|
47
47
|
NoAction=0;
|
|
48
48
|
Deposit = 1;
|
|
49
|
-
|
|
49
|
+
Withdraw = 2;
|
|
50
50
|
CreateOrder= 3;
|
|
51
51
|
GetOrderDetails=4;
|
|
52
52
|
CancelOrder=5;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
FetchBalances=6;
|
|
54
|
+
FetchDepositAddresses=7;
|
|
55
|
+
FetchTicker=8;
|
|
56
|
+
FetchCurrency=9;
|
|
57
|
+
Call=10;
|
|
58
|
+
FetchAccountId=11;
|
|
57
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usherlabs/cex-broker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Unified gRPC API to CEXs by Usher Labs.",
|
|
5
5
|
"repository": "git@gitlab.com:usherlabs/cex-broker.git",
|
|
6
6
|
"homepage": "https://usher.so/",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"proto-gen": "./proto-gen.sh",
|
|
30
30
|
"start": "bun run ./src/index.ts",
|
|
31
|
-
"build": "bun run ./build.ts && bun run build:ts && bun run copy:dts && bun run copy:proto",
|
|
31
|
+
"build": "bun run proto-gen && bun run ./build.ts && bun run build:ts && bun run copy:dts && bun run copy:proto",
|
|
32
32
|
"start-broker": "bun run ./src/cli.ts",
|
|
33
33
|
"start-broker-server": "bunx nodemon --watch src --watch policy --ext ts,js,json --exec 'bun run start-broker --policy policy/policy.json --port 8086 --whitelistAll'",
|
|
34
34
|
"start-broker-server-with-verity": "bunx nodemon --watch src --watch policy --ext ts,js,json --exec 'bun run start-broker --policy policy/policy.json --port 8086 --whitelistAll --verityProverUrl http://localhost:8080'",
|
|
@@ -50,9 +50,11 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@grpc/grpc-js": "^1.13.4",
|
|
52
52
|
"@grpc/proto-loader": "^0.7.15",
|
|
53
|
-
"@usherlabs/ccxt": "^0.0.
|
|
53
|
+
"@usherlabs/ccxt": "^0.0.13",
|
|
54
|
+
"@usherlabs/verity-client": "^0.1.1",
|
|
54
55
|
"commander": "^14.0.0",
|
|
55
56
|
"joi": "^17.13.3",
|
|
57
|
+
"protobufjs": "^7.4.0",
|
|
56
58
|
"tslog": "^4.9.3"
|
|
57
59
|
},
|
|
58
60
|
"publishConfig": {
|