gateio-api 1.4.2 → 1.5.0

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.
Files changed (51) hide show
  1. package/README.md +3 -2
  2. package/dist/cjs/RestClient.d.ts +184 -117
  3. package/dist/cjs/RestClient.js +287 -105
  4. package/dist/cjs/RestClient.js.map +1 -1
  5. package/dist/cjs/index.d.ts +4 -0
  6. package/dist/cjs/index.js +4 -0
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/types/request/earn.d.ts +10 -0
  9. package/dist/cjs/types/request/futures.d.ts +65 -0
  10. package/dist/cjs/types/request/p2pMerchant.d.ts +108 -0
  11. package/dist/cjs/types/request/p2pMerchant.js +4 -0
  12. package/dist/cjs/types/request/p2pMerchant.js.map +1 -0
  13. package/dist/cjs/types/request/tradfi.d.ts +56 -0
  14. package/dist/cjs/types/request/tradfi.js +4 -0
  15. package/dist/cjs/types/request/tradfi.js.map +1 -0
  16. package/dist/cjs/types/response/earn.d.ts +1 -0
  17. package/dist/cjs/types/response/futures.d.ts +80 -7
  18. package/dist/cjs/types/response/multicollateralLoan.d.ts +4 -0
  19. package/dist/cjs/types/response/p2pMerchant.d.ts +178 -0
  20. package/dist/cjs/types/response/p2pMerchant.js +4 -0
  21. package/dist/cjs/types/response/p2pMerchant.js.map +1 -0
  22. package/dist/cjs/types/response/spot.d.ts +1 -1
  23. package/dist/cjs/types/response/tradfi.d.ts +200 -0
  24. package/dist/cjs/types/response/tradfi.js +4 -0
  25. package/dist/cjs/types/response/tradfi.js.map +1 -0
  26. package/dist/mjs/RestClient.d.ts +184 -117
  27. package/dist/mjs/RestClient.js +287 -105
  28. package/dist/mjs/RestClient.js.map +1 -1
  29. package/dist/mjs/index.d.ts +4 -0
  30. package/dist/mjs/index.js +4 -0
  31. package/dist/mjs/index.js.map +1 -1
  32. package/dist/mjs/types/request/earn.d.ts +10 -0
  33. package/dist/mjs/types/request/futures.d.ts +65 -0
  34. package/dist/mjs/types/request/p2pMerchant.d.ts +108 -0
  35. package/dist/mjs/types/request/p2pMerchant.js +3 -0
  36. package/dist/mjs/types/request/p2pMerchant.js.map +1 -0
  37. package/dist/mjs/types/request/tradfi.d.ts +56 -0
  38. package/dist/mjs/types/request/tradfi.js +3 -0
  39. package/dist/mjs/types/request/tradfi.js.map +1 -0
  40. package/dist/mjs/types/response/earn.d.ts +1 -0
  41. package/dist/mjs/types/response/futures.d.ts +80 -7
  42. package/dist/mjs/types/response/multicollateralLoan.d.ts +4 -0
  43. package/dist/mjs/types/response/p2pMerchant.d.ts +178 -0
  44. package/dist/mjs/types/response/p2pMerchant.js +3 -0
  45. package/dist/mjs/types/response/p2pMerchant.js.map +1 -0
  46. package/dist/mjs/types/response/spot.d.ts +1 -1
  47. package/dist/mjs/types/response/tradfi.d.ts +200 -0
  48. package/dist/mjs/types/response/tradfi.js +3 -0
  49. package/dist/mjs/types/response/tradfi.js.map +1 -0
  50. package/llms.txt +13011 -11849
  51. package/package.json +1 -1
@@ -65,6 +65,13 @@ export interface FuturesTicker {
65
65
  lowest_size: string;
66
66
  highest_size: string;
67
67
  }
68
+ export interface BatchFundingRatesResponse {
69
+ contract?: string;
70
+ data?: {
71
+ t: number;
72
+ r: string;
73
+ }[];
74
+ }
68
75
  export interface FuturesStats {
69
76
  time: number;
70
77
  lsr_taker: number;
@@ -300,29 +307,43 @@ export interface FuturesContract {
300
307
  taker_fee_rate?: string;
301
308
  order_price_round?: string;
302
309
  mark_price_round?: string;
310
+ order_price_deviate?: string;
311
+ ref_discount_rate?: string;
312
+ ref_rebate_rate?: string;
303
313
  funding_rate?: string;
314
+ funding_rate_indicative?: string;
304
315
  funding_interval?: number;
305
316
  funding_next_apply?: number;
317
+ funding_offset?: number;
318
+ interest_rate?: string;
306
319
  risk_limit_base?: string;
307
320
  risk_limit_step?: string;
308
321
  risk_limit_max?: string;
309
- order_size_min?: number;
310
- order_size_max?: number;
311
- order_price_deviate?: string;
312
- ref_discount_rate?: string;
313
- ref_rebate_rate?: string;
322
+ order_size_min?: string | number;
323
+ order_size_max?: string | number;
314
324
  orderbook_id?: number;
315
325
  trade_id?: number;
316
- trade_size?: number;
317
- position_size?: number;
326
+ trade_size?: string | number;
327
+ position_size?: string | number;
328
+ short_users?: number;
329
+ long_users?: number;
330
+ funding_impact_value?: string;
318
331
  config_change_time?: number;
319
332
  in_delisting?: boolean;
320
333
  orders_limit?: number;
321
334
  enable_bonus?: boolean;
322
335
  enable_credit?: boolean;
336
+ /** When true, contract supports decimal contract size (size field can use decimal string). When false, size only supports integer type. */
337
+ enable_decimal?: boolean;
323
338
  create_time?: number;
339
+ launch_time?: number;
340
+ delisting_time?: number;
341
+ delisted_time?: number;
342
+ status?: string;
324
343
  funding_cap_ratio?: string;
325
344
  funding_rate_limit?: string;
345
+ market_order_slip_ratio?: string;
346
+ market_order_size_max?: string;
326
347
  }
327
348
  export interface FuturesPriceTriggeredOrder {
328
349
  initial: {
@@ -464,3 +485,55 @@ export interface FuturesInsuranceHistory {
464
485
  t: number;
465
486
  b: string;
466
487
  }
488
+ /** Trail order (autoorder/v1/trail) response types */
489
+ export interface TrailOrder {
490
+ id?: number | string;
491
+ user_id?: number | string;
492
+ user?: number | string;
493
+ contract?: string;
494
+ settle?: string;
495
+ amount?: string;
496
+ is_gte?: boolean;
497
+ activation_price?: string;
498
+ price_type?: number;
499
+ price_offset?: string;
500
+ text?: string;
501
+ reduce_only?: boolean;
502
+ position_related?: boolean;
503
+ created_at?: number | string;
504
+ activated_at?: number | string;
505
+ finished_at?: number | string;
506
+ create_time?: number | string;
507
+ active_time?: number | string;
508
+ finish_time?: number | string;
509
+ reason?: string;
510
+ suborder_text?: string;
511
+ is_dual_mode?: boolean;
512
+ trigger_price?: string;
513
+ suborder_id?: number | string;
514
+ side_label?: string;
515
+ original_status?: number;
516
+ status?: string;
517
+ position_side_output?: string;
518
+ updated_at?: number | string;
519
+ extremum_price?: string;
520
+ status_code?: string;
521
+ created_at_precise?: string;
522
+ finished_at_precise?: string;
523
+ activated_at_precise?: string;
524
+ status_label?: string;
525
+ pos_margin_mode?: string;
526
+ position_mode?: string;
527
+ error_label?: string;
528
+ leverage?: string;
529
+ [key: string]: unknown;
530
+ }
531
+ export interface TrailChangeLog {
532
+ updated_at?: number;
533
+ amount?: string;
534
+ is_gte?: boolean;
535
+ activation_price?: string;
536
+ price_type?: number;
537
+ price_offset?: string;
538
+ is_create?: boolean;
539
+ }
@@ -126,6 +126,10 @@ export interface MultiLoanCurrencyQuota {
126
126
  min_quota: string;
127
127
  left_quota: string;
128
128
  left_quote_usdt: string;
129
+ /** Remaining borrow/collateral limit for fixed-term currency */
130
+ left_quota_fixed?: string;
131
+ /** Remaining currency limit for fixed-term converted to USDT */
132
+ left_quote_usdt_fixed?: string;
129
133
  }
130
134
  export interface MultiLoanSupportedCurrencies {
131
135
  loan_currencies: {
@@ -0,0 +1,178 @@
1
+ /** P2P Merchant API response types */
2
+ export interface P2PMerchantApiResp<T> {
3
+ timestamp: number;
4
+ method: string;
5
+ code: number;
6
+ message: string;
7
+ data: T;
8
+ version: string;
9
+ }
10
+ export interface P2PMerchantUserInfo {
11
+ is_self?: boolean;
12
+ user_timest?: string;
13
+ counterparties_num?: number;
14
+ email_verified?: string;
15
+ verified?: string;
16
+ has_phone?: string;
17
+ user_name?: string;
18
+ user_note?: string;
19
+ complete_transactions?: string;
20
+ paid_transactions?: string;
21
+ accepted_transactions?: string;
22
+ transactions_used_time?: string;
23
+ cancelled_used_time_month?: string;
24
+ complete_transactions_month?: string;
25
+ complete_rate_month?: number;
26
+ orders_buy_rate_month?: number;
27
+ is_black?: number;
28
+ is_follow?: number;
29
+ have_traded?: number;
30
+ biz_uid?: string;
31
+ blue_vip?: number;
32
+ work_status?: number;
33
+ registration_days?: number;
34
+ first_trade_days?: number;
35
+ need_replenish?: number;
36
+ merchant_info?: {
37
+ type?: string;
38
+ market?: string;
39
+ };
40
+ online_status?: number;
41
+ work_hours?: Record<string, unknown> | null;
42
+ transactions_month?: number;
43
+ transactions_all?: number;
44
+ trade_versatile?: boolean;
45
+ [key: string]: unknown;
46
+ }
47
+ export interface P2PMerchantCounterpartyUserInfo {
48
+ user_timest?: string;
49
+ email_verified?: string;
50
+ verified?: string;
51
+ has_phone?: string;
52
+ user_name?: string;
53
+ user_note?: string;
54
+ complete_transactions?: string;
55
+ paid_transactions?: string;
56
+ accepted_transactions?: string;
57
+ transactions_used_time?: string;
58
+ cancelled_used_time_month?: string;
59
+ complete_transactions_month?: string;
60
+ complete_rate_month?: number;
61
+ is_follow?: number;
62
+ have_traded?: number;
63
+ biz_uid?: string;
64
+ registration_days?: number;
65
+ first_trade_days?: number;
66
+ trade_versatile?: boolean;
67
+ [key: string]: unknown;
68
+ }
69
+ export interface P2PMerchantPaymentMethod {
70
+ pay_type: string;
71
+ pay_name: string;
72
+ ids: number[];
73
+ list: Record<string, unknown>[];
74
+ }
75
+ export interface P2PMerchantTransactionListItem {
76
+ type_buy?: number;
77
+ timest?: string;
78
+ timest_expire?: string;
79
+ type?: string;
80
+ trade_type?: string;
81
+ timestamp?: number;
82
+ rate?: string;
83
+ amount?: string;
84
+ total?: string;
85
+ txid?: number;
86
+ status?: string;
87
+ order_status?: string;
88
+ [key: string]: unknown;
89
+ }
90
+ export interface P2PMerchantTransactionListData {
91
+ list: P2PMerchantTransactionListItem[];
92
+ trans_time?: {
93
+ od_time?: number;
94
+ }[];
95
+ count: number;
96
+ exported_num: number;
97
+ }
98
+ export interface P2PMerchantTransactionDetails {
99
+ is_sell?: number;
100
+ txid?: number;
101
+ orderid?: number;
102
+ timest?: number;
103
+ last_pay_time?: number;
104
+ remain_pay_time?: number;
105
+ currencyType?: string;
106
+ want_type?: string;
107
+ rate?: string;
108
+ amount?: string;
109
+ total?: string;
110
+ status?: string;
111
+ state?: string;
112
+ its_uid?: string;
113
+ its_nickname?: string;
114
+ its_realname?: string;
115
+ [key: string]: unknown;
116
+ }
117
+ export interface P2PMerchantAdsDetail {
118
+ rate?: string;
119
+ type?: string;
120
+ amount?: string;
121
+ min_amount?: string;
122
+ max_amount?: string;
123
+ total?: string;
124
+ orderid?: number;
125
+ timestamp?: number;
126
+ currencyType?: string;
127
+ want_type?: string;
128
+ status?: string;
129
+ [key: string]: unknown;
130
+ }
131
+ export interface P2PMerchantMyAdsListItem {
132
+ type?: string;
133
+ rate?: string;
134
+ amount?: string;
135
+ total?: string;
136
+ id?: string;
137
+ status?: string;
138
+ currencyType?: string;
139
+ want_type?: string;
140
+ [key: string]: unknown;
141
+ }
142
+ export interface P2PMerchantMyAdsListData {
143
+ lists: P2PMerchantMyAdsListItem[];
144
+ }
145
+ export interface P2PMerchantAdsListItem {
146
+ index?: number;
147
+ asset?: string;
148
+ fiat_unit?: string;
149
+ adv_no?: number;
150
+ price?: string;
151
+ max_single_trans_amount?: string;
152
+ min_single_trans_amount?: string;
153
+ nick_name?: string;
154
+ }
155
+ export interface P2PMerchantChatMessage {
156
+ is_sell?: number;
157
+ msg_type?: number;
158
+ msg?: string;
159
+ username?: string;
160
+ uid?: string;
161
+ timest?: number;
162
+ type?: number;
163
+ pic?: string;
164
+ file_key?: string;
165
+ file_type?: string;
166
+ width?: string;
167
+ height?: string;
168
+ msg_obj?: Record<string, unknown>;
169
+ [key: string]: unknown;
170
+ }
171
+ export interface P2PMerchantChatsListData {
172
+ messages: P2PMerchantChatMessage[];
173
+ has_history?: boolean;
174
+ txid?: number;
175
+ SRVTM?: number;
176
+ order_status?: string;
177
+ memo?: string;
178
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /** P2P Merchant API response types */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=p2pMerchant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p2pMerchant.js","sourceRoot":"","sources":["../../../../src/types/response/p2pMerchant.ts"],"names":[],"mappings":";AAAA,sCAAsC"}
@@ -190,7 +190,7 @@ export interface SpotPriceTriggeredOrder {
190
190
  trigger: {
191
191
  price: string;
192
192
  rule: '>=' | '<=';
193
- expiration: number;
193
+ expiration?: number;
194
194
  };
195
195
  put: {
196
196
  type?: 'limit' | 'market';
@@ -0,0 +1,200 @@
1
+ /** TradFi API response types */
2
+ export interface TradFiApiResp<T> {
3
+ timestamp?: number;
4
+ data?: T;
5
+ code?: number;
6
+ message?: string;
7
+ label?: string;
8
+ }
9
+ export interface TradFiListData<T> {
10
+ list?: T[];
11
+ }
12
+ export interface TradFiMT5Account {
13
+ mt5_uid?: number;
14
+ leverage?: number;
15
+ stop_out_level?: string;
16
+ status?: number;
17
+ }
18
+ export interface TradFiCategoryItem {
19
+ category_id?: number;
20
+ is_favorite?: boolean;
21
+ category_name?: string;
22
+ }
23
+ export interface TradFiSymbolItem {
24
+ symbol?: string;
25
+ symbol_desc?: string;
26
+ category_id?: number;
27
+ status?: string;
28
+ trade_mode?: string;
29
+ icon_link?: string;
30
+ close_time?: number;
31
+ open_time?: number;
32
+ next_open_time?: number;
33
+ settlement_currency?: string;
34
+ settlement_currency_symbol?: string;
35
+ price_precision?: number;
36
+ }
37
+ export interface TradFiSymbolDetailItem {
38
+ symbol?: string;
39
+ symbol_desc?: string;
40
+ category_name?: string;
41
+ contract_volume?: string;
42
+ settlement_currency?: string;
43
+ max_order_volume?: string;
44
+ min_order_volume?: string;
45
+ leverage?: string;
46
+ price_precision?: number;
47
+ price_sl_level?: string;
48
+ swap_cost_type?: string;
49
+ buy_swap_cost_rate?: string;
50
+ sell_swap_cost_rate?: string;
51
+ swap_cost_3day?: string;
52
+ trade_timezone?: string;
53
+ trade_mode?: string;
54
+ icon_link?: string;
55
+ [key: string]: unknown;
56
+ }
57
+ export interface TradFiKlineItem {
58
+ o?: string;
59
+ c?: string;
60
+ h?: string;
61
+ l?: string;
62
+ t?: number;
63
+ }
64
+ export interface TradFiTicker {
65
+ highest_price?: string;
66
+ lowest_price?: string;
67
+ price_change?: string;
68
+ price_change_amount?: string;
69
+ today_open_price?: string;
70
+ last_today_close_price?: string;
71
+ last_price?: string;
72
+ bid_price?: string;
73
+ ask_price?: string;
74
+ favorite?: boolean;
75
+ status?: string;
76
+ close_time?: number;
77
+ open_time?: number;
78
+ next_open_time?: number;
79
+ trade_mode?: string;
80
+ category_name?: string;
81
+ }
82
+ export interface TradFiCreateUserResult {
83
+ status?: number;
84
+ leverage?: number;
85
+ mt5_uid?: string;
86
+ }
87
+ export interface TradFiAssets {
88
+ equity?: string;
89
+ margin_level?: string;
90
+ balance?: string;
91
+ margin?: string;
92
+ margin_free?: string;
93
+ unrealized_pnl?: string;
94
+ mt5_uid?: string;
95
+ }
96
+ export interface TradFiTransactionRecord {
97
+ asset?: string;
98
+ type?: string;
99
+ type_desc?: string;
100
+ change?: string;
101
+ balance?: string;
102
+ time?: number;
103
+ }
104
+ export interface TradFiTransactionListData {
105
+ total?: number;
106
+ total_page?: number;
107
+ list?: TradFiTransactionRecord[];
108
+ }
109
+ export interface TradFiCreateOrderResult {
110
+ id?: string;
111
+ }
112
+ export interface TradFiOrderItem {
113
+ order_id?: number;
114
+ symbol?: string;
115
+ symbol_desc?: string;
116
+ price_type?: string;
117
+ state?: number;
118
+ state_desc?: string;
119
+ finished?: number;
120
+ side?: number;
121
+ volume?: string;
122
+ price?: string;
123
+ price_tp?: string;
124
+ price_sl?: string;
125
+ time_setup?: number;
126
+ }
127
+ export interface TradFiOrderListData {
128
+ list?: TradFiOrderItem[];
129
+ timestamp?: number;
130
+ }
131
+ export interface TradFiModifyOrderResult {
132
+ order_id?: number;
133
+ symbol?: string;
134
+ state?: string;
135
+ volume?: string;
136
+ price?: string;
137
+ price_tp?: string;
138
+ price_sl?: string;
139
+ }
140
+ export interface TradFiOrderHistoryItem {
141
+ order_id?: number;
142
+ symbol?: string;
143
+ symbol_desc?: string;
144
+ price_type?: string;
145
+ order_opt_type?: number;
146
+ state?: number;
147
+ state_desc?: string;
148
+ side?: number;
149
+ volume?: string;
150
+ fill_volume?: string;
151
+ close_pnl?: string;
152
+ price?: string;
153
+ trigger_price?: string;
154
+ price_tp?: string;
155
+ price_sl?: string;
156
+ time_setup?: number;
157
+ time_done?: number;
158
+ }
159
+ export interface TradFiPositionItem {
160
+ position_id?: number;
161
+ symbol?: string;
162
+ symbol_desc?: string;
163
+ margin?: string;
164
+ unrealized_pnl?: string;
165
+ unrealized_pnl_rate?: string;
166
+ volume?: string;
167
+ price_open?: string;
168
+ position_dir?: string;
169
+ price_tp?: string;
170
+ price_sl?: string;
171
+ counterparty_price?: string;
172
+ time_create?: number;
173
+ }
174
+ export interface TradFiPositionListData {
175
+ list?: TradFiPositionItem[];
176
+ timestamp?: number;
177
+ }
178
+ export interface TradFiPositionHistoryItem {
179
+ position_id?: number;
180
+ symbol?: string;
181
+ realized_pnl?: string;
182
+ realized_pnl_rate?: string;
183
+ volume?: string;
184
+ volume_closed?: string;
185
+ price_open?: string;
186
+ position_dir?: string;
187
+ price_tp?: string;
188
+ price_sl?: string;
189
+ counterparty_price?: string;
190
+ close_price?: string;
191
+ time_create?: string;
192
+ time_close?: string;
193
+ position_status?: string;
194
+ close_detail?: Record<string, unknown> | null;
195
+ realized_pnl_detail?: {
196
+ closed_pnl?: string;
197
+ swap?: string;
198
+ fee?: string;
199
+ };
200
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /** TradFi API response types */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=tradfi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tradfi.js","sourceRoot":"","sources":["../../../../src/types/response/tradfi.ts"],"names":[],"mappings":";AAAA,gCAAgC"}