gateio-api 1.0.4 → 1.0.6
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 +12 -6
- package/dist/cjs/RestClient.d.ts +559 -560
- package/dist/cjs/RestClient.js +271 -271
- package/dist/cjs/RestClient.js.map +1 -1
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/mjs/RestClient.d.ts +559 -560
- package/dist/mjs/RestClient.js +271 -271
- package/dist/mjs/RestClient.js.map +1 -1
- package/dist/mjs/index.d.ts +0 -1
- package/dist/mjs/index.js +0 -1
- package/dist/mjs/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/types/response/shared.d.ts +0 -5
- package/dist/cjs/types/response/shared.js +0 -3
- package/dist/cjs/types/response/shared.js.map +0 -1
- package/dist/mjs/types/response/shared.d.ts +0 -5
- package/dist/mjs/types/response/shared.js +0 -2
- package/dist/mjs/types/response/shared.js.map +0 -1
package/dist/mjs/RestClient.js
CHANGED
|
@@ -23,7 +23,7 @@ export class RestClient extends BaseRestClient {
|
|
|
23
23
|
* Withdrawals to Gate addresses do not incur transaction fees.
|
|
24
24
|
*
|
|
25
25
|
* @param params Withdrawal parameters
|
|
26
|
-
* @returns Promise<
|
|
26
|
+
* @returns Promise<Withdraw>
|
|
27
27
|
*/
|
|
28
28
|
submitWithdrawal(params) {
|
|
29
29
|
return this.postPrivate('/withdrawals', { query: params });
|
|
@@ -32,7 +32,7 @@ export class RestClient extends BaseRestClient {
|
|
|
32
32
|
* Cancel withdrawal with specified ID
|
|
33
33
|
*
|
|
34
34
|
* @param params Parameters containing the withdrawal ID
|
|
35
|
-
* @returns Promise<
|
|
35
|
+
* @returns Promise<Withdraw>
|
|
36
36
|
*/
|
|
37
37
|
cancelWithdrawal(params) {
|
|
38
38
|
return this.deletePrivate(`/withdrawals/${params.withdrawal_id}`);
|
|
@@ -45,7 +45,7 @@ export class RestClient extends BaseRestClient {
|
|
|
45
45
|
* List chains supported for specified currency
|
|
46
46
|
*
|
|
47
47
|
* @param params Parameters containing the currency name
|
|
48
|
-
* @returns Promise<
|
|
48
|
+
* @returns Promise< GetCurrencyChainsResp[][]>
|
|
49
49
|
*/
|
|
50
50
|
getCurrencyChains(params) {
|
|
51
51
|
return this.get('/wallet/currency_chains', params);
|
|
@@ -54,7 +54,7 @@ export class RestClient extends BaseRestClient {
|
|
|
54
54
|
* Generate currency deposit address
|
|
55
55
|
*
|
|
56
56
|
* @param params Parameters containing the currency name
|
|
57
|
-
* @returns Promise<
|
|
57
|
+
* @returns Promise<CreateDepositAddressResp>
|
|
58
58
|
*/
|
|
59
59
|
createDepositAddress(params) {
|
|
60
60
|
return this.getPrivate('/wallet/deposit_address', params);
|
|
@@ -65,7 +65,7 @@ export class RestClient extends BaseRestClient {
|
|
|
65
65
|
* Record time range cannot exceed 30 days
|
|
66
66
|
*
|
|
67
67
|
* @param params Parameters for filtering withdrawal records
|
|
68
|
-
* @returns Promise<
|
|
68
|
+
* @returns Promise<Withdraw[]>
|
|
69
69
|
*/
|
|
70
70
|
getWithdrawalRecords(params) {
|
|
71
71
|
return this.getPrivate('/wallet/withdrawals', params);
|
|
@@ -76,7 +76,7 @@ export class RestClient extends BaseRestClient {
|
|
|
76
76
|
* Record time range cannot exceed 30 days
|
|
77
77
|
*
|
|
78
78
|
* @param params Parameters for filtering deposit records
|
|
79
|
-
* @returns Promise<
|
|
79
|
+
* @returns Promise<Withdraw[]>
|
|
80
80
|
*/
|
|
81
81
|
getDepositRecords(params) {
|
|
82
82
|
return this.getPrivate('/wallet/deposits', params);
|
|
@@ -92,7 +92,7 @@ export class RestClient extends BaseRestClient {
|
|
|
92
92
|
* - spot - options
|
|
93
93
|
*
|
|
94
94
|
* @param params Transfer parameters
|
|
95
|
-
* @returns Promise<
|
|
95
|
+
* @returns Promise<TransferResponse>
|
|
96
96
|
*/
|
|
97
97
|
submitTransfer(params) {
|
|
98
98
|
return this.postPrivate('/wallet/transfers', { body: params });
|
|
@@ -103,7 +103,7 @@ export class RestClient extends BaseRestClient {
|
|
|
103
103
|
* Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated.
|
|
104
104
|
*
|
|
105
105
|
* @param params Transfer parameters
|
|
106
|
-
* @returns Promise<
|
|
106
|
+
* @returns Promise<any>
|
|
107
107
|
*/
|
|
108
108
|
submitMainSubTransfer(params) {
|
|
109
109
|
return this.postPrivate('/wallet/sub_account_transfers', { body: params });
|
|
@@ -116,7 +116,7 @@ export class RestClient extends BaseRestClient {
|
|
|
116
116
|
* Note: only records after 2020-04-10 can be retrieved
|
|
117
117
|
*
|
|
118
118
|
* @param params Parameters for filtering transfer records
|
|
119
|
-
* @returns Promise<
|
|
119
|
+
* @returns Promise<SubAccountTransferRecordResp[]>
|
|
120
120
|
*/
|
|
121
121
|
getMainSubTransfers(params) {
|
|
122
122
|
return this.getPrivate('/wallet/sub_account_transfers', params);
|
|
@@ -127,7 +127,7 @@ export class RestClient extends BaseRestClient {
|
|
|
127
127
|
* It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer.
|
|
128
128
|
*
|
|
129
129
|
* @param params Transfer parameters
|
|
130
|
-
* @returns Promise<
|
|
130
|
+
* @returns Promise<any>
|
|
131
131
|
*/
|
|
132
132
|
submitSubToSubTransfer(params) {
|
|
133
133
|
return this.postPrivate('/wallet/sub_account_to_sub_account', {
|
|
@@ -138,7 +138,7 @@ export class RestClient extends BaseRestClient {
|
|
|
138
138
|
* Retrieve withdrawal status
|
|
139
139
|
*
|
|
140
140
|
* @param params Parameters for retrieving withdrawal status
|
|
141
|
-
* @returns Promise<
|
|
141
|
+
* @returns Promise<GetWithdrawalStatusResp[]>
|
|
142
142
|
*/
|
|
143
143
|
getWithdrawalStatus(params) {
|
|
144
144
|
return this.getPrivate('/wallet/withdraw_status', params);
|
|
@@ -147,10 +147,10 @@ export class RestClient extends BaseRestClient {
|
|
|
147
147
|
* Retrieve sub account balances
|
|
148
148
|
*
|
|
149
149
|
* @param params Parameters for retrieving sub account balances
|
|
150
|
-
* @returns Promise<
|
|
150
|
+
* @returns Promise<{
|
|
151
151
|
uid: string;
|
|
152
152
|
available: { [key: string]: string };
|
|
153
|
-
}[]
|
|
153
|
+
}[]>
|
|
154
154
|
*/
|
|
155
155
|
getSubBalance(params) {
|
|
156
156
|
return this.getPrivate('/wallet/sub_account_balances', params);
|
|
@@ -159,7 +159,7 @@ export class RestClient extends BaseRestClient {
|
|
|
159
159
|
* Query sub accounts' margin balances
|
|
160
160
|
*
|
|
161
161
|
* @param params Parameters for querying sub accounts' margin balances
|
|
162
|
-
* @returns Promise<
|
|
162
|
+
* @returns Promise<SubAccountMarginBalancesResp[]>
|
|
163
163
|
*/
|
|
164
164
|
getSubMarginBalances(params) {
|
|
165
165
|
return this.getPrivate('/wallet/sub_account_margin_balances', params);
|
|
@@ -168,7 +168,7 @@ export class RestClient extends BaseRestClient {
|
|
|
168
168
|
* Query sub accounts' futures account balances
|
|
169
169
|
*
|
|
170
170
|
* @param params Parameters for querying sub accounts' futures account balances
|
|
171
|
-
* @returns Promise<
|
|
171
|
+
* @returns Promise<SubAccountFuturesBalancesResp[]>
|
|
172
172
|
*/
|
|
173
173
|
getSubFuturesBalances(params) {
|
|
174
174
|
return this.getPrivate('/wallet/sub_account_futures_balances', params);
|
|
@@ -177,7 +177,7 @@ export class RestClient extends BaseRestClient {
|
|
|
177
177
|
* Query subaccount's cross_margin account info
|
|
178
178
|
*
|
|
179
179
|
* @param params Parameters for querying subaccount's cross_margin account info
|
|
180
|
-
* @returns Promise<
|
|
180
|
+
* @returns Promise<SubAccountCrossMarginBalancesResp[]>
|
|
181
181
|
*/
|
|
182
182
|
getSubCrossMarginBalances(params) {
|
|
183
183
|
return this.getPrivate('/wallet/sub_account_cross_margin_balances', params);
|
|
@@ -186,7 +186,7 @@ export class RestClient extends BaseRestClient {
|
|
|
186
186
|
* Query saved addresses
|
|
187
187
|
*
|
|
188
188
|
* @param params Parameters for querying saved address
|
|
189
|
-
* @returns Promise<
|
|
189
|
+
* @returns Promise<GetSavedAddressResp[]>
|
|
190
190
|
*/
|
|
191
191
|
getSavedAddresses(params) {
|
|
192
192
|
return this.getPrivate('/wallet/saved_address', params);
|
|
@@ -195,7 +195,7 @@ export class RestClient extends BaseRestClient {
|
|
|
195
195
|
* Retrieve personal trading fee
|
|
196
196
|
*
|
|
197
197
|
* @param params Parameters for retrieving personal trading fee
|
|
198
|
-
* @returns Promise<
|
|
198
|
+
* @returns Promise<GetTradingFeesResp>
|
|
199
199
|
*/
|
|
200
200
|
getTradingFees(params) {
|
|
201
201
|
return this.getPrivate('/wallet/fee', params);
|
|
@@ -212,7 +212,7 @@ export class RestClient extends BaseRestClient {
|
|
|
212
212
|
* - GET /futures/{settle}/accounts to query futures account balance
|
|
213
213
|
*
|
|
214
214
|
* @param params Parameters for retrieving total balances
|
|
215
|
-
* @returns Promise<
|
|
215
|
+
* @returns Promise<GetBalancesResp>
|
|
216
216
|
*/
|
|
217
217
|
getBalances(params) {
|
|
218
218
|
return this.getPrivate('/wallet/total_balance', params);
|
|
@@ -220,7 +220,7 @@ export class RestClient extends BaseRestClient {
|
|
|
220
220
|
/**
|
|
221
221
|
* List small balance
|
|
222
222
|
*
|
|
223
|
-
* @returns Promise<
|
|
223
|
+
* @returns Promise<GetSmallBalancesResp>
|
|
224
224
|
*/
|
|
225
225
|
getSmallBalances() {
|
|
226
226
|
return this.getPrivate('/wallet/small_balance');
|
|
@@ -229,7 +229,7 @@ export class RestClient extends BaseRestClient {
|
|
|
229
229
|
* Convert small balance
|
|
230
230
|
*
|
|
231
231
|
* @param params Parameters for converting small balance
|
|
232
|
-
* @returns Promise<
|
|
232
|
+
* @returns Promise<any>
|
|
233
233
|
*/
|
|
234
234
|
convertSmallBalance(params) {
|
|
235
235
|
return this.postPrivate('/wallet/small_balance', { body: params });
|
|
@@ -238,7 +238,7 @@ export class RestClient extends BaseRestClient {
|
|
|
238
238
|
* List small balance history
|
|
239
239
|
*
|
|
240
240
|
* @param params Parameters for listing small balance history
|
|
241
|
-
* @returns Promise<
|
|
241
|
+
* @returns Promise<GetSmallBalanceHistoryResp[]>
|
|
242
242
|
*/
|
|
243
243
|
getSmallBalanceHistory(params) {
|
|
244
244
|
return this.getPrivate('/wallet/small_balance_history', params);
|
|
@@ -251,7 +251,7 @@ export class RestClient extends BaseRestClient {
|
|
|
251
251
|
* Create a new sub-account
|
|
252
252
|
*
|
|
253
253
|
* @param params Parameters for creating a new sub-account
|
|
254
|
-
* @returns Promise<
|
|
254
|
+
* @returns Promise<CreateSubAccountResp>
|
|
255
255
|
*/
|
|
256
256
|
createSubAccount(params) {
|
|
257
257
|
return this.postPrivate('/sub_accounts', { body: params });
|
|
@@ -260,7 +260,7 @@ export class RestClient extends BaseRestClient {
|
|
|
260
260
|
* List sub-accounts
|
|
261
261
|
*
|
|
262
262
|
* @param params Parameters for listing sub-accounts
|
|
263
|
-
* @returns Promise<
|
|
263
|
+
* @returns Promise<GetSubAccountsResp[]>
|
|
264
264
|
*/
|
|
265
265
|
getSubAccounts(params) {
|
|
266
266
|
return this.getPrivate('/sub_accounts', params);
|
|
@@ -269,7 +269,7 @@ export class RestClient extends BaseRestClient {
|
|
|
269
269
|
* Get the sub-account
|
|
270
270
|
*
|
|
271
271
|
* @param params Parameters containing the sub-account user ID
|
|
272
|
-
* @returns Promise<
|
|
272
|
+
* @returns Promise<SubAccountResp>
|
|
273
273
|
*/
|
|
274
274
|
getSubAccount(params) {
|
|
275
275
|
return this.getPrivate(`/sub_accounts/${params.user_id}`);
|
|
@@ -278,7 +278,7 @@ export class RestClient extends BaseRestClient {
|
|
|
278
278
|
* Create API Key of the sub-account
|
|
279
279
|
*
|
|
280
280
|
* @param params Parameters for creating API Key of the sub-account
|
|
281
|
-
* @returns Promise<
|
|
281
|
+
* @returns Promise<CreateSubAccountApiKeyResp>
|
|
282
282
|
*/
|
|
283
283
|
createSubAccountApiKey(params) {
|
|
284
284
|
const { user_id, ...body } = params;
|
|
@@ -288,7 +288,7 @@ export class RestClient extends BaseRestClient {
|
|
|
288
288
|
* List all API Key of the sub-account
|
|
289
289
|
*
|
|
290
290
|
* @param params Parameters containing the sub-account user ID
|
|
291
|
-
* @returns Promise<
|
|
291
|
+
* @returns Promise<SubAccountKey[]>
|
|
292
292
|
*/
|
|
293
293
|
getSubAccountApiKeys(params) {
|
|
294
294
|
return this.getPrivate(`/sub_accounts/${params.user_id}/keys`);
|
|
@@ -297,7 +297,7 @@ export class RestClient extends BaseRestClient {
|
|
|
297
297
|
* Update API key of the sub-account
|
|
298
298
|
*
|
|
299
299
|
* @param params Parameters for updating API key of the sub-account
|
|
300
|
-
* @returns Promise<
|
|
300
|
+
* @returns Promise<any>
|
|
301
301
|
*/
|
|
302
302
|
updateSubAccountApiKey(params) {
|
|
303
303
|
const { user_id, key, ...body } = params;
|
|
@@ -307,7 +307,7 @@ export class RestClient extends BaseRestClient {
|
|
|
307
307
|
* Delete API key of the sub-account
|
|
308
308
|
*
|
|
309
309
|
* @param params Parameters for deleting API key of the sub-account
|
|
310
|
-
* @returns Promise<
|
|
310
|
+
* @returns Promise<any>
|
|
311
311
|
*/
|
|
312
312
|
deleteSubAccountApiKey(params) {
|
|
313
313
|
return this.deletePrivate(`/sub_accounts/${params.user_id}/keys/${params.key}`);
|
|
@@ -316,7 +316,7 @@ export class RestClient extends BaseRestClient {
|
|
|
316
316
|
* Get the API Key of the sub-account
|
|
317
317
|
*
|
|
318
318
|
* @param params Parameters containing the sub-account user ID and API key
|
|
319
|
-
* @returns Promise<
|
|
319
|
+
* @returns Promise<SubAccountKey>
|
|
320
320
|
*/
|
|
321
321
|
getSubAccountApiKey(params) {
|
|
322
322
|
return this.getPrivate(`/sub_accounts/${params.user_id}/keys/${params.key}`);
|
|
@@ -325,7 +325,7 @@ export class RestClient extends BaseRestClient {
|
|
|
325
325
|
* Lock the sub-account
|
|
326
326
|
*
|
|
327
327
|
* @param params Parameters containing the sub-account user ID
|
|
328
|
-
* @returns Promise<
|
|
328
|
+
* @returns Promise<any>
|
|
329
329
|
*/
|
|
330
330
|
lockSubAccount(params) {
|
|
331
331
|
return this.postPrivate(`/sub_accounts/${params.user_id}/lock`);
|
|
@@ -334,7 +334,7 @@ export class RestClient extends BaseRestClient {
|
|
|
334
334
|
* Unlock the sub-account
|
|
335
335
|
*
|
|
336
336
|
* @param params Parameters containing the sub-account user ID
|
|
337
|
-
* @returns Promise<
|
|
337
|
+
* @returns Promise<any>
|
|
338
338
|
*/
|
|
339
339
|
unlockSubAccount(params) {
|
|
340
340
|
return this.postPrivate(`/sub_accounts/${params.user_id}/unlock`);
|
|
@@ -349,7 +349,7 @@ export class RestClient extends BaseRestClient {
|
|
|
349
349
|
* The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account.
|
|
350
350
|
*
|
|
351
351
|
* @param params Parameters for retrieving unified account information
|
|
352
|
-
* @returns Promise<
|
|
352
|
+
* @returns Promise<GetUnifiedAccountInfoResp>
|
|
353
353
|
*/
|
|
354
354
|
getUnifiedAccountInfo(params) {
|
|
355
355
|
return this.getPrivate('/unified/accounts', params);
|
|
@@ -358,10 +358,10 @@ export class RestClient extends BaseRestClient {
|
|
|
358
358
|
* Query about the maximum borrowing for the unified account
|
|
359
359
|
*
|
|
360
360
|
* @param params Parameters for querying the maximum borrowing for the unified account
|
|
361
|
-
* @returns Promise<
|
|
361
|
+
* @returns Promise<{
|
|
362
362
|
* currency: string;
|
|
363
363
|
* amount: string;
|
|
364
|
-
* }
|
|
364
|
+
* }>
|
|
365
365
|
*/
|
|
366
366
|
getUnifiedMaxBorrow(params) {
|
|
367
367
|
return this.getPrivate('/unified/borrowable', params);
|
|
@@ -370,10 +370,10 @@ export class RestClient extends BaseRestClient {
|
|
|
370
370
|
* Query about the maximum transferable for the unified account
|
|
371
371
|
*
|
|
372
372
|
* @param params Parameters for querying the maximum transferable for the unified account
|
|
373
|
-
* @returns Promise<
|
|
373
|
+
* @returns Promise<{
|
|
374
374
|
* currency: string;
|
|
375
375
|
* amount: string;
|
|
376
|
-
* }
|
|
376
|
+
* }>
|
|
377
377
|
*/
|
|
378
378
|
getUnifiedMaxTransferable(params) {
|
|
379
379
|
return this.getPrivate('/unified/transferable', params);
|
|
@@ -388,7 +388,7 @@ export class RestClient extends BaseRestClient {
|
|
|
388
388
|
* For repayment, the option to repay the entire borrowed amount is available by setting the parameter repaid_all=true
|
|
389
389
|
*
|
|
390
390
|
* @param params Parameters for borrowing or repaying
|
|
391
|
-
* @returns Promise<
|
|
391
|
+
* @returns Promise<any>
|
|
392
392
|
*/
|
|
393
393
|
submitUnifiedBorrowOrRepay(params) {
|
|
394
394
|
return this.postPrivate('/unified/loans', { body: params });
|
|
@@ -397,7 +397,7 @@ export class RestClient extends BaseRestClient {
|
|
|
397
397
|
* List loans
|
|
398
398
|
*
|
|
399
399
|
* @param params Parameters for listing loans
|
|
400
|
-
* @returns Promise<
|
|
400
|
+
* @returns Promise<GetUnifiedLoansResp[]>
|
|
401
401
|
*/
|
|
402
402
|
getUnifiedLoans(params) {
|
|
403
403
|
return this.getPrivate('/unified/loans', params);
|
|
@@ -406,7 +406,7 @@ export class RestClient extends BaseRestClient {
|
|
|
406
406
|
* Get loan records
|
|
407
407
|
*
|
|
408
408
|
* @param params Parameters for getting loan records
|
|
409
|
-
* @returns Promise<
|
|
409
|
+
* @returns Promise<GetUnifiedLoanRecordsResp[]>
|
|
410
410
|
*/
|
|
411
411
|
getUnifiedLoanRecords(params) {
|
|
412
412
|
return this.getPrivate('/unified/loan_records', params);
|
|
@@ -415,7 +415,7 @@ export class RestClient extends BaseRestClient {
|
|
|
415
415
|
* List interest records
|
|
416
416
|
*
|
|
417
417
|
* @param params Parameters for listing interest records
|
|
418
|
-
* @returns Promise<
|
|
418
|
+
* @returns Promise<GetUnifiedInterestRecordsResp[]>
|
|
419
419
|
*/
|
|
420
420
|
getUnifiedInterestRecords(params) {
|
|
421
421
|
return this.getPrivate('/unified/interest_records', params);
|
|
@@ -423,7 +423,7 @@ export class RestClient extends BaseRestClient {
|
|
|
423
423
|
/**
|
|
424
424
|
* Retrieve user risk unit details, only valid in portfolio margin mode
|
|
425
425
|
*
|
|
426
|
-
* @returns Promise<
|
|
426
|
+
* @returns Promise<GetUnifiedRiskUnitDetailsResp>
|
|
427
427
|
*/
|
|
428
428
|
getUnifiedRiskUnitDetails() {
|
|
429
429
|
return this.getPrivate('/unified/risk_units');
|
|
@@ -434,7 +434,7 @@ export class RestClient extends BaseRestClient {
|
|
|
434
434
|
* Switching between different account modes requires only passing the parameters corresponding to the target account mode. It also supports opening or closing configuration switches for the corresponding account mode when switching.
|
|
435
435
|
*
|
|
436
436
|
* @param params Parameters for setting the mode of the unified account
|
|
437
|
-
* @returns Promise<
|
|
437
|
+
* @returns Promise<any>
|
|
438
438
|
*/
|
|
439
439
|
setUnifiedAccountMode(params) {
|
|
440
440
|
return this.putPrivate('/unified/unified_mode', { body: params });
|
|
@@ -442,13 +442,13 @@ export class RestClient extends BaseRestClient {
|
|
|
442
442
|
/**
|
|
443
443
|
* Query mode of the unified account
|
|
444
444
|
*
|
|
445
|
-
* @returns Promise<
|
|
445
|
+
* @returns Promise<{
|
|
446
446
|
* mode: 'classic' | 'multi_currency' | 'portfolio';
|
|
447
447
|
* settings: {
|
|
448
448
|
* usdt_futures?: boolean;
|
|
449
449
|
* spot_hedge?: boolean;
|
|
450
450
|
* };
|
|
451
|
-
* }
|
|
451
|
+
* }>
|
|
452
452
|
*/
|
|
453
453
|
getUnifiedAccountMode() {
|
|
454
454
|
return this.getPrivate('/unified/unified_mode');
|
|
@@ -459,7 +459,7 @@ export class RestClient extends BaseRestClient {
|
|
|
459
459
|
* Due to fluctuations in lending depth, hourly interest rates may vary, and thus, I cannot provide exact rates. When a currency is not supported, the interest rate returned will be an empty string.
|
|
460
460
|
*
|
|
461
461
|
* @param params Parameters for querying estimate rates
|
|
462
|
-
* @returns Promise<
|
|
462
|
+
* @returns Promise<{ [key: string]: string }>
|
|
463
463
|
*/
|
|
464
464
|
getUnifiedEstimateRate(params) {
|
|
465
465
|
return this.getPrivate('/unified/estimate_rate', params);
|
|
@@ -467,7 +467,7 @@ export class RestClient extends BaseRestClient {
|
|
|
467
467
|
/**
|
|
468
468
|
* List currency discount tiers
|
|
469
469
|
*
|
|
470
|
-
* @returns Promise<
|
|
470
|
+
* @returns Promise<GetUnifiedCurrencyDiscountTiersResp[]>
|
|
471
471
|
*/
|
|
472
472
|
getUnifiedCurrencyDiscountTiers() {
|
|
473
473
|
return this.get('/unified/currency_discount_tiers');
|
|
@@ -478,7 +478,7 @@ export class RestClient extends BaseRestClient {
|
|
|
478
478
|
* Portfolio Margin Calculator When inputting a simulated position portfolio, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included.
|
|
479
479
|
*
|
|
480
480
|
* @param params Parameters for portfolio margin calculator
|
|
481
|
-
* @returns Promise<
|
|
481
|
+
* @returns Promise<PortfolioMarginCalculatorResp>
|
|
482
482
|
*/
|
|
483
483
|
portfolioMarginCalculate(params) {
|
|
484
484
|
return this.post('/unified/portfolio_calculator', { body: params });
|
|
@@ -496,7 +496,7 @@ export class RestClient extends BaseRestClient {
|
|
|
496
496
|
*
|
|
497
497
|
* The latter one occurs when one currency has multiple chains. Currency detail contains a chain field whatever the form is. To retrieve all chains of one currency, you can use all the details which have the name of the currency or name starting with <currency>_.
|
|
498
498
|
*
|
|
499
|
-
* @returns Promise<
|
|
499
|
+
* @returns Promise<GetSpotCurrenciesResp[]>
|
|
500
500
|
*/
|
|
501
501
|
getSpotCurrencies() {
|
|
502
502
|
return this.get('/spot/currencies');
|
|
@@ -505,7 +505,7 @@ export class RestClient extends BaseRestClient {
|
|
|
505
505
|
* Get details of a specific currency
|
|
506
506
|
*
|
|
507
507
|
* @param params Parameters for retrieving details of a specific currency
|
|
508
|
-
* @returns Promise<
|
|
508
|
+
* @returns Promise<GetSpotCurrenciesResp>
|
|
509
509
|
*/
|
|
510
510
|
getSpotCurrency(params) {
|
|
511
511
|
return this.get(`/spot/currencies/${params.currency}`);
|
|
@@ -513,7 +513,7 @@ export class RestClient extends BaseRestClient {
|
|
|
513
513
|
/**
|
|
514
514
|
* List all currency pairs supported
|
|
515
515
|
*
|
|
516
|
-
* @returns Promise<
|
|
516
|
+
* @returns Promise<CurrencyPair[]>
|
|
517
517
|
*/
|
|
518
518
|
getSpotCurrencyPairs() {
|
|
519
519
|
return this.get('/spot/currency_pairs');
|
|
@@ -522,7 +522,7 @@ export class RestClient extends BaseRestClient {
|
|
|
522
522
|
* Get details of a specific currency pair
|
|
523
523
|
*
|
|
524
524
|
* @param params Parameters for retrieving details of a specific currency pair
|
|
525
|
-
* @returns Promise<
|
|
525
|
+
* @returns Promise<CurrencyPair>
|
|
526
526
|
*/
|
|
527
527
|
getSpotCurrencyPair(params) {
|
|
528
528
|
return this.get(`/spot/currency_pairs/${params.currency_pair}`);
|
|
@@ -533,7 +533,7 @@ export class RestClient extends BaseRestClient {
|
|
|
533
533
|
* Return only related data if currency_pair is specified; otherwise return all of them.
|
|
534
534
|
*
|
|
535
535
|
* @param params Parameters for retrieving ticker information
|
|
536
|
-
* @returns Promise<
|
|
536
|
+
* @returns Promise<GetSpotTickerResp[]>
|
|
537
537
|
*/
|
|
538
538
|
getSpotTicker(params) {
|
|
539
539
|
return this.get('/spot/tickers', params);
|
|
@@ -544,7 +544,7 @@ export class RestClient extends BaseRestClient {
|
|
|
544
544
|
* Order book will be sorted by price from high to low on bids; low to high on asks.
|
|
545
545
|
*
|
|
546
546
|
* @param params Parameters for retrieving order book
|
|
547
|
-
* @returns Promise<
|
|
547
|
+
* @returns Promise<GetSpotOrderBookResp>
|
|
548
548
|
*/
|
|
549
549
|
getSpotOrderBook(params) {
|
|
550
550
|
return this.get('/spot/order_book', params);
|
|
@@ -556,7 +556,7 @@ export class RestClient extends BaseRestClient {
|
|
|
556
556
|
* Scrolling query using last_id is not recommended any more. If last_id is specified, time range query parameters will be ignored.
|
|
557
557
|
*
|
|
558
558
|
* @param params Parameters for retrieving market trades
|
|
559
|
-
* @returns Promise<
|
|
559
|
+
* @returns Promise<GetSpotTradesResp[]>
|
|
560
560
|
*/
|
|
561
561
|
getSpotTrades(params) {
|
|
562
562
|
return this.get('/spot/trades', params);
|
|
@@ -567,7 +567,7 @@ export class RestClient extends BaseRestClient {
|
|
|
567
567
|
* Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval.
|
|
568
568
|
*
|
|
569
569
|
* @param params Parameters for retrieving market Candles
|
|
570
|
-
* @returns Promise<
|
|
570
|
+
* @returns Promise<GetSpotCandlesResp>
|
|
571
571
|
*/
|
|
572
572
|
getSpotCandles(params) {
|
|
573
573
|
return this.get('/spot/Candles', params);
|
|
@@ -578,7 +578,7 @@ export class RestClient extends BaseRestClient {
|
|
|
578
578
|
* This API is deprecated in favour of new fee retrieving API /wallet/fee.
|
|
579
579
|
*
|
|
580
580
|
* @param params Parameters for querying user trading fee rates
|
|
581
|
-
* @returns Promise<
|
|
581
|
+
* @returns Promise<GetSpotFeeRatesResp>
|
|
582
582
|
*/
|
|
583
583
|
getSpotFeeRates(params) {
|
|
584
584
|
return this.getPrivate('/spot/fee', params);
|
|
@@ -595,7 +595,7 @@ export class RestClient extends BaseRestClient {
|
|
|
595
595
|
* List spot accounts
|
|
596
596
|
*
|
|
597
597
|
* @param params Parameters for listing spot accounts
|
|
598
|
-
* @returns Promise<
|
|
598
|
+
* @returns Promise<GetSpotAccountsResp[]>
|
|
599
599
|
*/
|
|
600
600
|
getSpotAccounts(params) {
|
|
601
601
|
return this.getPrivate('/spot/accounts', params);
|
|
@@ -606,7 +606,7 @@ export class RestClient extends BaseRestClient {
|
|
|
606
606
|
* Record time range cannot exceed 30 days.
|
|
607
607
|
*
|
|
608
608
|
* @param params Parameters for querying account book
|
|
609
|
-
* @returns Promise<
|
|
609
|
+
* @returns Promise<GetSpotAccountBookResp[]>
|
|
610
610
|
*/
|
|
611
611
|
getSpotAccountBook(params) {
|
|
612
612
|
return this.getPrivate('/spot/account_book', params);
|
|
@@ -620,7 +620,7 @@ export class RestClient extends BaseRestClient {
|
|
|
620
620
|
* - No mixture of spot orders and margin orders, i.e. account must be identical for all orders
|
|
621
621
|
*
|
|
622
622
|
* @param params Parameters for creating a batch of orders
|
|
623
|
-
* @returns Promise<
|
|
623
|
+
* @returns Promise<SubmitSpotBatchOrdersResp[]>
|
|
624
624
|
*/
|
|
625
625
|
submitSpotBatchOrders(params) {
|
|
626
626
|
return this.postPrivate('/spot/batch_orders', { body: params });
|
|
@@ -633,7 +633,7 @@ export class RestClient extends BaseRestClient {
|
|
|
633
633
|
* Spot, portfolio, and margin orders are returned by default. To list cross margin orders, account must be set to cross_margin.
|
|
634
634
|
*
|
|
635
635
|
* @param params Parameters for listing all open orders
|
|
636
|
-
* @returns Promise<
|
|
636
|
+
* @returns Promise<GetSpotOpenOrdersResp[]>
|
|
637
637
|
*/
|
|
638
638
|
getSpotOpenOrders(params) {
|
|
639
639
|
return this.getPrivate('/spot/open_orders', params);
|
|
@@ -644,7 +644,7 @@ export class RestClient extends BaseRestClient {
|
|
|
644
644
|
* Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998
|
|
645
645
|
*
|
|
646
646
|
* @param params Parameters for closing position when cross-currency is disabled
|
|
647
|
-
* @returns Promise<
|
|
647
|
+
* @returns Promise<Order>
|
|
648
648
|
*/
|
|
649
649
|
submitSpotClosePosCrossDisabled(params) {
|
|
650
650
|
return this.postPrivate('/spot/cross_liquidate_orders', { body: params });
|
|
@@ -655,7 +655,7 @@ export class RestClient extends BaseRestClient {
|
|
|
655
655
|
* You can place orders with spot, portfolio, margin or cross margin account through setting the account field. It defaults to spot, which means spot account is used to place orders. If the user is using unified account, it defaults to the unified account.
|
|
656
656
|
*
|
|
657
657
|
* @param params Parameters for creating an order
|
|
658
|
-
* @returns Promise<
|
|
658
|
+
* @returns Promise<Order>
|
|
659
659
|
*/
|
|
660
660
|
submitSpotOrder(params) {
|
|
661
661
|
return this.postPrivate('/spot/orders', { body: params });
|
|
@@ -666,7 +666,7 @@ export class RestClient extends BaseRestClient {
|
|
|
666
666
|
* Spot, portfolio and margin orders are returned by default. If cross margin orders are needed, account must be set to cross_margin.
|
|
667
667
|
*
|
|
668
668
|
* @param params Parameters for listing orders
|
|
669
|
-
* @returns Promise<
|
|
669
|
+
* @returns Promise<Order[]>
|
|
670
670
|
*/
|
|
671
671
|
getSpotOrders(params) {
|
|
672
672
|
return this.getPrivate('/spot/orders', params);
|
|
@@ -678,7 +678,7 @@ export class RestClient extends BaseRestClient {
|
|
|
678
678
|
* You can set account to cancel only orders within the specified account.
|
|
679
679
|
*
|
|
680
680
|
* @param params Parameters for cancelling all open orders in specified currency pair
|
|
681
|
-
* @returns Promise<
|
|
681
|
+
* @returns Promise<Order[]>
|
|
682
682
|
*/
|
|
683
683
|
cancelSpotOpenOrders(params) {
|
|
684
684
|
return this.deletePrivate('/spot/orders', { query: params });
|
|
@@ -689,7 +689,7 @@ export class RestClient extends BaseRestClient {
|
|
|
689
689
|
* Multiple currency pairs can be specified, but maximum 20 orders are allowed per request.
|
|
690
690
|
*
|
|
691
691
|
* @param params Parameters for cancelling a batch of orders
|
|
692
|
-
* @returns Promise<
|
|
692
|
+
* @returns Promise<DeleteSpotBatchOrdersResp[]>
|
|
693
693
|
*/
|
|
694
694
|
batchCancelSpotOrders(params) {
|
|
695
695
|
return this.postPrivate('/spot/cancel_batch_orders', { body: params });
|
|
@@ -700,7 +700,7 @@ export class RestClient extends BaseRestClient {
|
|
|
700
700
|
* Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin.
|
|
701
701
|
*
|
|
702
702
|
* @param params Parameters for getting a single order
|
|
703
|
-
* @returns Promise<
|
|
703
|
+
* @returns Promise<Order>
|
|
704
704
|
*/
|
|
705
705
|
getSpotOrder(params) {
|
|
706
706
|
const { order_id, ...query } = params;
|
|
@@ -714,7 +714,7 @@ export class RestClient extends BaseRestClient {
|
|
|
714
714
|
* Currently, only supports modification of price or amount fields.
|
|
715
715
|
*
|
|
716
716
|
* @param params Parameters for amending an order
|
|
717
|
-
* @returns Promise<
|
|
717
|
+
* @returns Promise<Order>
|
|
718
718
|
*/
|
|
719
719
|
updateSpotOrder(params) {
|
|
720
720
|
const { order_id, currency_pair, account, ...body } = params;
|
|
@@ -733,7 +733,7 @@ export class RestClient extends BaseRestClient {
|
|
|
733
733
|
* Spot, portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin.
|
|
734
734
|
*
|
|
735
735
|
* @param params Parameters for cancelling a single order
|
|
736
|
-
* @returns Promise<
|
|
736
|
+
* @returns Promise<Order>
|
|
737
737
|
*/
|
|
738
738
|
cancelSpotOrder(params) {
|
|
739
739
|
const { order_id, ...query } = params;
|
|
@@ -749,7 +749,7 @@ export class RestClient extends BaseRestClient {
|
|
|
749
749
|
* You can also set from and/or to to query by time range. If you don't specify from and/or to parameters, only the last 7 days of data will be returned. The range of from and to is not allowed to exceed 30 days. Time range parameters are handled as order finish time.
|
|
750
750
|
*
|
|
751
751
|
* @param params Parameters for listing personal trading history
|
|
752
|
-
* @returns Promise<
|
|
752
|
+
* @returns Promise<GetSpotTradingHistoryResp[]>
|
|
753
753
|
*/
|
|
754
754
|
getSpotTradingHistory(params) {
|
|
755
755
|
return this.getPrivate('/spot/my_trades', params);
|
|
@@ -757,9 +757,9 @@ export class RestClient extends BaseRestClient {
|
|
|
757
757
|
/**
|
|
758
758
|
* Get server current time
|
|
759
759
|
*
|
|
760
|
-
* @returns Promise<
|
|
760
|
+
* @returns Promise<{
|
|
761
761
|
* server_time: number;
|
|
762
|
-
* }
|
|
762
|
+
* }>
|
|
763
763
|
*/
|
|
764
764
|
getServerTime() {
|
|
765
765
|
return this.get('/spot/time');
|
|
@@ -770,9 +770,9 @@ export class RestClient extends BaseRestClient {
|
|
|
770
770
|
* When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown.
|
|
771
771
|
*
|
|
772
772
|
* @param params Parameters for setting countdown cancel orders
|
|
773
|
-
* @returns Promise<
|
|
773
|
+
* @returns Promise<{
|
|
774
774
|
* triggerTime: number;
|
|
775
|
-
* }
|
|
775
|
+
* }>
|
|
776
776
|
*/
|
|
777
777
|
submitSpotCountdownOrders(params) {
|
|
778
778
|
return this.postPrivate('/spot/countdown_cancel_all', { body: params });
|
|
@@ -783,7 +783,7 @@ export class RestClient extends BaseRestClient {
|
|
|
783
783
|
* Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the account parameter must be specified as cross_margin. For portfolio margin accounts, the account parameter can only be specified as cross_margin. Currently, only modifications to price or quantity (choose one) are supported.
|
|
784
784
|
*
|
|
785
785
|
* @param params Parameters for batch modification of orders
|
|
786
|
-
* @returns Promise<
|
|
786
|
+
* @returns Promise<Order[]>
|
|
787
787
|
*/
|
|
788
788
|
batchUpdateSpotOrders(params) {
|
|
789
789
|
return this.postPrivate('/spot/amend_batch_orders', { body: params });
|
|
@@ -792,9 +792,9 @@ export class RestClient extends BaseRestClient {
|
|
|
792
792
|
* Create a price-triggered order
|
|
793
793
|
*
|
|
794
794
|
* @param params Parameters for creating a price-triggered order
|
|
795
|
-
* @returns Promise<
|
|
795
|
+
* @returns Promise<{
|
|
796
796
|
* id: number;
|
|
797
|
-
* }
|
|
797
|
+
* }>
|
|
798
798
|
*/
|
|
799
799
|
submitSpotPriceTriggerOrder(params) {
|
|
800
800
|
return this.postPrivate('/spot/price_orders', { body: params });
|
|
@@ -803,7 +803,7 @@ export class RestClient extends BaseRestClient {
|
|
|
803
803
|
* Retrieve running auto order list
|
|
804
804
|
*
|
|
805
805
|
* @param params Parameters for retrieving running auto order list
|
|
806
|
-
* @returns Promise<
|
|
806
|
+
* @returns Promise<SpotPriceTriggeredOrder[]>
|
|
807
807
|
*/
|
|
808
808
|
getSpotAutoOrders(params) {
|
|
809
809
|
return this.getPrivate('/spot/price_orders', params);
|
|
@@ -812,7 +812,7 @@ export class RestClient extends BaseRestClient {
|
|
|
812
812
|
* Cancel all open orders
|
|
813
813
|
*
|
|
814
814
|
* @param params Parameters for cancelling all open orders
|
|
815
|
-
* @returns Promise<
|
|
815
|
+
* @returns Promise<SpotPriceTriggeredOrder[]>
|
|
816
816
|
*/
|
|
817
817
|
cancelAllOpenSpotOrders(params) {
|
|
818
818
|
return this.deletePrivate('/spot/price_orders', { query: params });
|
|
@@ -821,7 +821,7 @@ export class RestClient extends BaseRestClient {
|
|
|
821
821
|
* Get a price-triggered order
|
|
822
822
|
*
|
|
823
823
|
* @param params Parameters for getting a price-triggered order
|
|
824
|
-
* @returns Promise<
|
|
824
|
+
* @returns Promise<SpotPriceTriggeredOrder>
|
|
825
825
|
*/
|
|
826
826
|
getPriceTriggeredOrder(params) {
|
|
827
827
|
return this.getPrivate(`/spot/price_orders/${params.order_id}`);
|
|
@@ -830,7 +830,7 @@ export class RestClient extends BaseRestClient {
|
|
|
830
830
|
* Cancel a price-triggered order
|
|
831
831
|
*
|
|
832
832
|
* @param params Parameters for cancelling a price-triggered order
|
|
833
|
-
* @returns Promise<
|
|
833
|
+
* @returns Promise<SpotPriceTriggeredOrder>
|
|
834
834
|
*/
|
|
835
835
|
cancelSpotTriggeredOrder(params) {
|
|
836
836
|
return this.deletePrivate(`/spot/price_orders/${params.order_id}`);
|
|
@@ -843,7 +843,7 @@ export class RestClient extends BaseRestClient {
|
|
|
843
843
|
* Margin account list
|
|
844
844
|
*
|
|
845
845
|
* @param params Parameters for listing margin accounts
|
|
846
|
-
* @returns Promise<
|
|
846
|
+
* @returns Promise<GetMarginAccountsResp[]>
|
|
847
847
|
*/
|
|
848
848
|
getMarginAccounts(params) {
|
|
849
849
|
return this.getPrivate('/margin/accounts', params);
|
|
@@ -854,7 +854,7 @@ export class RestClient extends BaseRestClient {
|
|
|
854
854
|
* Only transferals from and to margin account are provided for now. Time range allows 30 days at most.
|
|
855
855
|
*
|
|
856
856
|
* @param params Parameters for listing margin account balance change history
|
|
857
|
-
* @returns Promise<
|
|
857
|
+
* @returns Promise<GetMarginBalanceHistoryResp[]>
|
|
858
858
|
*/
|
|
859
859
|
getMarginBalanceHistory(params) {
|
|
860
860
|
return this.getPrivate('/margin/account_book', params);
|
|
@@ -863,13 +863,13 @@ export class RestClient extends BaseRestClient {
|
|
|
863
863
|
* Funding account list
|
|
864
864
|
*
|
|
865
865
|
* @param params Parameters for listing funding accounts
|
|
866
|
-
* @returns Promise<
|
|
866
|
+
* @returns Promise<{
|
|
867
867
|
* currency: string;
|
|
868
868
|
* available: string;
|
|
869
869
|
* locked: string;
|
|
870
870
|
* lent: string;
|
|
871
871
|
* total_lent: string;
|
|
872
|
-
* }[]
|
|
872
|
+
* }[]>
|
|
873
873
|
*/
|
|
874
874
|
getFundingAccounts(params) {
|
|
875
875
|
return this.getPrivate('/margin/funding_accounts', params);
|
|
@@ -878,7 +878,7 @@ export class RestClient extends BaseRestClient {
|
|
|
878
878
|
* Update user's auto repayment setting
|
|
879
879
|
*
|
|
880
880
|
* @param params Parameters for updating auto repayment setting
|
|
881
|
-
* @returns Promise<
|
|
881
|
+
* @returns Promise<{ status: 'on' | 'off' }>
|
|
882
882
|
*/
|
|
883
883
|
updateAutoRepaymentSetting(params) {
|
|
884
884
|
return this.postPrivate('/margin/auto_repay', { query: params });
|
|
@@ -886,7 +886,7 @@ export class RestClient extends BaseRestClient {
|
|
|
886
886
|
/**
|
|
887
887
|
* Retrieve user auto repayment setting
|
|
888
888
|
*
|
|
889
|
-
* @returns Promise<
|
|
889
|
+
* @returns Promise<{ status: 'on' | 'off' }>
|
|
890
890
|
*/
|
|
891
891
|
getAutoRepaymentSetting() {
|
|
892
892
|
return this.getPrivate('/margin/auto_repay');
|
|
@@ -895,11 +895,11 @@ export class RestClient extends BaseRestClient {
|
|
|
895
895
|
* Get the max transferable amount for a specific margin currency
|
|
896
896
|
*
|
|
897
897
|
* @param params Parameters for retrieving the max transferable amount
|
|
898
|
-
* @returns Promise<
|
|
898
|
+
* @returns Promise<{
|
|
899
899
|
* currency: string;
|
|
900
900
|
* currency_pair?: string;
|
|
901
901
|
* amount: string;
|
|
902
|
-
* }
|
|
902
|
+
* }>
|
|
903
903
|
*/
|
|
904
904
|
getMarginTransferableAmount(params) {
|
|
905
905
|
return this.getPrivate('/margin/transferable', params);
|
|
@@ -907,7 +907,7 @@ export class RestClient extends BaseRestClient {
|
|
|
907
907
|
/**
|
|
908
908
|
* Currencies supported by cross margin
|
|
909
909
|
*
|
|
910
|
-
* @returns Promise<
|
|
910
|
+
* @returns Promise<GetCrossMarginCurrenciesResp[]>
|
|
911
911
|
*/
|
|
912
912
|
getCrossMarginCurrencies() {
|
|
913
913
|
return this.get('/margin/cross/currencies');
|
|
@@ -916,7 +916,7 @@ export class RestClient extends BaseRestClient {
|
|
|
916
916
|
* Retrieve detail of one single currency supported by cross margin
|
|
917
917
|
*
|
|
918
918
|
* @param params Parameters containing the currency name
|
|
919
|
-
* @returns Promise<
|
|
919
|
+
* @returns Promise<GetCrossMarginCurrenciesResp>
|
|
920
920
|
*/
|
|
921
921
|
getCrossMarginCurrency(params) {
|
|
922
922
|
return this.get(`/margin/cross/currencies/${params.currency}`);
|
|
@@ -924,7 +924,7 @@ export class RestClient extends BaseRestClient {
|
|
|
924
924
|
/**
|
|
925
925
|
* Retrieve cross margin account
|
|
926
926
|
*
|
|
927
|
-
* @returns Promise<
|
|
927
|
+
* @returns Promise<GetCrossMarginAccountResp>
|
|
928
928
|
*/
|
|
929
929
|
getCrossMarginAccount() {
|
|
930
930
|
return this.getPrivate('/margin/cross/accounts');
|
|
@@ -935,7 +935,7 @@ export class RestClient extends BaseRestClient {
|
|
|
935
935
|
* Record time range cannot exceed 30 days.
|
|
936
936
|
*
|
|
937
937
|
* @param params Parameters for retrieving cross margin account change history
|
|
938
|
-
* @returns Promise<
|
|
938
|
+
* @returns Promise<GetCrossMarginAccountHistoryResp[]>
|
|
939
939
|
*/
|
|
940
940
|
getCrossMarginAccountHistory(params) {
|
|
941
941
|
return this.getPrivate('/margin/cross/account_book', params);
|
|
@@ -946,7 +946,7 @@ export class RestClient extends BaseRestClient {
|
|
|
946
946
|
* Borrow amount cannot be less than currency minimum borrow amount.
|
|
947
947
|
*
|
|
948
948
|
* @param params Parameters for creating a cross margin borrow loan
|
|
949
|
-
* @returns Promise<
|
|
949
|
+
* @returns Promise<SubmitCrossMarginBorrowLoanResp>
|
|
950
950
|
*/
|
|
951
951
|
submitCrossMarginBorrowLoan(params) {
|
|
952
952
|
return this.postPrivate('/margin/cross/loans', { body: params });
|
|
@@ -957,7 +957,7 @@ export class RestClient extends BaseRestClient {
|
|
|
957
957
|
* Sort by creation time in descending order by default. Set reverse=false to return ascending results.
|
|
958
958
|
*
|
|
959
959
|
* @param params Parameters for listing cross margin borrow history
|
|
960
|
-
* @returns Promise<
|
|
960
|
+
* @returns Promise<SubmitCrossMarginBorrowLoanResp[]>
|
|
961
961
|
*/
|
|
962
962
|
getCrossMarginBorrowHistory(params) {
|
|
963
963
|
return this.getPrivate('/margin/cross/loans', params);
|
|
@@ -966,7 +966,7 @@ export class RestClient extends BaseRestClient {
|
|
|
966
966
|
* Retrieve single borrow loan detail
|
|
967
967
|
*
|
|
968
968
|
* @param params Parameters containing the borrow loan ID
|
|
969
|
-
* @returns Promise<
|
|
969
|
+
* @returns Promise<SubmitCrossMarginBorrowLoanResp>
|
|
970
970
|
*/
|
|
971
971
|
getCrossMarginBorrowLoan(params) {
|
|
972
972
|
return this.getPrivate(`/margin/cross/loans/${params.loan_id}`);
|
|
@@ -977,7 +977,7 @@ export class RestClient extends BaseRestClient {
|
|
|
977
977
|
* When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred. When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first.
|
|
978
978
|
*
|
|
979
979
|
* @param params Parameters for cross margin repayments
|
|
980
|
-
* @returns Promise<
|
|
980
|
+
* @returns Promise<SubmitCrossMarginBorrowLoanResp[]>
|
|
981
981
|
*/
|
|
982
982
|
submitCrossMarginRepayment(params) {
|
|
983
983
|
return this.postPrivate('/margin/cross/repayments', { body: params });
|
|
@@ -988,7 +988,7 @@ export class RestClient extends BaseRestClient {
|
|
|
988
988
|
* Sort by creation time in descending order by default. Set reverse=false to return ascending results.
|
|
989
989
|
*
|
|
990
990
|
* @param params Parameters for retrieving cross margin repayments
|
|
991
|
-
* @returns Promise<
|
|
991
|
+
* @returns Promise<GetCrossMarginRepaymentsResp[]>
|
|
992
992
|
*/
|
|
993
993
|
getCrossMarginRepayments(params) {
|
|
994
994
|
return this.getPrivate('/margin/cross/repayments', params);
|
|
@@ -997,7 +997,7 @@ export class RestClient extends BaseRestClient {
|
|
|
997
997
|
* Interest records for the cross margin account
|
|
998
998
|
*
|
|
999
999
|
* @param params Parameters for retrieving interest records
|
|
1000
|
-
* @returns Promise<
|
|
1000
|
+
* @returns Promise<GetCrossMarginInterestRecordsResp[]>
|
|
1001
1001
|
*/
|
|
1002
1002
|
getCrossMarginInterestRecords(params) {
|
|
1003
1003
|
return this.getPrivate('/margin/cross/interest_records', params);
|
|
@@ -1006,10 +1006,10 @@ export class RestClient extends BaseRestClient {
|
|
|
1006
1006
|
* Get the max transferable amount for a specific cross margin currency
|
|
1007
1007
|
*
|
|
1008
1008
|
* @param params Parameters for retrieving the max transferable amount
|
|
1009
|
-
* @returns Promise<
|
|
1009
|
+
* @returns Promise<{
|
|
1010
1010
|
* currency: string;
|
|
1011
1011
|
* amount: string;
|
|
1012
|
-
* }
|
|
1012
|
+
* }>
|
|
1013
1013
|
*/
|
|
1014
1014
|
getCrossMarginTransferableAmount(params) {
|
|
1015
1015
|
return this.getPrivate('/margin/cross/transferable', params);
|
|
@@ -1020,7 +1020,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1020
1020
|
* Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
|
|
1021
1021
|
*
|
|
1022
1022
|
* @param params Parameters for retrieving estimated interest rates
|
|
1023
|
-
* @returns Promise<
|
|
1023
|
+
* @returns Promise<any>
|
|
1024
1024
|
*/
|
|
1025
1025
|
getEstimatedInterestRates(params) {
|
|
1026
1026
|
return this.getPrivate('/margin/cross/estimate_rate', params);
|
|
@@ -1029,10 +1029,10 @@ export class RestClient extends BaseRestClient {
|
|
|
1029
1029
|
* Get the max borrowable amount for a specific cross margin currency
|
|
1030
1030
|
*
|
|
1031
1031
|
* @param params Parameters for retrieving the max borrowable amount
|
|
1032
|
-
* @returns Promise<
|
|
1032
|
+
* @returns Promise<{
|
|
1033
1033
|
* currency: string;
|
|
1034
1034
|
* amount: string;
|
|
1035
|
-
* }
|
|
1035
|
+
* }>
|
|
1036
1036
|
*/
|
|
1037
1037
|
getCrossMarginBorrowableAmount(params) {
|
|
1038
1038
|
return this.getPrivate('/margin/cross/borrowable', params);
|
|
@@ -1044,7 +1044,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1044
1044
|
/**
|
|
1045
1045
|
* List lending markets
|
|
1046
1046
|
*
|
|
1047
|
-
* @returns Promise<
|
|
1047
|
+
* @returns Promise<GetLendingMarketsResp[]>
|
|
1048
1048
|
*/
|
|
1049
1049
|
getLendingMarkets() {
|
|
1050
1050
|
return this.get('/margin/uni/currency_pairs');
|
|
@@ -1053,12 +1053,12 @@ export class RestClient extends BaseRestClient {
|
|
|
1053
1053
|
* Get detail of lending market
|
|
1054
1054
|
*
|
|
1055
1055
|
* @param params Parameters containing the currency pair
|
|
1056
|
-
* @returns Promise<
|
|
1056
|
+
* @returns Promise<{
|
|
1057
1057
|
* currency_pair: string;
|
|
1058
1058
|
* base_min_borrow_amount: string;
|
|
1059
1059
|
* quote_min_borrow_amount: string;
|
|
1060
1060
|
* leverage: string;
|
|
1061
|
-
* }
|
|
1061
|
+
* }>
|
|
1062
1062
|
*/
|
|
1063
1063
|
getLendingMarket(params) {
|
|
1064
1064
|
return this.get(`/margin/uni/currency_pairs/${params.currency_pair}`);
|
|
@@ -1069,7 +1069,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1069
1069
|
* Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
|
|
1070
1070
|
*
|
|
1071
1071
|
* @param params Parameters for retrieving estimated interest rates
|
|
1072
|
-
* @returns Promise<
|
|
1072
|
+
* @returns Promise<any>
|
|
1073
1073
|
*/
|
|
1074
1074
|
getEstimatedInterestRate(params) {
|
|
1075
1075
|
return this.getPrivate('/margin/uni/estimate_rate', params);
|
|
@@ -1087,7 +1087,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1087
1087
|
* List loans
|
|
1088
1088
|
*
|
|
1089
1089
|
* @param params Parameters for listing loans
|
|
1090
|
-
* @returns Promise<
|
|
1090
|
+
* @returns Promise<GetMarginUNILoansResp[]>
|
|
1091
1091
|
*/
|
|
1092
1092
|
getMarginUNILoans(params) {
|
|
1093
1093
|
return this.getPrivate('/margin/uni/loans', params);
|
|
@@ -1096,7 +1096,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1096
1096
|
* Get loan records
|
|
1097
1097
|
*
|
|
1098
1098
|
* @param params Parameters for retrieving loan records
|
|
1099
|
-
* @returns Promise<
|
|
1099
|
+
* @returns Promise<GetMarginUNILoanRecordsResp[]>
|
|
1100
1100
|
*/
|
|
1101
1101
|
getMarginUNILoanRecords(params) {
|
|
1102
1102
|
return this.getPrivate('/margin/uni/loan_records', params);
|
|
@@ -1105,7 +1105,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1105
1105
|
* List interest records
|
|
1106
1106
|
*
|
|
1107
1107
|
* @param params Parameters for listing interest records
|
|
1108
|
-
* @returns Promise<
|
|
1108
|
+
* @returns Promise<GetMarginUNIInterestRecordsResp[]>
|
|
1109
1109
|
*/
|
|
1110
1110
|
getMarginUNIInterestRecords(params) {
|
|
1111
1111
|
return this.getPrivate('/margin/uni/interest_records', params);
|
|
@@ -1114,7 +1114,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1114
1114
|
* Get maximum borrowable
|
|
1115
1115
|
*
|
|
1116
1116
|
* @param params Parameters for retrieving the maximum borrowable amount
|
|
1117
|
-
* @returns Promise<
|
|
1117
|
+
* @returns Promise<GetMarginUNIMaxBorrowResp>
|
|
1118
1118
|
*/
|
|
1119
1119
|
getMarginUNIMaxBorrow(params) {
|
|
1120
1120
|
return this.getPrivate('/margin/uni/borrowable', params);
|
|
@@ -1127,7 +1127,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1127
1127
|
* List All Supported Currency Pairs In Flash Swap
|
|
1128
1128
|
*
|
|
1129
1129
|
* @param params Parameters for retrieving data of the specified currency
|
|
1130
|
-
* @returns Promise<
|
|
1130
|
+
* @returns Promise<GetFlashSwapCurrencyPairsResp[]>
|
|
1131
1131
|
*/
|
|
1132
1132
|
getFlashSwapCurrencyPairs(params) {
|
|
1133
1133
|
return this.get('/flash_swap/currency_pairs', params);
|
|
@@ -1138,7 +1138,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1138
1138
|
* Initiate a flash swap preview in advance because order creation requires a preview result.
|
|
1139
1139
|
*
|
|
1140
1140
|
* @param params Parameters for creating a flash swap order
|
|
1141
|
-
* @returns Promise<
|
|
1141
|
+
* @returns Promise<SubmitFlashSwapOrderResp>
|
|
1142
1142
|
*/
|
|
1143
1143
|
submitFlashSwapOrder(params) {
|
|
1144
1144
|
return this.postPrivate('/flash_swap/orders', { body: params });
|
|
@@ -1147,7 +1147,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1147
1147
|
* List all flash swap orders
|
|
1148
1148
|
*
|
|
1149
1149
|
* @param params Parameters for listing flash swap orders
|
|
1150
|
-
* @returns Promise<
|
|
1150
|
+
* @returns Promise<GetFlashSwapOrdersResp[]>
|
|
1151
1151
|
*/
|
|
1152
1152
|
getFlashSwapOrders(params) {
|
|
1153
1153
|
return this.getPrivate('/flash_swap/orders', params);
|
|
@@ -1156,7 +1156,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1156
1156
|
* Get a single flash swap order's detail
|
|
1157
1157
|
*
|
|
1158
1158
|
* @param params Parameters containing the flash swap order ID
|
|
1159
|
-
* @returns Promise<
|
|
1159
|
+
* @returns Promise<GetFlashSwapOrderResp>
|
|
1160
1160
|
*/
|
|
1161
1161
|
getFlashSwapOrder(params) {
|
|
1162
1162
|
return this.getPrivate(`/flash_swap/orders/${params.order_id}`);
|
|
@@ -1165,7 +1165,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1165
1165
|
* Initiate a flash swap order preview
|
|
1166
1166
|
*
|
|
1167
1167
|
* @param params Parameters for initiating a flash swap order preview
|
|
1168
|
-
* @returns Promise<
|
|
1168
|
+
* @returns Promise<SubmitFlashSwapOrderPreviewResp>
|
|
1169
1169
|
*/
|
|
1170
1170
|
submitFlashSwapOrderPreview(params) {
|
|
1171
1171
|
return this.postPrivate('/flash_swap/orders/preview', { body: params });
|
|
@@ -1178,7 +1178,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1178
1178
|
* List all futures contracts
|
|
1179
1179
|
*
|
|
1180
1180
|
* @param params Parameters for listing futures contracts
|
|
1181
|
-
* @returns Promise<
|
|
1181
|
+
* @returns Promise<Contract[]>
|
|
1182
1182
|
*/
|
|
1183
1183
|
getFuturesContracts(params) {
|
|
1184
1184
|
const { settle, ...query } = params;
|
|
@@ -1188,7 +1188,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1188
1188
|
* Get a single contract
|
|
1189
1189
|
*
|
|
1190
1190
|
* @param params Parameters for retrieving a single contract
|
|
1191
|
-
* @returns Promise<
|
|
1191
|
+
* @returns Promise<Contract>
|
|
1192
1192
|
*/
|
|
1193
1193
|
getFuturesContract(params) {
|
|
1194
1194
|
return this.get(`/futures/${params.settle}/contracts/${params.contract}`);
|
|
@@ -1199,7 +1199,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1199
1199
|
* Bids will be sorted by price from high to low, while asks sorted reversely.
|
|
1200
1200
|
*
|
|
1201
1201
|
* @param params Parameters for retrieving the futures order book
|
|
1202
|
-
* @returns Promise<
|
|
1202
|
+
* @returns Promise<GetFuturesOrderBookResp>
|
|
1203
1203
|
*/
|
|
1204
1204
|
getFuturesOrderBook(params) {
|
|
1205
1205
|
const { settle, ...query } = params;
|
|
@@ -1209,7 +1209,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1209
1209
|
* Futures trading history
|
|
1210
1210
|
*
|
|
1211
1211
|
* @param params Parameters for retrieving futures trading history
|
|
1212
|
-
* @returns Promise<
|
|
1212
|
+
* @returns Promise<GetFuturesTradesResp[]>
|
|
1213
1213
|
*/
|
|
1214
1214
|
getFuturesTrades(params) {
|
|
1215
1215
|
const { settle, ...query } = params;
|
|
@@ -1223,7 +1223,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1223
1223
|
* Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval.
|
|
1224
1224
|
*
|
|
1225
1225
|
* @param params Parameters for retrieving futures Candles
|
|
1226
|
-
* @returns Promise<
|
|
1226
|
+
* @returns Promise<GetFuturesCandlesResp[]>
|
|
1227
1227
|
*/
|
|
1228
1228
|
getFuturesCandles(params) {
|
|
1229
1229
|
const { settle, ...query } = params;
|
|
@@ -1235,7 +1235,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1235
1235
|
* Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval.
|
|
1236
1236
|
*
|
|
1237
1237
|
* @param params Parameters for retrieving premium index K-Line
|
|
1238
|
-
* @returns Promise<
|
|
1238
|
+
* @returns Promise<GetPremiumIndexKLineResp[]>
|
|
1239
1239
|
*/
|
|
1240
1240
|
getPremiumIndexKLines(params) {
|
|
1241
1241
|
const { settle, ...query } = params;
|
|
@@ -1245,7 +1245,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1245
1245
|
* List futures tickers
|
|
1246
1246
|
*
|
|
1247
1247
|
* @param params Parameters for listing futures tickers
|
|
1248
|
-
* @returns Promise<
|
|
1248
|
+
* @returns Promise<GetFuturesTickersResp[]>
|
|
1249
1249
|
*/
|
|
1250
1250
|
getFuturesTickers(params) {
|
|
1251
1251
|
const { settle, ...query } = params;
|
|
@@ -1255,10 +1255,10 @@ export class RestClient extends BaseRestClient {
|
|
|
1255
1255
|
* Funding rate history
|
|
1256
1256
|
*
|
|
1257
1257
|
* @param params Parameters for retrieving funding rate history
|
|
1258
|
-
* @returns Promise<
|
|
1258
|
+
* @returns Promise<{
|
|
1259
1259
|
* t: number;
|
|
1260
1260
|
* r: string;
|
|
1261
|
-
* }[]
|
|
1261
|
+
* }[]>
|
|
1262
1262
|
*/
|
|
1263
1263
|
getFundingRates(params) {
|
|
1264
1264
|
const { settle, ...query } = params;
|
|
@@ -1268,10 +1268,10 @@ export class RestClient extends BaseRestClient {
|
|
|
1268
1268
|
* Futures insurance balance history
|
|
1269
1269
|
*
|
|
1270
1270
|
* @param params Parameters for retrieving futures insurance balance history
|
|
1271
|
-
* @returns Promise<
|
|
1271
|
+
* @returns Promise<{
|
|
1272
1272
|
* t: number;
|
|
1273
1273
|
* b: string;
|
|
1274
|
-
* }[]
|
|
1274
|
+
* }[]>
|
|
1275
1275
|
*/
|
|
1276
1276
|
getFuturesInsuranceBalanceHistory(params) {
|
|
1277
1277
|
const { settle, ...query } = params;
|
|
@@ -1281,7 +1281,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1281
1281
|
* Futures stats
|
|
1282
1282
|
*
|
|
1283
1283
|
* @param params Parameters for retrieving futures stats
|
|
1284
|
-
* @returns Promise<
|
|
1284
|
+
* @returns Promise<GetFuturesStatsResp[]>
|
|
1285
1285
|
*/
|
|
1286
1286
|
getFuturesStats(params) {
|
|
1287
1287
|
const { settle, ...query } = params;
|
|
@@ -1291,7 +1291,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1291
1291
|
* Get index constituents
|
|
1292
1292
|
*
|
|
1293
1293
|
* @param params Parameters for retrieving index constituents
|
|
1294
|
-
* @returns Promise<
|
|
1294
|
+
* @returns Promise<GetIndexConstituentsResp>
|
|
1295
1295
|
*/
|
|
1296
1296
|
getIndexConstituents(params) {
|
|
1297
1297
|
return this.get(`/futures/${params.settle}/index_constituents/${params.index}`);
|
|
@@ -1302,7 +1302,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1302
1302
|
* Interval between from and to cannot exceed 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail.
|
|
1303
1303
|
*
|
|
1304
1304
|
* @param params Parameters for retrieving liquidation history
|
|
1305
|
-
* @returns Promise<
|
|
1305
|
+
* @returns Promise<GetLiquidationHistoryResp[]>
|
|
1306
1306
|
*/
|
|
1307
1307
|
getLiquidationHistory(params) {
|
|
1308
1308
|
const { settle, ...query } = params;
|
|
@@ -1316,7 +1316,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1316
1316
|
* This only takes effect when the 'contract' parameter is empty.
|
|
1317
1317
|
*
|
|
1318
1318
|
* @param params Parameters for listing risk limit tiers
|
|
1319
|
-
* @returns Promise<
|
|
1319
|
+
* @returns Promise<GetRiskLimitTiersResp[]>
|
|
1320
1320
|
*/
|
|
1321
1321
|
getRiskLimitTiers(params) {
|
|
1322
1322
|
const { settle, ...query } = params;
|
|
@@ -1326,7 +1326,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1326
1326
|
* Query futures account
|
|
1327
1327
|
*
|
|
1328
1328
|
* @param params Parameters for querying futures account
|
|
1329
|
-
* @returns Promise<
|
|
1329
|
+
* @returns Promise<GetFuturesAccountResp>
|
|
1330
1330
|
*/
|
|
1331
1331
|
getFuturesAccount(params) {
|
|
1332
1332
|
return this.getPrivate(`/futures/${params.settle}/accounts`);
|
|
@@ -1337,7 +1337,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1337
1337
|
* If the contract field is provided, it can only filter records that include this field after 2023-10-30.
|
|
1338
1338
|
*
|
|
1339
1339
|
* @param params Parameters for querying account book
|
|
1340
|
-
* @returns Promise<
|
|
1340
|
+
* @returns Promise<GetFuturesAccountBookResp[]>
|
|
1341
1341
|
*/
|
|
1342
1342
|
getFuturesAccountBook(params) {
|
|
1343
1343
|
const { settle, ...query } = params;
|
|
@@ -1347,7 +1347,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1347
1347
|
* List all positions of a user
|
|
1348
1348
|
*
|
|
1349
1349
|
* @param params Parameters for listing all positions of a user
|
|
1350
|
-
* @returns Promise<
|
|
1350
|
+
* @returns Promise<Position[]>
|
|
1351
1351
|
*/
|
|
1352
1352
|
getFuturesPositions(params) {
|
|
1353
1353
|
const { settle, ...query } = params;
|
|
@@ -1357,7 +1357,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1357
1357
|
* Get single position
|
|
1358
1358
|
*
|
|
1359
1359
|
* @param params Parameters for retrieving a single position
|
|
1360
|
-
* @returns Promise<
|
|
1360
|
+
* @returns Promise<Position>
|
|
1361
1361
|
*/
|
|
1362
1362
|
getFuturesPosition(params) {
|
|
1363
1363
|
return this.getPrivate(`/futures/${params.settle}/positions/${params.contract}`);
|
|
@@ -1366,7 +1366,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1366
1366
|
* Update position margin
|
|
1367
1367
|
*
|
|
1368
1368
|
* @param params Parameters for updating position margin
|
|
1369
|
-
* @returns Promise<
|
|
1369
|
+
* @returns Promise<Position>
|
|
1370
1370
|
*/
|
|
1371
1371
|
updateFuturesMargin(params) {
|
|
1372
1372
|
const { settle, contract, ...query } = params;
|
|
@@ -1378,7 +1378,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1378
1378
|
* Update position leverage
|
|
1379
1379
|
*
|
|
1380
1380
|
* @param params Parameters for updating position leverage
|
|
1381
|
-
* @returns Promise<
|
|
1381
|
+
* @returns Promise<Position>
|
|
1382
1382
|
*/
|
|
1383
1383
|
updateFuturesLeverage(params) {
|
|
1384
1384
|
const { settle, contract, ...query } = params;
|
|
@@ -1388,7 +1388,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1388
1388
|
* Update position risk limit
|
|
1389
1389
|
*
|
|
1390
1390
|
* @param params Parameters for updating position risk limit
|
|
1391
|
-
* @returns Promise<
|
|
1391
|
+
* @returns Promise<Position>
|
|
1392
1392
|
*/
|
|
1393
1393
|
updatePositionRiskLimit(params) {
|
|
1394
1394
|
const { settle, contract, ...query } = params;
|
|
@@ -1400,7 +1400,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1400
1400
|
* Before setting dual mode, make sure all positions are closed and no orders are open.
|
|
1401
1401
|
*
|
|
1402
1402
|
* @param params Parameters for enabling or disabling dual mode
|
|
1403
|
-
* @returns Promise<
|
|
1403
|
+
* @returns Promise<ToggleFuturesDualModeResp>
|
|
1404
1404
|
*/
|
|
1405
1405
|
updateFuturesDualMode(params) {
|
|
1406
1406
|
const { settle, ...query } = params;
|
|
@@ -1412,7 +1412,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1412
1412
|
* Retrieve position detail in dual mode
|
|
1413
1413
|
*
|
|
1414
1414
|
* @param params Parameters for retrieving position detail in dual mode
|
|
1415
|
-
* @returns Promise<
|
|
1415
|
+
* @returns Promise<Position[]>
|
|
1416
1416
|
*/
|
|
1417
1417
|
getDualModePosition(params) {
|
|
1418
1418
|
return this.getPrivate(`/futures/${params.settle}/dual_comp/positions/${params.contract}`);
|
|
@@ -1421,7 +1421,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1421
1421
|
* Update position margin in dual mode
|
|
1422
1422
|
*
|
|
1423
1423
|
* @param params Parameters for updating position margin in dual mode
|
|
1424
|
-
* @returns Promise<
|
|
1424
|
+
* @returns Promise<Position[]>
|
|
1425
1425
|
*/
|
|
1426
1426
|
updateDualModePositionMargin(params) {
|
|
1427
1427
|
const { settle, contract, ...query } = params;
|
|
@@ -1431,7 +1431,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1431
1431
|
* Update position leverage in dual mode
|
|
1432
1432
|
*
|
|
1433
1433
|
* @param params Parameters for updating position leverage in dual mode
|
|
1434
|
-
* @returns Promise<
|
|
1434
|
+
* @returns Promise<Position[]>
|
|
1435
1435
|
*/
|
|
1436
1436
|
updateDualModePositionLeverage(params) {
|
|
1437
1437
|
const { settle, contract, ...query } = params;
|
|
@@ -1441,7 +1441,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1441
1441
|
* Update position risk limit in dual mode
|
|
1442
1442
|
*
|
|
1443
1443
|
* @param params Parameters for updating position risk limit in dual mode
|
|
1444
|
-
* @returns Promise<
|
|
1444
|
+
* @returns Promise<Position[]>
|
|
1445
1445
|
*/
|
|
1446
1446
|
updateDualModePositionRiskLimit(params) {
|
|
1447
1447
|
const { settle, contract, ...query } = params;
|
|
@@ -1458,7 +1458,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1458
1458
|
* Set stp_act to decide the strategy of self-trade prevention. For detailed usage, refer to the stp_act parameter in the request body.
|
|
1459
1459
|
*
|
|
1460
1460
|
* @param params Parameters for creating a futures order
|
|
1461
|
-
* @returns Promise<
|
|
1461
|
+
* @returns Promise<SubmitFuturesOrderReq>
|
|
1462
1462
|
*/
|
|
1463
1463
|
submitFuturesOrder(params) {
|
|
1464
1464
|
const { settle, ...body } = params;
|
|
@@ -1471,7 +1471,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1471
1471
|
* Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use GET /futures/{settle}/orders_timerange.
|
|
1472
1472
|
*
|
|
1473
1473
|
* @param params Parameters for listing futures orders
|
|
1474
|
-
* @returns Promise<
|
|
1474
|
+
* @returns Promise<FuturesOrder[]>
|
|
1475
1475
|
*/
|
|
1476
1476
|
getFuturesOrders(params) {
|
|
1477
1477
|
const { settle, ...query } = params;
|
|
@@ -1483,7 +1483,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1483
1483
|
* Zero-filled order cannot be retrieved 10 minutes after order cancellation.
|
|
1484
1484
|
*
|
|
1485
1485
|
* @param params Parameters for cancelling all open orders matched
|
|
1486
|
-
* @returns Promise<
|
|
1486
|
+
* @returns Promise<FuturesOrder[]>
|
|
1487
1487
|
*/
|
|
1488
1488
|
cancelAllFuturesOrders(params) {
|
|
1489
1489
|
const { settle, ...query } = params;
|
|
@@ -1495,7 +1495,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1495
1495
|
* List Futures Orders By Time Range
|
|
1496
1496
|
*
|
|
1497
1497
|
* @param params Parameters for listing futures orders by time range
|
|
1498
|
-
* @returns Promise<
|
|
1498
|
+
* @returns Promise<FuturesOrder[]>
|
|
1499
1499
|
*/
|
|
1500
1500
|
getFuturesOrdersByTimeRange(params) {
|
|
1501
1501
|
const { settle, ...query } = params;
|
|
@@ -1513,7 +1513,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1513
1513
|
* In the rate limiting, each order is counted individually.
|
|
1514
1514
|
*
|
|
1515
1515
|
* @param params Parameters for creating a batch of futures orders
|
|
1516
|
-
* @returns Promise<
|
|
1516
|
+
* @returns Promise<FuturesOrder[]>
|
|
1517
1517
|
*/
|
|
1518
1518
|
submitFuturesBatchOrders(params) {
|
|
1519
1519
|
const { settle, orders } = params;
|
|
@@ -1528,7 +1528,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1528
1528
|
* Historical orders, by default, only data within the past 6 months is supported.
|
|
1529
1529
|
*
|
|
1530
1530
|
* @param params Parameters for retrieving a single order
|
|
1531
|
-
* @returns Promise<
|
|
1531
|
+
* @returns Promise<FuturesOrder>
|
|
1532
1532
|
*/
|
|
1533
1533
|
getFuturesOrder(params) {
|
|
1534
1534
|
return this.getPrivate(`/futures/${params.settle}/orders/${params.order_id}`);
|
|
@@ -1537,7 +1537,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1537
1537
|
* Cancel a single order
|
|
1538
1538
|
*
|
|
1539
1539
|
* @param params Parameters for cancelling a single order
|
|
1540
|
-
* @returns Promise<
|
|
1540
|
+
* @returns Promise<FuturesOrder>
|
|
1541
1541
|
*/
|
|
1542
1542
|
cancelFuturesOrder(params) {
|
|
1543
1543
|
return this.deletePrivate(`/futures/${params.settle}/orders/${params.order_id}`);
|
|
@@ -1546,7 +1546,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1546
1546
|
* Amend an order
|
|
1547
1547
|
*
|
|
1548
1548
|
* @param params Parameters for amending an order
|
|
1549
|
-
* @returns Promise<
|
|
1549
|
+
* @returns Promise<FuturesOrder>
|
|
1550
1550
|
*/
|
|
1551
1551
|
updateFuturesOrder(params) {
|
|
1552
1552
|
const { settle, order_id, ...body } = params;
|
|
@@ -1560,7 +1560,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1560
1560
|
* By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use GET /futures/{settle}/my_trades_timerange.
|
|
1561
1561
|
*
|
|
1562
1562
|
* @param params Parameters for listing personal trading history
|
|
1563
|
-
* @returns Promise<
|
|
1563
|
+
* @returns Promise<GetFuturesTradingHistoryResp[]>
|
|
1564
1564
|
*/
|
|
1565
1565
|
getFuturesTradingHistory(params) {
|
|
1566
1566
|
const { settle, ...query } = params;
|
|
@@ -1570,7 +1570,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1570
1570
|
* List position close history
|
|
1571
1571
|
*
|
|
1572
1572
|
* @param params Parameters for listing position close history
|
|
1573
|
-
* @returns Promise<
|
|
1573
|
+
* @returns Promise<GetFuturesPositionHistoryResp[]>
|
|
1574
1574
|
*/
|
|
1575
1575
|
getFuturesPositionHistory(params) {
|
|
1576
1576
|
const { settle, ...query } = params;
|
|
@@ -1580,7 +1580,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1580
1580
|
* List liquidation history
|
|
1581
1581
|
*
|
|
1582
1582
|
* @param params Parameters for listing liquidation history
|
|
1583
|
-
* @returns Promise<
|
|
1583
|
+
* @returns Promise<GetFuturesLiquidationHistoryResp[]>
|
|
1584
1584
|
*/
|
|
1585
1585
|
getFuturesLiquidationHistory(params) {
|
|
1586
1586
|
const { settle, ...query } = params;
|
|
@@ -1590,7 +1590,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1590
1590
|
* List Auto-Deleveraging History
|
|
1591
1591
|
*
|
|
1592
1592
|
* @param params Parameters for listing auto-deleveraging history
|
|
1593
|
-
* @returns Promise<
|
|
1593
|
+
* @returns Promise<GetFuturesAutoDeleveragingHistoryResp[]>
|
|
1594
1594
|
*/
|
|
1595
1595
|
getFuturesAutoDeleveragingHistory(params) {
|
|
1596
1596
|
const { settle, ...query } = params;
|
|
@@ -1604,7 +1604,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1604
1604
|
* If the timeout is set to 0 within 30 seconds, the countdown timer will expire and the cancel function will be cancelled.
|
|
1605
1605
|
*
|
|
1606
1606
|
* @param params Parameters for setting countdown cancel orders
|
|
1607
|
-
* @returns Promise<
|
|
1607
|
+
* @returns Promise<{ triggerTime: number }>
|
|
1608
1608
|
*/
|
|
1609
1609
|
setFuturesOrderCancelCountdown(params) {
|
|
1610
1610
|
const { settle, ...body } = params;
|
|
@@ -1616,7 +1616,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1616
1616
|
* Query user trading fee rates
|
|
1617
1617
|
*
|
|
1618
1618
|
* @param params Parameters for querying user trading fee rates
|
|
1619
|
-
* @returns Promise<
|
|
1619
|
+
* @returns Promise<any>
|
|
1620
1620
|
*/
|
|
1621
1621
|
getFuturesUserTradingFees(params) {
|
|
1622
1622
|
const { settle, ...query } = params;
|
|
@@ -1628,7 +1628,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1628
1628
|
* Multiple distinct order ID list can be specified. Each request can cancel a maximum of 20 records.
|
|
1629
1629
|
*
|
|
1630
1630
|
* @param params Parameters for cancelling a batch of orders with an ID list
|
|
1631
|
-
* @returns Promise<
|
|
1631
|
+
* @returns Promise<DeleteFuturesBatchOrdersResp[]>
|
|
1632
1632
|
*/
|
|
1633
1633
|
batchCancelFuturesOrders(params) {
|
|
1634
1634
|
const { settle, ...orderIds } = params;
|
|
@@ -1640,7 +1640,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1640
1640
|
* Create a price-triggered order
|
|
1641
1641
|
*
|
|
1642
1642
|
* @param params Parameters for creating a price-triggered order
|
|
1643
|
-
* @returns Promise<
|
|
1643
|
+
* @returns Promise<{ id: number }>
|
|
1644
1644
|
*/
|
|
1645
1645
|
submitFuturesPriceTriggeredOrder(params) {
|
|
1646
1646
|
const { settle, ...body } = params;
|
|
@@ -1650,7 +1650,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1650
1650
|
* List all auto orders
|
|
1651
1651
|
*
|
|
1652
1652
|
* @param params Parameters for listing all auto orders
|
|
1653
|
-
* @returns Promise<
|
|
1653
|
+
* @returns Promise<FuturesPriceTriggeredOrder[]>
|
|
1654
1654
|
*/
|
|
1655
1655
|
getFuturesAutoOrders(params) {
|
|
1656
1656
|
const { settle, ...query } = params;
|
|
@@ -1660,7 +1660,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1660
1660
|
* Cancel all open orders
|
|
1661
1661
|
*
|
|
1662
1662
|
* @param params Parameters for cancelling all open orders
|
|
1663
|
-
* @returns Promise<
|
|
1663
|
+
* @returns Promise<FuturesPriceTriggeredOrder[]>
|
|
1664
1664
|
*/
|
|
1665
1665
|
cancelAllOpenFuturesOrders(params) {
|
|
1666
1666
|
const { settle, ...query } = params;
|
|
@@ -1672,7 +1672,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1672
1672
|
* Get a price-triggered order
|
|
1673
1673
|
*
|
|
1674
1674
|
* @param params Parameters for retrieving a price-triggered order
|
|
1675
|
-
* @returns Promise<
|
|
1675
|
+
* @returns Promise<FuturesPriceTriggeredOrder>
|
|
1676
1676
|
*/
|
|
1677
1677
|
getFuturesPriceTriggeredOrder(params) {
|
|
1678
1678
|
return this.getPrivate(`/futures/${params.settle}/price_orders/${params.order_id}`);
|
|
@@ -1681,7 +1681,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1681
1681
|
* Cancel a price-triggered order
|
|
1682
1682
|
*
|
|
1683
1683
|
* @param params Parameters for cancelling a price-triggered order
|
|
1684
|
-
* @returns Promise<
|
|
1684
|
+
* @returns Promise<FuturesPriceTriggeredOrder>
|
|
1685
1685
|
*/
|
|
1686
1686
|
cancelFuturesPriceTriggeredOrder(params) {
|
|
1687
1687
|
return this.deletePrivate(`/futures/${params.settle}/price_orders/${params.order_id}`);
|
|
@@ -1694,7 +1694,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1694
1694
|
* List all futures contracts
|
|
1695
1695
|
*
|
|
1696
1696
|
* @param params Parameters for listing all futures contracts
|
|
1697
|
-
* @returns Promise<
|
|
1697
|
+
* @returns Promise<DeliveryContract[]>
|
|
1698
1698
|
*/
|
|
1699
1699
|
getAllDeliveryContracts(params) {
|
|
1700
1700
|
return this.get(`/delivery/${params.settle}/contracts`);
|
|
@@ -1703,7 +1703,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1703
1703
|
* Get a single contract
|
|
1704
1704
|
*
|
|
1705
1705
|
* @param params Parameters for retrieving a single contract
|
|
1706
|
-
* @returns Promise<
|
|
1706
|
+
* @returns Promise<DeliveryContract>
|
|
1707
1707
|
*/
|
|
1708
1708
|
getDeliveryContract(params) {
|
|
1709
1709
|
return this.get(`/delivery/${params.settle}/contracts/${params.contract}`);
|
|
@@ -1714,7 +1714,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1714
1714
|
* Bids will be sorted by price from high to low, while asks sorted reversely
|
|
1715
1715
|
*
|
|
1716
1716
|
* @param params Parameters for retrieving the futures order book
|
|
1717
|
-
* @returns Promise<
|
|
1717
|
+
* @returns Promise<GetDeliveryOrderBookResp>
|
|
1718
1718
|
*/
|
|
1719
1719
|
getDeliveryOrderBook(params) {
|
|
1720
1720
|
const { settle, ...query } = params;
|
|
@@ -1724,7 +1724,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1724
1724
|
* Futures trading history
|
|
1725
1725
|
*
|
|
1726
1726
|
* @param params Parameters for retrieving the futures trading history
|
|
1727
|
-
* @returns Promise<
|
|
1727
|
+
* @returns Promise<GetDeliveryTradesResp[]>
|
|
1728
1728
|
*/
|
|
1729
1729
|
getDeliveryTrades(params) {
|
|
1730
1730
|
const { settle, ...query } = params;
|
|
@@ -1737,7 +1737,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1737
1737
|
* Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval.
|
|
1738
1738
|
*
|
|
1739
1739
|
* @param params Parameters for retrieving futures Candles
|
|
1740
|
-
* @returns Promise<
|
|
1740
|
+
* @returns Promise<GetDeliveryCandlesResp[]>
|
|
1741
1741
|
*/
|
|
1742
1742
|
getDeliveryCandles(params) {
|
|
1743
1743
|
const { settle, ...query } = params;
|
|
@@ -1747,7 +1747,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1747
1747
|
* List futures tickers
|
|
1748
1748
|
*
|
|
1749
1749
|
* @param params Parameters for listing futures tickers
|
|
1750
|
-
* @returns Promise<
|
|
1750
|
+
* @returns Promise<GetDeliveryTickersResp[]>
|
|
1751
1751
|
*/
|
|
1752
1752
|
getDeliveryTickers(params) {
|
|
1753
1753
|
const { settle, ...query } = params;
|
|
@@ -1757,10 +1757,10 @@ export class RestClient extends BaseRestClient {
|
|
|
1757
1757
|
* Futures insurance balance history
|
|
1758
1758
|
*
|
|
1759
1759
|
* @param params Parameters for retrieving the futures insurance balance history
|
|
1760
|
-
* @returns Promise<
|
|
1760
|
+
* @returns Promise<{
|
|
1761
1761
|
* t: number;
|
|
1762
1762
|
* b: string;
|
|
1763
|
-
* }[]
|
|
1763
|
+
* }[]>
|
|
1764
1764
|
*/
|
|
1765
1765
|
getDeliveryInsuranceBalanceHistory(params) {
|
|
1766
1766
|
const { settle, ...query } = params;
|
|
@@ -1770,7 +1770,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1770
1770
|
* Query futures account
|
|
1771
1771
|
*
|
|
1772
1772
|
* @param params Parameters for querying futures account
|
|
1773
|
-
* @returns Promise<
|
|
1773
|
+
* @returns Promise<GetDeliveryAccountResp>
|
|
1774
1774
|
*/
|
|
1775
1775
|
getDeliveryAccount(params) {
|
|
1776
1776
|
const { settle, ...query } = params;
|
|
@@ -1780,7 +1780,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1780
1780
|
* Query account book
|
|
1781
1781
|
*
|
|
1782
1782
|
* @param params Parameters for querying account book
|
|
1783
|
-
* @returns Promise<
|
|
1783
|
+
* @returns Promise<GetDeliveryBookResp[]>
|
|
1784
1784
|
*/
|
|
1785
1785
|
getDeliveryBook(params) {
|
|
1786
1786
|
const { settle, ...query } = params;
|
|
@@ -1790,7 +1790,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1790
1790
|
* List all positions of a user
|
|
1791
1791
|
*
|
|
1792
1792
|
* @param params Parameters for listing all positions of a user
|
|
1793
|
-
* @returns Promise<
|
|
1793
|
+
* @returns Promise<Position[]>
|
|
1794
1794
|
*/
|
|
1795
1795
|
getDeliveryPositions(params) {
|
|
1796
1796
|
return this.getPrivate(`/delivery/${params.settle}/positions`);
|
|
@@ -1799,7 +1799,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1799
1799
|
* Get single position
|
|
1800
1800
|
*
|
|
1801
1801
|
* @param params Parameters for retrieving a single position
|
|
1802
|
-
* @returns Promise<
|
|
1802
|
+
* @returns Promise<Position>
|
|
1803
1803
|
*/
|
|
1804
1804
|
getDeliveryPosition(params) {
|
|
1805
1805
|
return this.getPrivate(`/delivery/${params.settle}/positions/${params.contract}`);
|
|
@@ -1808,7 +1808,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1808
1808
|
* Update position margin
|
|
1809
1809
|
*
|
|
1810
1810
|
* @param params Parameters for updating position margin
|
|
1811
|
-
* @returns Promise<
|
|
1811
|
+
* @returns Promise<Position>
|
|
1812
1812
|
*/
|
|
1813
1813
|
updateDeliveryMargin(params) {
|
|
1814
1814
|
const { settle, contract, ...query } = params;
|
|
@@ -1818,7 +1818,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1818
1818
|
* Update position leverage
|
|
1819
1819
|
*
|
|
1820
1820
|
* @param params Parameters for updating position leverage
|
|
1821
|
-
* @returns Promise<
|
|
1821
|
+
* @returns Promise<Position>
|
|
1822
1822
|
*/
|
|
1823
1823
|
updateDeliveryLeverage(params) {
|
|
1824
1824
|
const { settle, contract, ...query } = params;
|
|
@@ -1828,7 +1828,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1828
1828
|
* Update position risk limit
|
|
1829
1829
|
*
|
|
1830
1830
|
* @param params Parameters for updating position risk limit
|
|
1831
|
-
* @returns Promise<
|
|
1831
|
+
* @returns Promise<Position>
|
|
1832
1832
|
*/
|
|
1833
1833
|
updateDeliveryRiskLimit(params) {
|
|
1834
1834
|
const { settle, contract, ...query } = params;
|
|
@@ -1840,7 +1840,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1840
1840
|
* Zero-filled order cannot be retrieved 10 minutes after order cancellation
|
|
1841
1841
|
*
|
|
1842
1842
|
* @param params Parameters for creating a futures order
|
|
1843
|
-
* @returns Promise<
|
|
1843
|
+
* @returns Promise<FuturesOrder>
|
|
1844
1844
|
*/
|
|
1845
1845
|
submitDeliveryOrder(params) {
|
|
1846
1846
|
const { settle, ...body } = params;
|
|
@@ -1852,7 +1852,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1852
1852
|
* Zero-fill order cannot be retrieved 10 minutes after order cancellation.
|
|
1853
1853
|
*
|
|
1854
1854
|
* @param params Parameters for listing futures orders
|
|
1855
|
-
* @returns Promise<
|
|
1855
|
+
* @returns Promise<FuturesOrder[]>
|
|
1856
1856
|
*/
|
|
1857
1857
|
getDeliveryOrders(params) {
|
|
1858
1858
|
const { settle, ...query } = params;
|
|
@@ -1864,7 +1864,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1864
1864
|
* Zero-filled order cannot be retrieved 10 minutes after order cancellation
|
|
1865
1865
|
*
|
|
1866
1866
|
* @param params Parameters for cancelling all open orders matched
|
|
1867
|
-
* @returns Promise<
|
|
1867
|
+
* @returns Promise<FuturesOrder[]>
|
|
1868
1868
|
*/
|
|
1869
1869
|
cancelAllDeliveryOrders(params) {
|
|
1870
1870
|
const { settle, ...query } = params;
|
|
@@ -1878,7 +1878,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1878
1878
|
* Zero-filled order cannot be retrieved 10 minutes after order cancellation
|
|
1879
1879
|
*
|
|
1880
1880
|
* @param params Parameters for retrieving a single order
|
|
1881
|
-
* @returns Promise<
|
|
1881
|
+
* @returns Promise<FuturesOrder>
|
|
1882
1882
|
*/
|
|
1883
1883
|
getDeliveryOrder(params) {
|
|
1884
1884
|
return this.getPrivate(`/delivery/${params.settle}/orders/${params.order_id}`);
|
|
@@ -1887,7 +1887,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1887
1887
|
* Cancel a single order
|
|
1888
1888
|
*
|
|
1889
1889
|
* @param params Parameters for cancelling a single order
|
|
1890
|
-
* @returns Promise<
|
|
1890
|
+
* @returns Promise<FuturesOrder>
|
|
1891
1891
|
*/
|
|
1892
1892
|
cancelDeliveryOrder(params) {
|
|
1893
1893
|
return this.deletePrivate(`/delivery/${params.settle}/orders/${params.order_id}`);
|
|
@@ -1896,7 +1896,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1896
1896
|
* List personal trading history
|
|
1897
1897
|
*
|
|
1898
1898
|
* @param params Parameters for listing personal trading history
|
|
1899
|
-
* @returns Promise<
|
|
1899
|
+
* @returns Promise<GetDeliveryTradingHistoryResp[]>
|
|
1900
1900
|
*/
|
|
1901
1901
|
getDeliveryTradingHistory(params) {
|
|
1902
1902
|
const { settle, ...query } = params;
|
|
@@ -1906,7 +1906,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1906
1906
|
* List position close history
|
|
1907
1907
|
*
|
|
1908
1908
|
* @param params Parameters for listing position close history
|
|
1909
|
-
* @returns Promise<
|
|
1909
|
+
* @returns Promise<GetDeliveryClosedPositionsResp[]>
|
|
1910
1910
|
*/
|
|
1911
1911
|
getDeliveryClosedPositions(params) {
|
|
1912
1912
|
const { settle, ...query } = params;
|
|
@@ -1916,7 +1916,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1916
1916
|
* List liquidation history
|
|
1917
1917
|
*
|
|
1918
1918
|
* @param params Parameters for listing liquidation history
|
|
1919
|
-
* @returns Promise<
|
|
1919
|
+
* @returns Promise<GetDeliveryLiquidationHistoryResp[]>
|
|
1920
1920
|
*/
|
|
1921
1921
|
getDeliveryLiquidationHistory(params) {
|
|
1922
1922
|
const { settle, ...query } = params;
|
|
@@ -1926,7 +1926,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1926
1926
|
* List settlement history
|
|
1927
1927
|
*
|
|
1928
1928
|
* @param params Parameters for listing settlement history
|
|
1929
|
-
* @returns Promise<
|
|
1929
|
+
* @returns Promise<GetDeliverySettlementHistoryResp[]>
|
|
1930
1930
|
*/
|
|
1931
1931
|
getDeliverySettlementHistory(params) {
|
|
1932
1932
|
const { settle, ...query } = params;
|
|
@@ -1936,7 +1936,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1936
1936
|
* Create a price-triggered order
|
|
1937
1937
|
*
|
|
1938
1938
|
* @param params Parameters for creating a price-triggered order
|
|
1939
|
-
* @returns Promise<
|
|
1939
|
+
* @returns Promise<{ id: number }>
|
|
1940
1940
|
*/
|
|
1941
1941
|
submitDeliveryTriggeredOrder(params) {
|
|
1942
1942
|
const { settle, ...body } = params;
|
|
@@ -1948,7 +1948,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1948
1948
|
* List all auto orders
|
|
1949
1949
|
*
|
|
1950
1950
|
* @param params Parameters for listing all auto orders
|
|
1951
|
-
* @returns Promise<
|
|
1951
|
+
* @returns Promise<FuturesPriceTriggeredOrder[]>
|
|
1952
1952
|
*/
|
|
1953
1953
|
getDeliveryAutoOrders(params) {
|
|
1954
1954
|
const { settle, ...query } = params;
|
|
@@ -1958,7 +1958,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1958
1958
|
* Cancel all open orders
|
|
1959
1959
|
*
|
|
1960
1960
|
* @param params Parameters for cancelling all open orders
|
|
1961
|
-
* @returns Promise<
|
|
1961
|
+
* @returns Promise<FuturesPriceTriggeredOrder[]>
|
|
1962
1962
|
*/
|
|
1963
1963
|
cancelAllOpenDeliveryOrders(params) {
|
|
1964
1964
|
const { settle, ...query } = params;
|
|
@@ -1970,7 +1970,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1970
1970
|
* Get a price-triggered order
|
|
1971
1971
|
*
|
|
1972
1972
|
* @param params Parameters for retrieving a price-triggered order
|
|
1973
|
-
* @returns Promise<
|
|
1973
|
+
* @returns Promise<FuturesPriceTriggeredOrder>
|
|
1974
1974
|
*/
|
|
1975
1975
|
getDeliveryTriggeredOrder(params) {
|
|
1976
1976
|
return this.getPrivate(`/delivery/${params.settle}/price_orders/${params.order_id}`);
|
|
@@ -1979,7 +1979,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1979
1979
|
* Cancel a price-triggered order
|
|
1980
1980
|
*
|
|
1981
1981
|
* @param params Parameters for cancelling a price-triggered order
|
|
1982
|
-
* @returns Promise<
|
|
1982
|
+
* @returns Promise<FuturesPriceTriggeredOrder>
|
|
1983
1983
|
*/
|
|
1984
1984
|
cancelTriggeredDeliveryOrder(params) {
|
|
1985
1985
|
return this.deletePrivate(`/delivery/${params.settle}/price_orders/${params.order_id}`);
|
|
@@ -1991,7 +1991,7 @@ export class RestClient extends BaseRestClient {
|
|
|
1991
1991
|
/**
|
|
1992
1992
|
* List all underlyings
|
|
1993
1993
|
*
|
|
1994
|
-
* @returns Promise<
|
|
1994
|
+
* @returns Promise<{ name: string; index_price: string }[]>
|
|
1995
1995
|
*/
|
|
1996
1996
|
getOptionsUnderlyings() {
|
|
1997
1997
|
return this.get(`/options/underlyings`);
|
|
@@ -2000,7 +2000,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2000
2000
|
* List all expiration times
|
|
2001
2001
|
*
|
|
2002
2002
|
* @param params Parameters for listing expiration times
|
|
2003
|
-
* @returns Promise<
|
|
2003
|
+
* @returns Promise<number[]>
|
|
2004
2004
|
*/
|
|
2005
2005
|
getOptionsExpirationTimes(params) {
|
|
2006
2006
|
return this.get(`/options/expirations`, params);
|
|
@@ -2009,7 +2009,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2009
2009
|
* List all the contracts with specified underlying and expiration time
|
|
2010
2010
|
*
|
|
2011
2011
|
* @param params Parameters for listing contracts
|
|
2012
|
-
* @returns Promise<
|
|
2012
|
+
* @returns Promise<GetOptionsContractsResp[]>
|
|
2013
2013
|
*/
|
|
2014
2014
|
getOptionsContracts(params) {
|
|
2015
2015
|
return this.get(`/options/contracts`, params);
|
|
@@ -2018,7 +2018,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2018
2018
|
* Query specified contract detail
|
|
2019
2019
|
*
|
|
2020
2020
|
* @param params Parameters for querying specified contract detail
|
|
2021
|
-
* @returns Promise<
|
|
2021
|
+
* @returns Promise<GetOptionsContractsResp>
|
|
2022
2022
|
*/
|
|
2023
2023
|
getOptionsContract(params) {
|
|
2024
2024
|
return this.get(`/options/contracts/${params.contract}`);
|
|
@@ -2027,7 +2027,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2027
2027
|
* List settlement history
|
|
2028
2028
|
*
|
|
2029
2029
|
* @param params Parameters for listing settlement history
|
|
2030
|
-
* @returns Promise<
|
|
2030
|
+
* @returns Promise<GetOptionsSettlementHistoryResp[]>
|
|
2031
2031
|
*/
|
|
2032
2032
|
getOptionsSettlementHistory(params) {
|
|
2033
2033
|
return this.get(`/options/settlements`, params);
|
|
@@ -2036,7 +2036,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2036
2036
|
* Get specified contract's settlement
|
|
2037
2037
|
*
|
|
2038
2038
|
* @param params Parameters for retrieving specified contract's settlement
|
|
2039
|
-
* @returns Promise<
|
|
2039
|
+
* @returns Promise<GetOptionsSettlementHistoryResp}>
|
|
2040
2040
|
*/
|
|
2041
2041
|
getOptionsContractSettlement(params) {
|
|
2042
2042
|
const { contract, ...query } = params;
|
|
@@ -2046,7 +2046,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2046
2046
|
* List my options settlements
|
|
2047
2047
|
*
|
|
2048
2048
|
* @param params Parameters for listing my options settlements
|
|
2049
|
-
* @returns Promise<
|
|
2049
|
+
* @returns Promise<GetOptionsMySettlementsResp[]>
|
|
2050
2050
|
*/
|
|
2051
2051
|
getOptionsMySettlements(params) {
|
|
2052
2052
|
return this.getPrivate(`/options/my_settlements`, params);
|
|
@@ -2057,7 +2057,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2057
2057
|
* Bids will be sorted by price from high to low, while asks sorted reversely
|
|
2058
2058
|
*
|
|
2059
2059
|
* @param params Parameters for retrieving options order book
|
|
2060
|
-
* @returns Promise<
|
|
2060
|
+
* @returns Promise<GetOptionsOrderBookResp>
|
|
2061
2061
|
*/
|
|
2062
2062
|
getOptionsOrderBook(params) {
|
|
2063
2063
|
return this.get(`/options/order_book`, params);
|
|
@@ -2066,7 +2066,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2066
2066
|
* List tickers of options contracts
|
|
2067
2067
|
*
|
|
2068
2068
|
* @param params Parameters for listing tickers of options contracts
|
|
2069
|
-
* @returns Promise<
|
|
2069
|
+
* @returns Promise<GetOptionsTickersResp[]>
|
|
2070
2070
|
*/
|
|
2071
2071
|
getOptionsTickers(params) {
|
|
2072
2072
|
return this.get(`/options/tickers`, params);
|
|
@@ -2075,11 +2075,11 @@ export class RestClient extends BaseRestClient {
|
|
|
2075
2075
|
* Get underlying ticker
|
|
2076
2076
|
*
|
|
2077
2077
|
* @param params Parameters for retrieving underlying ticker
|
|
2078
|
-
* @returns Promise<
|
|
2078
|
+
* @returns Promise<{
|
|
2079
2079
|
* trade_put: number;
|
|
2080
2080
|
* trade_call: number;
|
|
2081
2081
|
* index_price: string;
|
|
2082
|
-
* }
|
|
2082
|
+
* }>
|
|
2083
2083
|
*/
|
|
2084
2084
|
getOptionsUnderlyingTicker(params) {
|
|
2085
2085
|
return this.get(`/options/underlying/tickers/${params.underlying}`);
|
|
@@ -2088,7 +2088,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2088
2088
|
* Get options Candles
|
|
2089
2089
|
*
|
|
2090
2090
|
* @param params Parameters for retrieving options Candles
|
|
2091
|
-
* @returns Promise<
|
|
2091
|
+
* @returns Promise<GetOptionsCandlesResp[]>
|
|
2092
2092
|
*/
|
|
2093
2093
|
getOptionsCandles(params) {
|
|
2094
2094
|
return this.get(`/options/Candles`, params);
|
|
@@ -2097,7 +2097,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2097
2097
|
* Mark price Candles of an underlying
|
|
2098
2098
|
*
|
|
2099
2099
|
* @param params Parameters for retrieving mark price Candles of an underlying
|
|
2100
|
-
* @returns Promise<
|
|
2100
|
+
* @returns Promise<GetOptionsUnderlyingCandlesResp[]>
|
|
2101
2101
|
*/
|
|
2102
2102
|
getOptionsUnderlyingCandles(params) {
|
|
2103
2103
|
return this.get(`/options/underlying/Candles`, params);
|
|
@@ -2106,7 +2106,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2106
2106
|
* Options trade history
|
|
2107
2107
|
*
|
|
2108
2108
|
* @param params Parameters for retrieving options trade history
|
|
2109
|
-
* @returns Promise<
|
|
2109
|
+
* @returns Promise<GetOptionsTradesResp[]>
|
|
2110
2110
|
*/
|
|
2111
2111
|
getOptionsTrades(params) {
|
|
2112
2112
|
return this.get(`/options/trades`, params);
|
|
@@ -2114,7 +2114,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2114
2114
|
/**
|
|
2115
2115
|
* List options account
|
|
2116
2116
|
*
|
|
2117
|
-
* @returns Promise<
|
|
2117
|
+
* @returns Promise<GetOptionsAccountResp>
|
|
2118
2118
|
*/
|
|
2119
2119
|
getOptionsAccount() {
|
|
2120
2120
|
return this.getPrivate(`/options/accounts`);
|
|
@@ -2123,7 +2123,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2123
2123
|
* List account changing history
|
|
2124
2124
|
*
|
|
2125
2125
|
* @param params Parameters for listing account changing history
|
|
2126
|
-
* @returns Promise<
|
|
2126
|
+
* @returns Promise<GetOptionsAccountChangeResp[]>
|
|
2127
2127
|
*/
|
|
2128
2128
|
getOptionsAccountChange(params) {
|
|
2129
2129
|
return this.getPrivate(`/options/account_book`, params);
|
|
@@ -2132,7 +2132,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2132
2132
|
* List user's positions of specified underlying
|
|
2133
2133
|
*
|
|
2134
2134
|
* @param params Parameters for listing user's positions of specified underlying
|
|
2135
|
-
* @returns Promise<
|
|
2135
|
+
* @returns Promise<GetOptionsPositionsUnderlyingResp[]>
|
|
2136
2136
|
*/
|
|
2137
2137
|
getOptionsPositionsUnderlying(params) {
|
|
2138
2138
|
return this.getPrivate(`/options/positions`, params);
|
|
@@ -2141,7 +2141,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2141
2141
|
* Get specified contract position
|
|
2142
2142
|
*
|
|
2143
2143
|
* @param params Parameters for retrieving specified contract position
|
|
2144
|
-
* @returns Promise<
|
|
2144
|
+
* @returns Promise<GetOptionsPositionsUnderlyingResp>
|
|
2145
2145
|
*/
|
|
2146
2146
|
getOptionsPositionContract(params) {
|
|
2147
2147
|
return this.getPrivate(`/options/positions/${params.contract}`);
|
|
@@ -2150,7 +2150,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2150
2150
|
* List user's liquidation history of specified underlying
|
|
2151
2151
|
*
|
|
2152
2152
|
* @param params Parameters for listing user's liquidation history of specified underlying
|
|
2153
|
-
* @returns Promise<
|
|
2153
|
+
* @returns Promise<GetOptionsLiquidationResp[]>
|
|
2154
2154
|
*/
|
|
2155
2155
|
getOptionsLiquidation(params) {
|
|
2156
2156
|
return this.getPrivate(`/options/position_close`, params);
|
|
@@ -2159,7 +2159,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2159
2159
|
* Create an options order
|
|
2160
2160
|
*
|
|
2161
2161
|
* @param params Parameters for creating an options order
|
|
2162
|
-
* @returns Promise<
|
|
2162
|
+
* @returns Promise<SubmitOptionsOrderResp>
|
|
2163
2163
|
*/
|
|
2164
2164
|
submitOptionsOrder(params) {
|
|
2165
2165
|
return this.postPrivate(`/options/orders`, { body: params });
|
|
@@ -2168,7 +2168,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2168
2168
|
* List options orders
|
|
2169
2169
|
*
|
|
2170
2170
|
* @param params Parameters for listing options orders
|
|
2171
|
-
* @returns Promise<
|
|
2171
|
+
* @returns Promise<SubmitOptionsOrderResp[]>
|
|
2172
2172
|
*/
|
|
2173
2173
|
getOptionsOrders(params) {
|
|
2174
2174
|
return this.getPrivate(`/options/orders`, params);
|
|
@@ -2177,7 +2177,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2177
2177
|
* Cancel all open orders matched
|
|
2178
2178
|
*
|
|
2179
2179
|
* @param params Parameters for canceling all open orders matched
|
|
2180
|
-
* @returns Promise<
|
|
2180
|
+
* @returns Promise<SubmitOptionsOrderResp[]>
|
|
2181
2181
|
*/
|
|
2182
2182
|
cancelAllOpenOptionsOrders(params) {
|
|
2183
2183
|
return this.deletePrivate(`/options/orders`, { query: params });
|
|
@@ -2186,7 +2186,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2186
2186
|
* Get a single order
|
|
2187
2187
|
*
|
|
2188
2188
|
* @param params Parameters for retrieving a single order
|
|
2189
|
-
* @returns Promise<
|
|
2189
|
+
* @returns Promise<SubmitOptionsOrderResp>
|
|
2190
2190
|
*/
|
|
2191
2191
|
getOptionsOrder(params) {
|
|
2192
2192
|
return this.getPrivate(`/options/orders/${params.order_id}`);
|
|
@@ -2195,7 +2195,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2195
2195
|
* Cancel a single order
|
|
2196
2196
|
*
|
|
2197
2197
|
* @param params Parameters for canceling a single order
|
|
2198
|
-
* @returns Promise<
|
|
2198
|
+
* @returns Promise<SubmitOptionsOrderResp>
|
|
2199
2199
|
*/
|
|
2200
2200
|
cancelOptionsOrder(params) {
|
|
2201
2201
|
return this.deletePrivate(`/options/orders/${params.order_id}`);
|
|
@@ -2204,7 +2204,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2204
2204
|
* List personal trading history
|
|
2205
2205
|
*
|
|
2206
2206
|
* @param params Parameters for listing personal trading history
|
|
2207
|
-
* @returns Promise<
|
|
2207
|
+
* @returns Promise<GetOptionsPersonalHistoryResp[]>
|
|
2208
2208
|
*/
|
|
2209
2209
|
getOptionsPersonalHistory(params) {
|
|
2210
2210
|
return this.getPrivate(`/options/my_trades`, params);
|
|
@@ -2216,7 +2216,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2216
2216
|
/**
|
|
2217
2217
|
* List currencies for lending
|
|
2218
2218
|
*
|
|
2219
|
-
* @returns Promise<
|
|
2219
|
+
* @returns Promise<GetLendingCurrenciesResp[]>
|
|
2220
2220
|
*/
|
|
2221
2221
|
getLendingCurrencies() {
|
|
2222
2222
|
return this.get(`/earn/uni/currencies`);
|
|
@@ -2225,7 +2225,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2225
2225
|
* Get currency detail for lending
|
|
2226
2226
|
*
|
|
2227
2227
|
* @param params Parameters for retrieving currency detail for lending
|
|
2228
|
-
* @returns Promise<
|
|
2228
|
+
* @returns Promise<GetLendingCurrenciesResp>
|
|
2229
2229
|
*/
|
|
2230
2230
|
getLendingCurrency(params) {
|
|
2231
2231
|
return this.get(`/earn/uni/currencies/${params.currency}`);
|
|
@@ -2234,7 +2234,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2234
2234
|
* Lend or redeem
|
|
2235
2235
|
*
|
|
2236
2236
|
* @param params Parameters for lending or redeeming
|
|
2237
|
-
* @returns Promise<
|
|
2237
|
+
* @returns Promise<any>
|
|
2238
2238
|
*/
|
|
2239
2239
|
submitLendOrRedeemOrder(params) {
|
|
2240
2240
|
return this.postPrivate(`/earn/uni/lends`, { body: params });
|
|
@@ -2243,7 +2243,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2243
2243
|
* List user's lending orders
|
|
2244
2244
|
*
|
|
2245
2245
|
* @param params Parameters for listing user's lending orders
|
|
2246
|
-
* @returns Promise<
|
|
2246
|
+
* @returns Promise<GetLendingOrdersResp[]>
|
|
2247
2247
|
*/
|
|
2248
2248
|
getLendingOrders(params) {
|
|
2249
2249
|
return this.getPrivate(`/earn/uni/lends`, params);
|
|
@@ -2254,7 +2254,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2254
2254
|
* Currently only supports amending the minimum interest rate (hour)
|
|
2255
2255
|
*
|
|
2256
2256
|
* @param params Parameters for amending lending order
|
|
2257
|
-
* @returns Promise<
|
|
2257
|
+
* @returns Promise<any>
|
|
2258
2258
|
*/
|
|
2259
2259
|
updateLendingOrder(params) {
|
|
2260
2260
|
return this.patchPrivate(`/earn/uni/lends`, { query: params });
|
|
@@ -2263,7 +2263,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2263
2263
|
* List records of lending
|
|
2264
2264
|
*
|
|
2265
2265
|
* @param params Parameters for listing records of lending
|
|
2266
|
-
* @returns Promise<
|
|
2266
|
+
* @returns Promise<GetLendingRecordsResp[]>
|
|
2267
2267
|
*/
|
|
2268
2268
|
getLendingRecords(params) {
|
|
2269
2269
|
return this.getPrivate(`/earn/uni/lend_records`, params);
|
|
@@ -2272,10 +2272,10 @@ export class RestClient extends BaseRestClient {
|
|
|
2272
2272
|
* Get the user's total interest income of specified currency
|
|
2273
2273
|
*
|
|
2274
2274
|
* @param params Parameters for retrieving the user's total interest income of specified currency
|
|
2275
|
-
* @returns Promise<
|
|
2275
|
+
* @returns Promise<{
|
|
2276
2276
|
* currency: string;
|
|
2277
2277
|
* interest: string;
|
|
2278
|
-
* }
|
|
2278
|
+
* }>
|
|
2279
2279
|
*/
|
|
2280
2280
|
getLendingTotalInterest(params) {
|
|
2281
2281
|
return this.getPrivate(`/earn/uni/interests/${params.currency}`);
|
|
@@ -2284,7 +2284,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2284
2284
|
* List interest records
|
|
2285
2285
|
*
|
|
2286
2286
|
* @param params Parameters for listing interest records
|
|
2287
|
-
* @returns Promise<
|
|
2287
|
+
* @returns Promise<GetLendingInterestRecordsResp[]>
|
|
2288
2288
|
*/
|
|
2289
2289
|
getLendingInterestRecords(params) {
|
|
2290
2290
|
return this.getPrivate(`/earn/uni/interest_records`, params);
|
|
@@ -2293,7 +2293,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2293
2293
|
* Set interest reinvestment toggle
|
|
2294
2294
|
*
|
|
2295
2295
|
* @param params Parameters for setting interest reinvestment toggle
|
|
2296
|
-
* @returns Promise<
|
|
2296
|
+
* @returns Promise<any>
|
|
2297
2297
|
*/
|
|
2298
2298
|
updateInterestReinvestment(params) {
|
|
2299
2299
|
return this.putPrivate(`/earn/uni/interest_reinvest`, { body: params });
|
|
@@ -2302,10 +2302,10 @@ export class RestClient extends BaseRestClient {
|
|
|
2302
2302
|
* Query currency interest compounding status
|
|
2303
2303
|
*
|
|
2304
2304
|
* @param params Parameters for querying currency interest compounding status
|
|
2305
|
-
* @returns Promise<
|
|
2305
|
+
* @returns Promise<{
|
|
2306
2306
|
* currency: string;
|
|
2307
2307
|
* interest_status: string;
|
|
2308
|
-
* }
|
|
2308
|
+
* }>
|
|
2309
2309
|
*/
|
|
2310
2310
|
getLendingInterestStatus(params) {
|
|
2311
2311
|
return this.getPrivate(`/earn/uni/interest_status/${params.currency}`);
|
|
@@ -2318,7 +2318,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2318
2318
|
* Place order
|
|
2319
2319
|
*
|
|
2320
2320
|
* @param params Parameters for placing an order
|
|
2321
|
-
* @returns Promise<
|
|
2321
|
+
* @returns Promise<{ order_id: number }>
|
|
2322
2322
|
*/
|
|
2323
2323
|
submitLoanOrder(params) {
|
|
2324
2324
|
return this.postPrivate(`/loan/collateral/orders`, { body: params });
|
|
@@ -2327,7 +2327,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2327
2327
|
* List Orders
|
|
2328
2328
|
*
|
|
2329
2329
|
* @param params Parameters for listing orders
|
|
2330
|
-
* @returns Promise<
|
|
2330
|
+
* @returns Promise<GetLoanOrdersResp[]>
|
|
2331
2331
|
*/
|
|
2332
2332
|
getLoanOrders(params) {
|
|
2333
2333
|
return this.getPrivate(`/loan/collateral/orders`, params);
|
|
@@ -2336,7 +2336,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2336
2336
|
* Get a single order
|
|
2337
2337
|
*
|
|
2338
2338
|
* @param params Parameters for retrieving a single order
|
|
2339
|
-
* @returns Promise<
|
|
2339
|
+
* @returns Promise<GetLoanOrdersResp>
|
|
2340
2340
|
*/
|
|
2341
2341
|
getLoanOrder(params) {
|
|
2342
2342
|
return this.getPrivate(`/loan/collateral/orders/${params.order_id}`);
|
|
@@ -2345,10 +2345,10 @@ export class RestClient extends BaseRestClient {
|
|
|
2345
2345
|
* Repayment
|
|
2346
2346
|
*
|
|
2347
2347
|
* @param params Parameters for repayment
|
|
2348
|
-
* @returns Promise<
|
|
2348
|
+
* @returns Promise<{
|
|
2349
2349
|
* repaid_principal: string;
|
|
2350
2350
|
* repaid_interest: string;
|
|
2351
|
-
* }
|
|
2351
|
+
* }>
|
|
2352
2352
|
*/
|
|
2353
2353
|
submitLoanRepay(params) {
|
|
2354
2354
|
return this.postPrivate(`/loan/collateral/repay`, { body: params });
|
|
@@ -2357,7 +2357,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2357
2357
|
* Repayment history
|
|
2358
2358
|
*
|
|
2359
2359
|
* @param params Parameters for retrieving repayment history
|
|
2360
|
-
* @returns Promise<
|
|
2360
|
+
* @returns Promise<GetLoanRepaymentHistoryResp[]>
|
|
2361
2361
|
*/
|
|
2362
2362
|
getLoanRepaymentHistory(params) {
|
|
2363
2363
|
return this.getPrivate(`/loan/collateral/repay_records`, params);
|
|
@@ -2366,7 +2366,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2366
2366
|
* Increase or redeem collateral
|
|
2367
2367
|
*
|
|
2368
2368
|
* @param params Parameters for increasing or redeeming collateral
|
|
2369
|
-
* @returns Promise<
|
|
2369
|
+
* @returns Promise<any>
|
|
2370
2370
|
*/
|
|
2371
2371
|
updateLoanCollateral(params) {
|
|
2372
2372
|
return this.postPrivate(`/loan/collateral/collaterals`, { body: params });
|
|
@@ -2375,7 +2375,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2375
2375
|
* Query collateral adjustment records
|
|
2376
2376
|
*
|
|
2377
2377
|
* @param params Parameters for querying collateral adjustment records
|
|
2378
|
-
* @returns Promise<
|
|
2378
|
+
* @returns Promise<GetLoanCollateralRecordsResp[]>
|
|
2379
2379
|
*/
|
|
2380
2380
|
getLoanCollateralRecords(params) {
|
|
2381
2381
|
return this.getPrivate(`/loan/collateral/collaterals`, params);
|
|
@@ -2383,10 +2383,10 @@ export class RestClient extends BaseRestClient {
|
|
|
2383
2383
|
/**
|
|
2384
2384
|
* Query the total borrowing and collateral amount for the user
|
|
2385
2385
|
*
|
|
2386
|
-
* @returns Promise<
|
|
2386
|
+
* @returns Promise<{
|
|
2387
2387
|
* borrow_amount: string;
|
|
2388
2388
|
* collateral_amount: string;
|
|
2389
|
-
* }
|
|
2389
|
+
* }>
|
|
2390
2390
|
*/
|
|
2391
2391
|
getLoanTotalAmount() {
|
|
2392
2392
|
return this.getPrivate(`/loan/collateral/total_amount`);
|
|
@@ -2395,7 +2395,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2395
2395
|
* Query user's collateralization ratio
|
|
2396
2396
|
*
|
|
2397
2397
|
* @param params Parameters for querying user's collateralization ratio
|
|
2398
|
-
* @returns Promise<
|
|
2398
|
+
* @returns Promise<GetLoanCollateralizationRatioResp>
|
|
2399
2399
|
*/
|
|
2400
2400
|
getLoanCollateralizationRatio(params) {
|
|
2401
2401
|
return this.getPrivate(`/loan/collateral/ltv`, params);
|
|
@@ -2404,10 +2404,10 @@ export class RestClient extends BaseRestClient {
|
|
|
2404
2404
|
* Query supported borrowing and collateral currencies
|
|
2405
2405
|
*
|
|
2406
2406
|
* @param params Parameters for querying supported borrowing and collateral currencies
|
|
2407
|
-
* @returns Promise<
|
|
2407
|
+
* @returns Promise<{
|
|
2408
2408
|
* loan_currency: string;
|
|
2409
2409
|
* collateral_currency: string[];
|
|
2410
|
-
* }[]
|
|
2410
|
+
* }[]>
|
|
2411
2411
|
*/
|
|
2412
2412
|
getLoanSupportedCurrencies(params) {
|
|
2413
2413
|
return this.get(`/loan/collateral/currencies`, params);
|
|
@@ -2420,7 +2420,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2420
2420
|
* Create Multi-Collateral Order
|
|
2421
2421
|
*
|
|
2422
2422
|
* @param params Parameters for creating a multi-collateral order
|
|
2423
|
-
* @returns Promise<
|
|
2423
|
+
* @returns Promise<{ order_id: number }>
|
|
2424
2424
|
*/
|
|
2425
2425
|
submitMultiLoanOrder(params) {
|
|
2426
2426
|
return this.postPrivate(`/loan/multi_collateral/orders`, { body: params });
|
|
@@ -2429,7 +2429,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2429
2429
|
* List Multi-Collateral Orders
|
|
2430
2430
|
*
|
|
2431
2431
|
* @param params Parameters for listing multi-collateral orders
|
|
2432
|
-
* @returns Promise<
|
|
2432
|
+
* @returns Promise<GetMultiLoanOrdersResp[]>
|
|
2433
2433
|
*/
|
|
2434
2434
|
getMultiLoanOrders(params) {
|
|
2435
2435
|
return this.getPrivate(`/loan/multi_collateral/orders`, params);
|
|
@@ -2438,7 +2438,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2438
2438
|
* Get Multi-Collateral Order Detail
|
|
2439
2439
|
*
|
|
2440
2440
|
* @param params Parameters for retrieving a multi-collateral order detail
|
|
2441
|
-
* @returns Promise<
|
|
2441
|
+
* @returns Promise<GetMultiLoanOrdersResp>
|
|
2442
2442
|
*/
|
|
2443
2443
|
getMultiLoanOrder(params) {
|
|
2444
2444
|
return this.getPrivate(`/loan/multi_collateral/orders/${params.order_id}`);
|
|
@@ -2447,7 +2447,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2447
2447
|
* Repay Multi-Collateral Loan
|
|
2448
2448
|
*
|
|
2449
2449
|
* @param params Parameters for repaying a multi-collateral loan
|
|
2450
|
-
* @returns Promise<
|
|
2450
|
+
* @returns Promise<RepayMultiLoanResp>
|
|
2451
2451
|
*/
|
|
2452
2452
|
repayMultiLoan(params) {
|
|
2453
2453
|
return this.postPrivate(`/loan/multi_collateral/repay`, { body: params });
|
|
@@ -2456,7 +2456,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2456
2456
|
* List Multi-Collateral Repay Records
|
|
2457
2457
|
*
|
|
2458
2458
|
* @param params Parameters for listing multi-collateral repay records
|
|
2459
|
-
* @returns Promise<
|
|
2459
|
+
* @returns Promise<GetMultiLoanRepayRecordsResp[]>
|
|
2460
2460
|
*/
|
|
2461
2461
|
getMultiLoanRepayRecords(params) {
|
|
2462
2462
|
return this.getPrivate(`/loan/multi_collateral/repay`, params);
|
|
@@ -2465,7 +2465,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2465
2465
|
* Operate Multi-Collateral
|
|
2466
2466
|
*
|
|
2467
2467
|
* @param params Parameters for operating multi-collateral
|
|
2468
|
-
* @returns Promise<
|
|
2468
|
+
* @returns Promise<UpdateMultiLoanResp>
|
|
2469
2469
|
*/
|
|
2470
2470
|
updateMultiLoan(params) {
|
|
2471
2471
|
return this.postPrivate(`/loan/multi_collateral/mortgage`, {
|
|
@@ -2476,7 +2476,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2476
2476
|
* Query collateral adjustment records
|
|
2477
2477
|
*
|
|
2478
2478
|
* @param params Parameters for querying collateral adjustment records
|
|
2479
|
-
* @returns Promise<
|
|
2479
|
+
* @returns Promise<GetMultiLoanAdjustmentRecordsResp[]>
|
|
2480
2480
|
*/
|
|
2481
2481
|
getMultiLoanAdjustmentRecords(params) {
|
|
2482
2482
|
return this.getPrivate(`/loan/multi_collateral/mortgage`, params);
|
|
@@ -2485,7 +2485,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2485
2485
|
* List User Currency Quota
|
|
2486
2486
|
*
|
|
2487
2487
|
* @param params Parameters for listing user currency quota
|
|
2488
|
-
* @returns Promise<
|
|
2488
|
+
* @returns Promise<GetMultiLoanCurrencyQuotaResp[]>
|
|
2489
2489
|
*/
|
|
2490
2490
|
getMultiLoanCurrencyQuota(params) {
|
|
2491
2491
|
return this.getPrivate(`/loan/multi_collateral/currency_quota`, params);
|
|
@@ -2493,7 +2493,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2493
2493
|
/**
|
|
2494
2494
|
* Query supported borrowing and collateral currencies in Multi-Collateral
|
|
2495
2495
|
*
|
|
2496
|
-
* @returns Promise<
|
|
2496
|
+
* @returns Promise<GetMultiLoanSupportedCurrenciesResp>
|
|
2497
2497
|
*/
|
|
2498
2498
|
getMultiLoanSupportedCurrencies() {
|
|
2499
2499
|
return this.get(`/loan/multi_collateral/currencies`);
|
|
@@ -2501,7 +2501,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2501
2501
|
/**
|
|
2502
2502
|
* Get Multi-Collateral ratio
|
|
2503
2503
|
*
|
|
2504
|
-
* @returns Promise<
|
|
2504
|
+
* @returns Promise<GetMultiLoanRatioResp>
|
|
2505
2505
|
*/
|
|
2506
2506
|
getMultiLoanRatio() {
|
|
2507
2507
|
return this.get(`/loan/multi_collateral/ltv`);
|
|
@@ -2509,7 +2509,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2509
2509
|
/**
|
|
2510
2510
|
* Query fixed interest rates for the currency for 7 days and 30 days
|
|
2511
2511
|
*
|
|
2512
|
-
* @returns Promise<
|
|
2512
|
+
* @returns Promise<GetMultiLoanFixedRatesResp[]>
|
|
2513
2513
|
*/
|
|
2514
2514
|
getMultiLoanFixedRates() {
|
|
2515
2515
|
return this.get(`/loan/multi_collateral/fixed_rate`);
|
|
@@ -2522,7 +2522,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2522
2522
|
* ETH2 swap
|
|
2523
2523
|
*
|
|
2524
2524
|
* @param params Parameters for ETH2 swap
|
|
2525
|
-
* @returns Promise<
|
|
2525
|
+
* @returns Promise<any>
|
|
2526
2526
|
*/
|
|
2527
2527
|
submitEth2Swap(params) {
|
|
2528
2528
|
return this.postPrivate(`/earn/staking/eth2/swap`, { body: params });
|
|
@@ -2530,7 +2530,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2530
2530
|
/**
|
|
2531
2531
|
* Dual Investment product list
|
|
2532
2532
|
*
|
|
2533
|
-
* @returns Promise<
|
|
2533
|
+
* @returns Promise<GetDualInvestmentProductsResp[]>
|
|
2534
2534
|
*/
|
|
2535
2535
|
getDualInvestmentProducts() {
|
|
2536
2536
|
return this.get(`/earn/dual/investment_plan`);
|
|
@@ -2538,7 +2538,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2538
2538
|
/**
|
|
2539
2539
|
* Dual Investment order list
|
|
2540
2540
|
*
|
|
2541
|
-
* @returns Promise<
|
|
2541
|
+
* @returns Promise<GetDualInvestmentOrdersResp[]>
|
|
2542
2542
|
*/
|
|
2543
2543
|
getDualInvestmentOrders() {
|
|
2544
2544
|
return this.getPrivate(`/earn/dual/orders`);
|
|
@@ -2547,7 +2547,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2547
2547
|
* Place Dual Investment order
|
|
2548
2548
|
*
|
|
2549
2549
|
* @param params Parameters for placing a dual investment order
|
|
2550
|
-
* @returns Promise<
|
|
2550
|
+
* @returns Promise<any>
|
|
2551
2551
|
*/
|
|
2552
2552
|
submitDualInvestmentOrder(params) {
|
|
2553
2553
|
return this.postPrivate(`/earn/dual/orders`, { body: params });
|
|
@@ -2556,7 +2556,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2556
2556
|
* Structured Product List
|
|
2557
2557
|
*
|
|
2558
2558
|
* @param params Parameters for listing structured products
|
|
2559
|
-
* @returns Promise<
|
|
2559
|
+
* @returns Promise<GetStructuredProductListResp[]>
|
|
2560
2560
|
*/
|
|
2561
2561
|
getStructuredProducts(params) {
|
|
2562
2562
|
return this.get(`/earn/structured/products`, params);
|
|
@@ -2565,7 +2565,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2565
2565
|
* Structured Product Order List
|
|
2566
2566
|
*
|
|
2567
2567
|
* @param params Parameters for listing structured product orders
|
|
2568
|
-
* @returns Promise<
|
|
2568
|
+
* @returns Promise<GetStructuredProductOrdersResp[]>
|
|
2569
2569
|
*/
|
|
2570
2570
|
getStructuredProductOrders(params) {
|
|
2571
2571
|
return this.getPrivate(`/earn/structured/orders`, params);
|
|
@@ -2574,7 +2574,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2574
2574
|
* Place Structured Product Order
|
|
2575
2575
|
*
|
|
2576
2576
|
* @param params Parameters for placing a structured product order
|
|
2577
|
-
* @returns Promise<
|
|
2577
|
+
* @returns Promise<any>
|
|
2578
2578
|
*/
|
|
2579
2579
|
submitStructuredProductOrder(params) {
|
|
2580
2580
|
return this.postPrivate(`/earn/structured/orders`, { body: params });
|
|
@@ -2586,7 +2586,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2586
2586
|
/**
|
|
2587
2587
|
* Get account detail
|
|
2588
2588
|
*
|
|
2589
|
-
* @returns Promise<
|
|
2589
|
+
* @returns Promise<GetAccountDetailResp>
|
|
2590
2590
|
*/
|
|
2591
2591
|
getAccountDetail() {
|
|
2592
2592
|
return this.getPrivate(`/account/detail`);
|
|
@@ -2595,7 +2595,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2595
2595
|
* Create STP Group
|
|
2596
2596
|
*
|
|
2597
2597
|
* @param params Parameters for creating an STP group
|
|
2598
|
-
* @returns Promise<
|
|
2598
|
+
* @returns Promise<CreateStpGroupResp>
|
|
2599
2599
|
*/
|
|
2600
2600
|
createStpGroup(params) {
|
|
2601
2601
|
return this.postPrivate(`/account/stp_groups`, { body: params });
|
|
@@ -2604,7 +2604,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2604
2604
|
* List STP Groups
|
|
2605
2605
|
*
|
|
2606
2606
|
* @param params Parameters for listing STP groups
|
|
2607
|
-
* @returns Promise<
|
|
2607
|
+
* @returns Promise<CreateStpGroupResp[]>
|
|
2608
2608
|
*/
|
|
2609
2609
|
getStpGroups(params) {
|
|
2610
2610
|
return this.getPrivate(`/account/stp_groups`, params);
|
|
@@ -2613,7 +2613,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2613
2613
|
* List users of the STP group
|
|
2614
2614
|
*
|
|
2615
2615
|
* @param params Parameters for listing users of the STP group
|
|
2616
|
-
* @returns Promise<
|
|
2616
|
+
* @returns Promise<StpResp[]>
|
|
2617
2617
|
*/
|
|
2618
2618
|
getStpGroupUsers(params) {
|
|
2619
2619
|
return this.getPrivate(`/account/stp_groups/${params.stp_id}/users`);
|
|
@@ -2622,7 +2622,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2622
2622
|
* Add users to the STP group
|
|
2623
2623
|
*
|
|
2624
2624
|
* @param params Parameters for adding users to the STP group
|
|
2625
|
-
* @returns Promise<
|
|
2625
|
+
* @returns Promise<StpResp[]>
|
|
2626
2626
|
*/
|
|
2627
2627
|
addUsersToStpGroup(params) {
|
|
2628
2628
|
const { stp_id, ...body } = params;
|
|
@@ -2634,7 +2634,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2634
2634
|
* Delete the user in the STP group
|
|
2635
2635
|
*
|
|
2636
2636
|
* @param params Parameters for deleting users from the STP group
|
|
2637
|
-
* @returns Promise<
|
|
2637
|
+
* @returns Promise<StpResp[]>
|
|
2638
2638
|
*/
|
|
2639
2639
|
deleteUserFromStpGroup(params) {
|
|
2640
2640
|
const { stp_id, ...query } = params;
|
|
@@ -2651,7 +2651,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2651
2651
|
* Record time range cannot exceed 30 days.
|
|
2652
2652
|
*
|
|
2653
2653
|
* @param params Parameters for retrieving transaction history
|
|
2654
|
-
* @returns Promise<
|
|
2654
|
+
* @returns Promise<GetAgencyTransactionHistoryResp>
|
|
2655
2655
|
*/
|
|
2656
2656
|
getAgencyTransactionHistory(params) {
|
|
2657
2657
|
return this.getPrivate('/rebate/agency/transaction_history', params);
|
|
@@ -2661,7 +2661,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2661
2661
|
* Record time range cannot exceed 30 days.
|
|
2662
2662
|
*
|
|
2663
2663
|
* @param params Parameters for retrieving commission history
|
|
2664
|
-
* @returns Promise<
|
|
2664
|
+
* @returns Promise<GetAgencyCommissionHistoryResp>
|
|
2665
2665
|
*/
|
|
2666
2666
|
getAgencyCommissionHistory(params) {
|
|
2667
2667
|
return this.getPrivate('/rebate/agency/commission_history', params);
|
|
@@ -2671,7 +2671,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2671
2671
|
* Record time range cannot exceed 30 days.
|
|
2672
2672
|
*
|
|
2673
2673
|
* @param params Parameters for retrieving commission rebate records
|
|
2674
|
-
* @returns Promise<
|
|
2674
|
+
* @returns Promise<GetBrokerCommissionHistoryResp>
|
|
2675
2675
|
*/
|
|
2676
2676
|
getBrokerCommissionHistory(params) {
|
|
2677
2677
|
return this.getPrivate('/rebate/broker/commission_history', params);
|
|
@@ -2681,7 +2681,7 @@ export class RestClient extends BaseRestClient {
|
|
|
2681
2681
|
* Record time range cannot exceed 30 days.
|
|
2682
2682
|
*
|
|
2683
2683
|
* @param params Parameters for retrieving trading history
|
|
2684
|
-
* @returns Promise<
|
|
2684
|
+
* @returns Promise<GetBrokerTransactionHistoryResp>
|
|
2685
2685
|
*/
|
|
2686
2686
|
getBrokerTransactionHistory(params) {
|
|
2687
2687
|
return this.getPrivate('/rebate/broker/transaction_history', params);
|