gateio-api 1.2.2 → 1.2.4
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 +6 -0
- package/dist/cjs/RestClient.js +55 -55
- package/dist/cjs/RestClient.js.map +1 -1
- package/dist/cjs/WebsocketClient.js +11 -9
- package/dist/cjs/WebsocketClient.js.map +1 -1
- package/dist/cjs/lib/BaseRestClient.js.map +1 -1
- package/dist/cjs/lib/BaseWSClient.d.ts +0 -1
- package/dist/cjs/lib/BaseWSClient.js +10 -8
- package/dist/cjs/lib/BaseWSClient.js.map +1 -1
- package/dist/cjs/lib/misc-util.js +1 -2
- package/dist/cjs/lib/misc-util.js.map +1 -1
- package/dist/cjs/lib/requestUtils.js +4 -4
- package/dist/cjs/lib/requestUtils.js.map +1 -1
- package/dist/cjs/lib/webCryptoAPI.js +2 -3
- package/dist/cjs/lib/webCryptoAPI.js.map +1 -1
- package/dist/cjs/lib/websocket/WsStore.js +2 -2
- package/dist/cjs/lib/websocket/WsStore.js.map +1 -1
- package/dist/cjs/lib/websocket/WsStore.types.d.ts +0 -1
- package/dist/cjs/lib/websocket/websocket-util.js +7 -7
- package/dist/cjs/lib/websocket/websocket-util.js.map +1 -1
- package/dist/cjs/types/response/spot.d.ts +7 -7
- package/dist/cjs/types/response/spot.js +0 -4
- package/dist/cjs/types/response/spot.js.map +1 -1
- package/dist/cjs/types/websockets/wsAPI.d.ts +87 -87
- package/dist/cjs/types/websockets/wsAPI.js +5 -0
- package/dist/cjs/types/websockets/wsAPI.js.map +1 -1
- package/dist/mjs/RestClient.js +55 -55
- package/dist/mjs/RestClient.js.map +1 -1
- package/dist/mjs/WebsocketClient.js +11 -9
- package/dist/mjs/WebsocketClient.js.map +1 -1
- package/dist/mjs/lib/BaseRestClient.js.map +1 -1
- package/dist/mjs/lib/BaseWSClient.d.ts +0 -1
- package/dist/mjs/lib/BaseWSClient.js +10 -8
- package/dist/mjs/lib/BaseWSClient.js.map +1 -1
- package/dist/mjs/lib/websocket/WsStore.types.d.ts +0 -1
- package/dist/mjs/types/response/spot.d.ts +7 -7
- package/dist/mjs/types/response/spot.js +0 -4
- package/dist/mjs/types/response/spot.js.map +1 -1
- package/dist/mjs/types/websockets/wsAPI.d.ts +87 -87
- package/dist/mjs/types/websockets/wsAPI.js +5 -0
- package/dist/mjs/types/websockets/wsAPI.js.map +1 -1
- package/llms.txt +11511 -0
- package/package.json +8 -7
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
* SPOT
|
|
3
3
|
* ==========================================================================================================================
|
|
4
4
|
*/
|
|
5
|
+
export interface SpotCurrencyChain {
|
|
6
|
+
name: string;
|
|
7
|
+
addr?: string;
|
|
8
|
+
withdraw_disabled: boolean;
|
|
9
|
+
withdraw_delayed: boolean;
|
|
10
|
+
deposit_disabled: boolean;
|
|
11
|
+
}
|
|
5
12
|
export interface SpotCurrency {
|
|
6
13
|
currency: string;
|
|
7
14
|
name: string;
|
|
@@ -13,13 +20,6 @@ export interface SpotCurrency {
|
|
|
13
20
|
chain: string;
|
|
14
21
|
chains: SpotCurrencyChain[];
|
|
15
22
|
}
|
|
16
|
-
export interface SpotCurrencyChain {
|
|
17
|
-
name: string;
|
|
18
|
-
addr?: string;
|
|
19
|
-
withdraw_disabled: boolean;
|
|
20
|
-
withdraw_delayed: boolean;
|
|
21
|
-
deposit_disabled: boolean;
|
|
22
|
-
}
|
|
23
23
|
export interface SpotTicker {
|
|
24
24
|
currency_pair: string;
|
|
25
25
|
last: string;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
/**==========================================================================================================================
|
|
2
|
-
* SPOT
|
|
3
|
-
* ==========================================================================================================================
|
|
4
|
-
*/
|
|
5
1
|
export {};
|
|
6
2
|
//# sourceMappingURL=spot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spot.js","sourceRoot":"","sources":["../../../../src/types/response/spot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spot.js","sourceRoot":"","sources":["../../../../src/types/response/spot.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { WsKey } from '../../lib/websocket/websocket-util.js';
|
|
2
2
|
export type SpotWSAPITopic = 'spot.login' | 'spot.order_place' | 'spot.order_cancel' | 'spot.order_cancel_ids' | 'spot.order_cancel_cp' | 'spot.order_amend' | 'spot.order_status' | 'spot.order_list';
|
|
3
3
|
export type FuturesWSAPITopic = 'futures.login' | 'futures.order_place' | 'futures.order_batch_place' | 'futures.order_cancel' | 'futures.order_cancel_cp' | 'futures.order_amend' | 'futures.order_list' | 'futures.order_status' | 'futures.order_cancel_ids';
|
|
4
|
-
export type WSAPITopic = SpotWSAPITopic | FuturesWSAPITopic;
|
|
5
|
-
export type WSAPIWsKey = keyof WsAPIWsKeyTopicMap;
|
|
6
4
|
export interface WsAPIWsKeyTopicMap {
|
|
7
5
|
spotV4: SpotWSAPITopic;
|
|
8
6
|
perpFuturesUSDTV4: FuturesWSAPITopic;
|
|
@@ -10,91 +8,8 @@ export interface WsAPIWsKeyTopicMap {
|
|
|
10
8
|
deliveryFuturesUSDTV4: FuturesWSAPITopic;
|
|
11
9
|
deliveryFuturesBTCV4: FuturesWSAPITopic;
|
|
12
10
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
'futures.login': undefined;
|
|
16
|
-
'spot.order_place': WSAPISpotOrderPlaceReq;
|
|
17
|
-
'spot.order_cancel': WSAPISpotOrderCancelReq;
|
|
18
|
-
'spot.order_cancel_ids': WSAPISpotOrderCancelIdsReq[];
|
|
19
|
-
'spot.order_cancel_cp': WSAPISpotOrderCancelCPReq;
|
|
20
|
-
'spot.order_amend': WSAPISpotOrderAmendReq;
|
|
21
|
-
'spot.order_status': WSAPISpotOrderStatusReq;
|
|
22
|
-
'spot.order_list': WSAPISpotOrderListReq;
|
|
23
|
-
'futures.order_place': WSAPIFuturesOrderPlaceReq;
|
|
24
|
-
'futures.order_batch_place': WSAPIFuturesOrderPlaceReq[];
|
|
25
|
-
'futures.order_cancel': WSAPIFuturesOrderCancelReq;
|
|
26
|
-
'futures.order_cancel_ids': string[];
|
|
27
|
-
'futures.order_cancel_cp': WSAPIFuturesOrderCancelCPReq;
|
|
28
|
-
'futures.order_amend': WSAPIFuturesOrderAmendReq;
|
|
29
|
-
'futures.order_list': WSAPIFuturesOrderListReq;
|
|
30
|
-
'futures.order_status': WSAPIFuturesOrderStatusReq;
|
|
31
|
-
}
|
|
32
|
-
export type WsAPITopicRequestParams = WsAPITopicRequestParamMap[keyof WsAPITopicRequestParamMap];
|
|
33
|
-
export interface WSAPIResponseHeader<TChannel extends WSAPITopic> {
|
|
34
|
-
/** String timestamp as ms */
|
|
35
|
-
response_time: string;
|
|
36
|
-
/** Status of WS API call. "200" if successful, else exception is thrown */
|
|
37
|
-
status: '200' | string;
|
|
38
|
-
channel: TChannel;
|
|
39
|
-
event: 'api';
|
|
40
|
-
client_id: string;
|
|
41
|
-
}
|
|
42
|
-
export interface WSAPILoginResponse {
|
|
43
|
-
api_key: string;
|
|
44
|
-
uid: string;
|
|
45
|
-
}
|
|
46
|
-
export interface WSAPIOrderStatusResponse {
|
|
47
|
-
left: string;
|
|
48
|
-
update_time: string;
|
|
49
|
-
amount: string;
|
|
50
|
-
create_time: string;
|
|
51
|
-
price: string;
|
|
52
|
-
finish_as: string;
|
|
53
|
-
time_in_force: string;
|
|
54
|
-
currency_pair: string;
|
|
55
|
-
type: string;
|
|
56
|
-
account: string;
|
|
57
|
-
side: string;
|
|
58
|
-
amend_text: string;
|
|
59
|
-
text: string;
|
|
60
|
-
status: string;
|
|
61
|
-
iceberg: string;
|
|
62
|
-
avg_deal_price: string;
|
|
63
|
-
filled_total: string;
|
|
64
|
-
id: string;
|
|
65
|
-
fill_price: string;
|
|
66
|
-
update_time_ms: number;
|
|
67
|
-
create_time_ms: number;
|
|
68
|
-
}
|
|
69
|
-
export type WSAPIResponseData = WSAPILoginResponse | WSAPIOrderStatusResponse;
|
|
70
|
-
export interface WsAPITopicResponseMap {
|
|
71
|
-
'spot.login': WSAPIResponse<WSAPILoginResponse, 'spot.login'>;
|
|
72
|
-
'futures.login': WSAPIResponse<WSAPILoginResponse, 'futures.login'>;
|
|
73
|
-
'spot.order_place': WSAPIResponse<WSAPISpotOrder, 'spot.order_place'>;
|
|
74
|
-
'spot.order_cancel': WSAPIResponse<WSAPISpotOrder, 'spot.order_cancel'>;
|
|
75
|
-
'spot.order_cancel_ids': WSAPIResponse<WSAPISpotOrderCancelIdsRespItem[], 'spot.order_cancel_ids'>;
|
|
76
|
-
'spot.order_cancel_cp': WSAPIResponse<WSAPISpotOrder[], 'spot.order_cancel_cp'>;
|
|
77
|
-
'spot.order_amend': WSAPIResponse<WSAPISpotOrder, 'spot.order_amend'>;
|
|
78
|
-
'spot.order_status': WSAPIResponse<WSAPISpotOrder, 'spot.order_status'>;
|
|
79
|
-
'spot.order_list': WSAPIResponse<WSAPISpotOrder[], 'spot.order_list'>;
|
|
80
|
-
'futures.order_place': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_place'>;
|
|
81
|
-
'futures.order_batch_place': WSAPIResponse<WSAPIFuturesOrderBatchPlaceRespItem[], 'futures.order_batch_place'>;
|
|
82
|
-
'futures.order_cancel': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_cancel'>;
|
|
83
|
-
'futures.order_cancel_ids': WSAPIResponse<WSAPIFuturesOrderCancelIdsRespItem[], 'futures.order_cancel_ids'>;
|
|
84
|
-
'futures.order_cancel_cp': WSAPIResponse<WSAPIFuturesOrder[], 'futures.order_cancel_cp'>;
|
|
85
|
-
'futures.order_amend': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_amend'>;
|
|
86
|
-
'futures.order_list': WSAPIResponse<WSAPIFuturesOrder[], 'futures.order_list'>;
|
|
87
|
-
'futures.order_status': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_status'>;
|
|
88
|
-
}
|
|
89
|
-
export interface WSAPIResponse<TResponseData extends object = WSAPIResponseData | object, TChannel extends WSAPITopic = WSAPITopic> {
|
|
90
|
-
wsKey: WsKey;
|
|
91
|
-
header: WSAPIResponseHeader<TChannel>;
|
|
92
|
-
data: {
|
|
93
|
-
result: TResponseData;
|
|
94
|
-
};
|
|
95
|
-
/** Auto-generated */
|
|
96
|
-
request_id: string;
|
|
97
|
-
}
|
|
11
|
+
export type WSAPITopic = SpotWSAPITopic | FuturesWSAPITopic;
|
|
12
|
+
export type WSAPIWsKey = keyof WsAPIWsKeyTopicMap;
|
|
98
13
|
export interface WSAPISpotOrderPlaceReq {
|
|
99
14
|
text?: string;
|
|
100
15
|
currency_pair: string;
|
|
@@ -254,3 +169,88 @@ export interface WSAPIFuturesOrderCancelIdsRespItem {
|
|
|
254
169
|
succeeded?: boolean;
|
|
255
170
|
message?: string;
|
|
256
171
|
}
|
|
172
|
+
export interface WsAPITopicRequestParamMap {
|
|
173
|
+
'spot.login': undefined;
|
|
174
|
+
'futures.login': undefined;
|
|
175
|
+
'spot.order_place': WSAPISpotOrderPlaceReq;
|
|
176
|
+
'spot.order_cancel': WSAPISpotOrderCancelReq;
|
|
177
|
+
'spot.order_cancel_ids': WSAPISpotOrderCancelIdsReq[];
|
|
178
|
+
'spot.order_cancel_cp': WSAPISpotOrderCancelCPReq;
|
|
179
|
+
'spot.order_amend': WSAPISpotOrderAmendReq;
|
|
180
|
+
'spot.order_status': WSAPISpotOrderStatusReq;
|
|
181
|
+
'spot.order_list': WSAPISpotOrderListReq;
|
|
182
|
+
'futures.order_place': WSAPIFuturesOrderPlaceReq;
|
|
183
|
+
'futures.order_batch_place': WSAPIFuturesOrderPlaceReq[];
|
|
184
|
+
'futures.order_cancel': WSAPIFuturesOrderCancelReq;
|
|
185
|
+
'futures.order_cancel_ids': string[];
|
|
186
|
+
'futures.order_cancel_cp': WSAPIFuturesOrderCancelCPReq;
|
|
187
|
+
'futures.order_amend': WSAPIFuturesOrderAmendReq;
|
|
188
|
+
'futures.order_list': WSAPIFuturesOrderListReq;
|
|
189
|
+
'futures.order_status': WSAPIFuturesOrderStatusReq;
|
|
190
|
+
}
|
|
191
|
+
export type WsAPITopicRequestParams = WsAPITopicRequestParamMap[keyof WsAPITopicRequestParamMap];
|
|
192
|
+
export interface WSAPIResponseHeader<TChannel extends WSAPITopic> {
|
|
193
|
+
/** String timestamp as ms */
|
|
194
|
+
response_time: string;
|
|
195
|
+
/** Status of WS API call. "200" if successful, else exception is thrown */
|
|
196
|
+
status: '200' | string;
|
|
197
|
+
channel: TChannel;
|
|
198
|
+
event: 'api';
|
|
199
|
+
client_id: string;
|
|
200
|
+
}
|
|
201
|
+
export interface WSAPILoginResponse {
|
|
202
|
+
api_key: string;
|
|
203
|
+
uid: string;
|
|
204
|
+
}
|
|
205
|
+
export interface WSAPIOrderStatusResponse {
|
|
206
|
+
left: string;
|
|
207
|
+
update_time: string;
|
|
208
|
+
amount: string;
|
|
209
|
+
create_time: string;
|
|
210
|
+
price: string;
|
|
211
|
+
finish_as: string;
|
|
212
|
+
time_in_force: string;
|
|
213
|
+
currency_pair: string;
|
|
214
|
+
type: string;
|
|
215
|
+
account: string;
|
|
216
|
+
side: string;
|
|
217
|
+
amend_text: string;
|
|
218
|
+
text: string;
|
|
219
|
+
status: string;
|
|
220
|
+
iceberg: string;
|
|
221
|
+
avg_deal_price: string;
|
|
222
|
+
filled_total: string;
|
|
223
|
+
id: string;
|
|
224
|
+
fill_price: string;
|
|
225
|
+
update_time_ms: number;
|
|
226
|
+
create_time_ms: number;
|
|
227
|
+
}
|
|
228
|
+
export type WSAPIResponseData = WSAPILoginResponse | WSAPIOrderStatusResponse;
|
|
229
|
+
export interface WSAPIResponse<TResponseData extends object = WSAPIResponseData | object, TChannel extends WSAPITopic = WSAPITopic> {
|
|
230
|
+
wsKey: WsKey;
|
|
231
|
+
header: WSAPIResponseHeader<TChannel>;
|
|
232
|
+
data: {
|
|
233
|
+
result: TResponseData;
|
|
234
|
+
};
|
|
235
|
+
/** Auto-generated */
|
|
236
|
+
request_id: string;
|
|
237
|
+
}
|
|
238
|
+
export interface WsAPITopicResponseMap {
|
|
239
|
+
'spot.login': WSAPIResponse<WSAPILoginResponse, 'spot.login'>;
|
|
240
|
+
'futures.login': WSAPIResponse<WSAPILoginResponse, 'futures.login'>;
|
|
241
|
+
'spot.order_place': WSAPIResponse<WSAPISpotOrder, 'spot.order_place'>;
|
|
242
|
+
'spot.order_cancel': WSAPIResponse<WSAPISpotOrder, 'spot.order_cancel'>;
|
|
243
|
+
'spot.order_cancel_ids': WSAPIResponse<WSAPISpotOrderCancelIdsRespItem[], 'spot.order_cancel_ids'>;
|
|
244
|
+
'spot.order_cancel_cp': WSAPIResponse<WSAPISpotOrder[], 'spot.order_cancel_cp'>;
|
|
245
|
+
'spot.order_amend': WSAPIResponse<WSAPISpotOrder, 'spot.order_amend'>;
|
|
246
|
+
'spot.order_status': WSAPIResponse<WSAPISpotOrder, 'spot.order_status'>;
|
|
247
|
+
'spot.order_list': WSAPIResponse<WSAPISpotOrder[], 'spot.order_list'>;
|
|
248
|
+
'futures.order_place': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_place'>;
|
|
249
|
+
'futures.order_batch_place': WSAPIResponse<WSAPIFuturesOrderBatchPlaceRespItem[], 'futures.order_batch_place'>;
|
|
250
|
+
'futures.order_cancel': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_cancel'>;
|
|
251
|
+
'futures.order_cancel_ids': WSAPIResponse<WSAPIFuturesOrderCancelIdsRespItem[], 'futures.order_cancel_ids'>;
|
|
252
|
+
'futures.order_cancel_cp': WSAPIResponse<WSAPIFuturesOrder[], 'futures.order_cancel_cp'>;
|
|
253
|
+
'futures.order_amend': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_amend'>;
|
|
254
|
+
'futures.order_list': WSAPIResponse<WSAPIFuturesOrder[], 'futures.order_list'>;
|
|
255
|
+
'futures.order_status': WSAPIResponse<WSAPIFuturesOrder, 'futures.order_status'>;
|
|
256
|
+
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export {};
|
|
2
|
+
// export interface WsAPIResponseMap<TChannel extends WSAPITopic = WSAPITopic> {
|
|
3
|
+
// 'spot.login': WSAPIResponse<WSAPILoginResponse, TChannel>;
|
|
4
|
+
// 'futures.login': WSAPIResponse<WSAPILoginResponse, TChannel>;
|
|
5
|
+
// string: object;
|
|
6
|
+
// }
|
|
2
7
|
//# sourceMappingURL=wsAPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsAPI.js","sourceRoot":"","sources":["../../../../src/types/websockets/wsAPI.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"wsAPI.js","sourceRoot":"","sources":["../../../../src/types/websockets/wsAPI.ts"],"names":[],"mappings":";AAoXA,gFAAgF;AAChF,+DAA+D;AAC/D,kEAAkE;AAClE,oBAAoB;AACpB,IAAI"}
|