From d94e330979a003a621931b76030d57c90e618de2 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:32:00 +0200 Subject: [PATCH 1/2] fix(): Removed Response wrapped --- .gitignore | 1 + src/RestClient.ts | 1099 ++++++++++++++++++++------------------------- 2 files changed, 498 insertions(+), 602 deletions(-) diff --git a/.gitignore b/.gitignore index 8224b00..cece781 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ localtest.sh ws-private-spot-wsapi-performance.ts ws-private-perp-futures-wsapi-readonly.ts +privatetest.ts \ No newline at end of file diff --git a/src/RestClient.ts b/src/RestClient.ts index cf51247..919f367 100644 --- a/src/RestClient.ts +++ b/src/RestClient.ts @@ -318,7 +318,7 @@ export class RestClient extends BaseRestClient { return REST_CLIENT_TYPE_ENUM.main; } - getSystemMaintenanceStatus(): Promise> { + getSystemMaintenanceStatus(): Promise { return this.get('/v1/public/system_info'); } @@ -333,11 +333,9 @@ export class RestClient extends BaseRestClient { * Withdrawals to Gate addresses do not incur transaction fees. * * @param params Withdrawal parameters - * @returns Promise> + * @returns Promise */ - submitWithdrawal( - params: SubmitWithdrawalReq, - ): Promise> { + submitWithdrawal(params: SubmitWithdrawalReq): Promise { return this.postPrivate('/withdrawals', { query: params }); } @@ -345,11 +343,11 @@ export class RestClient extends BaseRestClient { * Cancel withdrawal with specified ID * * @param params Parameters containing the withdrawal ID - * @returns Promise> + * @returns Promise */ cancelWithdrawal(params: { withdrawal_id: string; - }): Promise> { + }): Promise { return this.deletePrivate(`/withdrawals/${params.withdrawal_id}`); } @@ -362,11 +360,9 @@ export class RestClient extends BaseRestClient { * List chains supported for specified currency * * @param params Parameters containing the currency name - * @returns Promise> + * @returns Promise< GetCurrencyChainsResp[][]> */ - getCurrencyChains(params: { - currency: string; - }): Promise> { + getCurrencyChains(params: { currency: string }): Promise { return this.get('/wallet/currency_chains', params); } @@ -374,11 +370,11 @@ export class RestClient extends BaseRestClient { * Generate currency deposit address * * @param params Parameters containing the currency name - * @returns Promise> + * @returns Promise */ createDepositAddress(params: { currency: string; - }): Promise> { + }): Promise { return this.getPrivate('/wallet/deposit_address', params); } @@ -388,11 +384,11 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days * * @param params Parameters for filtering withdrawal records - * @returns Promise> + * @returns Promise */ getWithdrawalRecords( params?: GetWithdrawalDepositRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/wallet/withdrawals', params); } @@ -402,11 +398,11 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days * * @param params Parameters for filtering deposit records - * @returns Promise> + * @returns Promise */ getDepositRecords( params?: GetWithdrawalDepositRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/wallet/deposits', params); } @@ -421,11 +417,9 @@ export class RestClient extends BaseRestClient { * - spot - options * * @param params Transfer parameters - * @returns Promise> + * @returns Promise */ - submitTransfer( - params: SubmitTransferReq, - ): Promise> { + submitTransfer(params: SubmitTransferReq): Promise<{ tx_id: number }> { return this.postPrivate('/wallet/transfers', { body: params }); } @@ -435,11 +429,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Transfer parameters - * @returns Promise> + * @returns Promise */ - submitMainSubTransfer( - params: SubmitMainSubTransferReq, - ): Promise> { + submitMainSubTransfer(params: SubmitMainSubTransferReq): Promise { return this.postPrivate('/wallet/sub_account_transfers', { body: params }); } @@ -451,11 +443,11 @@ export class RestClient extends BaseRestClient { * Note: only records after 2020-04-10 can be retrieved * * @param params Parameters for filtering transfer records - * @returns Promise> + * @returns Promise */ getMainSubTransfers( params?: GetMainSubTransfersReq, - ): Promise> { + ): Promise { return this.getPrivate('/wallet/sub_account_transfers', params); } @@ -465,11 +457,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Transfer parameters - * @returns Promise> + * @returns Promise */ - submitSubToSubTransfer( - params: SubmitSubToSubTransferReq, - ): Promise> { + submitSubToSubTransfer(params: SubmitSubToSubTransferReq): Promise { return this.postPrivate('/wallet/sub_account_to_sub_account', { body: params, }); @@ -479,11 +469,11 @@ export class RestClient extends BaseRestClient { * Retrieve withdrawal status * * @param params Parameters for retrieving withdrawal status - * @returns Promise> + * @returns Promise */ getWithdrawalStatus(params?: { currency?: string; - }): Promise> { + }): Promise { return this.getPrivate('/wallet/withdraw_status', params); } @@ -491,10 +481,10 @@ export class RestClient extends BaseRestClient { * Retrieve sub account balances * * @param params Parameters for retrieving sub account balances - * @returns Promise> + }[]> */ getSubBalance(params?: { sub_uid?: string }): Promise< APIResponse< @@ -511,7 +501,7 @@ export class RestClient extends BaseRestClient { * Query sub accounts' margin balances * * @param params Parameters for querying sub accounts' margin balances - * @returns Promise> + * @returns Promise */ getSubMarginBalances(params?: { sub_uid?: string; @@ -525,12 +515,12 @@ export class RestClient extends BaseRestClient { * Query sub accounts' futures account balances * * @param params Parameters for querying sub accounts' futures account balances - * @returns Promise> + * @returns Promise */ getSubFuturesBalances(params?: { sub_uid?: string; settle?: string; - }): Promise> { + }): Promise { return this.getPrivate('/wallet/sub_account_futures_balances', params); } @@ -538,11 +528,11 @@ export class RestClient extends BaseRestClient { * Query subaccount's cross_margin account info * * @param params Parameters for querying subaccount's cross_margin account info - * @returns Promise> + * @returns Promise */ getSubCrossMarginBalances(params?: { sub_uid?: string; - }): Promise> { + }): Promise { return this.getPrivate('/wallet/sub_account_cross_margin_balances', params); } @@ -550,11 +540,9 @@ export class RestClient extends BaseRestClient { * Query saved addresses * * @param params Parameters for querying saved address - * @returns Promise> + * @returns Promise */ - getSavedAddresses( - params: GetSavedAddressReq, - ): Promise> { + getSavedAddresses(params: GetSavedAddressReq): Promise { return this.getPrivate('/wallet/saved_address', params); } @@ -562,12 +550,12 @@ export class RestClient extends BaseRestClient { * Retrieve personal trading fee * * @param params Parameters for retrieving personal trading fee - * @returns Promise> + * @returns Promise */ getTradingFees(params?: { currency_pair?: string; settle?: 'BTC' | 'USDT' | 'USD'; - }): Promise> { + }): Promise { return this.getPrivate('/wallet/fee', params); } @@ -583,20 +571,18 @@ export class RestClient extends BaseRestClient { * - GET /futures/{settle}/accounts to query futures account balance * * @param params Parameters for retrieving total balances - * @returns Promise> + * @returns Promise */ - getBalances(params?: { - currency?: string; - }): Promise> { + getBalances(params?: { currency?: string }): Promise { return this.getPrivate('/wallet/total_balance', params); } /** * List small balance * - * @returns Promise> + * @returns Promise */ - getSmallBalances(): Promise> { + getSmallBalances(): Promise { return this.getPrivate('/wallet/small_balance'); } @@ -604,11 +590,9 @@ export class RestClient extends BaseRestClient { * Convert small balance * * @param params Parameters for converting small balance - * @returns Promise> + * @returns Promise */ - convertSmallBalance(params?: { - currency?: string[]; - }): Promise> { + convertSmallBalance(params?: { currency?: string[] }): Promise { return this.postPrivate('/wallet/small_balance', { body: params }); } @@ -616,11 +600,11 @@ export class RestClient extends BaseRestClient { * List small balance history * * @param params Parameters for listing small balance history - * @returns Promise> + * @returns Promise */ getSmallBalanceHistory( params?: GetSmallBalanceHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate('/wallet/small_balance_history', params); } @@ -633,11 +617,9 @@ export class RestClient extends BaseRestClient { * Create a new sub-account * * @param params Parameters for creating a new sub-account - * @returns Promise> + * @returns Promise */ - createSubAccount( - params: CreateSubAccountReq, - ): Promise> { + createSubAccount(params: CreateSubAccountReq): Promise { return this.postPrivate('/sub_accounts', { body: params }); } @@ -645,12 +627,10 @@ export class RestClient extends BaseRestClient { * List sub-accounts * * @param params Parameters for listing sub-accounts - * @returns Promise> + * @returns Promise */ - getSubAccounts(params?: { - type?: string; - }): Promise> { + getSubAccounts(params?: { type?: string }): Promise { return this.getPrivate('/sub_accounts', params); } @@ -658,9 +638,9 @@ export class RestClient extends BaseRestClient { * Get the sub-account * * @param params Parameters containing the sub-account user ID - * @returns Promise> + * @returns Promise */ - getSubAccount(params: { user_id: number }): Promise> { + getSubAccount(params: { user_id: number }): Promise { return this.getPrivate(`/sub_accounts/${params.user_id}`); } @@ -668,11 +648,11 @@ export class RestClient extends BaseRestClient { * Create API Key of the sub-account * * @param params Parameters for creating API Key of the sub-account - * @returns Promise> + * @returns Promise */ createSubAccountApiKey( params: CreateSubAccountApiKeyReq, - ): Promise> { + ): Promise { const { user_id, ...body } = params; return this.postPrivate(`/sub_accounts/${user_id}/keys`, { body: body }); } @@ -680,11 +660,11 @@ export class RestClient extends BaseRestClient { * List all API Key of the sub-account * * @param params Parameters containing the sub-account user ID - * @returns Promise> + * @returns Promise */ getSubAccountApiKeys(params: { user_id: number; - }): Promise> { + }): Promise { return this.getPrivate(`/sub_accounts/${params.user_id}/keys`); } @@ -692,11 +672,9 @@ export class RestClient extends BaseRestClient { * Update API key of the sub-account * * @param params Parameters for updating API key of the sub-account - * @returns Promise> + * @returns Promise */ - updateSubAccountApiKey( - params: UpdateSubAccountApiKeyReq, - ): Promise> { + updateSubAccountApiKey(params: UpdateSubAccountApiKeyReq): Promise { const { user_id, key, ...body } = params; return this.putPrivate(`/sub_accounts/${user_id}/keys/${key}`, { body }); } @@ -705,12 +683,12 @@ export class RestClient extends BaseRestClient { * Delete API key of the sub-account * * @param params Parameters for deleting API key of the sub-account - * @returns Promise> + * @returns Promise */ deleteSubAccountApiKey(params: { user_id: number; key: string; - }): Promise> { + }): Promise { return this.deletePrivate( `/sub_accounts/${params.user_id}/keys/${params.key}`, ); @@ -720,12 +698,12 @@ export class RestClient extends BaseRestClient { * Get the API Key of the sub-account * * @param params Parameters containing the sub-account user ID and API key - * @returns Promise> + * @returns Promise */ getSubAccountApiKey(params: { user_id: number; key: string; - }): Promise> { + }): Promise { return this.getPrivate( `/sub_accounts/${params.user_id}/keys/${params.key}`, ); @@ -735,9 +713,9 @@ export class RestClient extends BaseRestClient { * Lock the sub-account * * @param params Parameters containing the sub-account user ID - * @returns Promise> + * @returns Promise */ - lockSubAccount(params: { user_id: number }): Promise> { + lockSubAccount(params: { user_id: number }): Promise { return this.postPrivate(`/sub_accounts/${params.user_id}/lock`); } @@ -745,9 +723,9 @@ export class RestClient extends BaseRestClient { * Unlock the sub-account * * @param params Parameters containing the sub-account user ID - * @returns Promise> + * @returns Promise */ - unlockSubAccount(params: { user_id: number }): Promise> { + unlockSubAccount(params: { user_id: number }): Promise { return this.postPrivate(`/sub_accounts/${params.user_id}/unlock`); } /**========================================================================================================================== @@ -761,11 +739,11 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for retrieving unified account information - * @returns Promise> + * @returns Promise */ getUnifiedAccountInfo(params?: { currency?: string; - }): Promise> { + }): Promise { return this.getPrivate('/unified/accounts', params); } @@ -773,10 +751,10 @@ export class RestClient extends BaseRestClient { * Query about the maximum borrowing for the unified account * * @param params Parameters for querying the maximum borrowing for the unified account - * @returns Promise> + * }> */ getUnifiedMaxBorrow(params: { currency: string }): Promise< APIResponse<{ @@ -791,10 +769,10 @@ export class RestClient extends BaseRestClient { * Query about the maximum transferable for the unified account * * @param params Parameters for querying the maximum transferable for the unified account - * @returns Promise> + * }> */ getUnifiedMaxTransferable(params: { currency: string }): Promise< APIResponse<{ @@ -815,11 +793,11 @@ export class RestClient extends BaseRestClient { * For repayment, the option to repay the entire borrowed amount is available by setting the parameter repaid_all=true * * @param params Parameters for borrowing or repaying - * @returns Promise> + * @returns Promise */ submitUnifiedBorrowOrRepay( params: SubmitUnifiedBorrowOrRepayReq, - ): Promise> { + ): Promise { return this.postPrivate('/unified/loans', { body: params }); } @@ -827,11 +805,9 @@ export class RestClient extends BaseRestClient { * List loans * * @param params Parameters for listing loans - * @returns Promise> + * @returns Promise */ - getUnifiedLoans( - params?: GetUnifiedLoansReq, - ): Promise> { + getUnifiedLoans(params?: GetUnifiedLoansReq): Promise { return this.getPrivate('/unified/loans', params); } @@ -839,11 +815,11 @@ export class RestClient extends BaseRestClient { * Get loan records * * @param params Parameters for getting loan records - * @returns Promise> + * @returns Promise */ getUnifiedLoanRecords( params?: GetUnifiedLoanRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/unified/loan_records', params); } @@ -851,20 +827,20 @@ export class RestClient extends BaseRestClient { * List interest records * * @param params Parameters for listing interest records - * @returns Promise> + * @returns Promise */ getUnifiedInterestRecords( params?: GetUnifiedInterestRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/unified/interest_records', params); } /** * Retrieve user risk unit details, only valid in portfolio margin mode * - * @returns Promise> + * @returns Promise */ - getUnifiedRiskUnitDetails(): Promise> { + getUnifiedRiskUnitDetails(): Promise { return this.getPrivate('/unified/risk_units'); } @@ -874,26 +850,24 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for setting the mode of the unified account - * @returns Promise> + * @returns Promise */ - setUnifiedAccountMode( - params: SetUnifiedAccountModeReq, - ): Promise> { + setUnifiedAccountMode(params: SetUnifiedAccountModeReq): Promise { return this.putPrivate('/unified/unified_mode', { body: params }); } /** * Query mode of the unified account * - * @returns Promise> + * }> */ - getUnifiedAccountMode(): Promise> { + getUnifiedAccountMode(): Promise { return this.getPrivate('/unified/unified_mode'); } @@ -903,18 +877,18 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for querying estimate rates - * @returns Promise> + * @returns Promise<{ [key: string]: string }> */ getUnifiedEstimateRate(params: { currencies: string[]; - }): Promise> { + }): Promise<{ [key: string]: string }> { return this.getPrivate('/unified/estimate_rate', params); } /** * List currency discount tiers * - * @returns Promise> + * @returns Promise */ getUnifiedCurrencyDiscountTiers(): Promise< APIResponse @@ -928,11 +902,11 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for portfolio margin calculator - * @returns Promise> + * @returns Promise */ portfolioMarginCalculate( params: PortfolioMarginCalculatorReq, - ): Promise> { + ): Promise { return this.post('/unified/portfolio_calculator', { body: params }); } @@ -950,9 +924,9 @@ export class RestClient extends BaseRestClient { * * 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 _. * - * @returns Promise> + * @returns Promise */ - getSpotCurrencies(): Promise> { + getSpotCurrencies(): Promise { return this.get('/spot/currencies'); } @@ -960,20 +934,18 @@ export class RestClient extends BaseRestClient { * Get details of a specific currency * * @param params Parameters for retrieving details of a specific currency - * @returns Promise> + * @returns Promise */ - getSpotCurrency(params: { - currency: string; - }): Promise> { + getSpotCurrency(params: { currency: string }): Promise { return this.get(`/spot/currencies/${params.currency}`); } /** * List all currency pairs supported * - * @returns Promise> + * @returns Promise */ - getSpotCurrencyPairs(): Promise> { + getSpotCurrencyPairs(): Promise { return this.get('/spot/currency_pairs'); } @@ -981,11 +953,11 @@ export class RestClient extends BaseRestClient { * Get details of a specific currency pair * * @param params Parameters for retrieving details of a specific currency pair - * @returns Promise> + * @returns Promise */ getSpotCurrencyPair(params: { currency_pair: string; - }): Promise> { + }): Promise { return this.get(`/spot/currency_pairs/${params.currency_pair}`); } @@ -995,12 +967,12 @@ export class RestClient extends BaseRestClient { * Return only related data if currency_pair is specified; otherwise return all of them. * * @param params Parameters for retrieving ticker information - * @returns Promise> + * @returns Promise */ getSpotTicker(params?: { currency_pair?: string; timezone?: 'utc0' | 'utc8' | 'all'; - }): Promise> { + }): Promise { return this.get('/spot/tickers', params); } @@ -1010,11 +982,9 @@ export class RestClient extends BaseRestClient { * Order book will be sorted by price from high to low on bids; low to high on asks. * * @param params Parameters for retrieving order book - * @returns Promise> + * @returns Promise */ - getSpotOrderBook( - params: GetSpotOrderBookReq, - ): Promise> { + getSpotOrderBook(params: GetSpotOrderBookReq): Promise { return this.get('/spot/order_book', params); } @@ -1025,9 +995,9 @@ export class RestClient extends BaseRestClient { * Scrolling query using last_id is not recommended any more. If last_id is specified, time range query parameters will be ignored. * * @param params Parameters for retrieving market trades - * @returns Promise> + * @returns Promise */ - getSpotTrades(params: GetSpotTradesReq): Promise> { + getSpotTrades(params: GetSpotTradesReq): Promise { return this.get('/spot/trades', params); } @@ -1037,11 +1007,9 @@ export class RestClient extends BaseRestClient { * Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval. * * @param params Parameters for retrieving market Candles - * @returns Promise> + * @returns Promise */ - getSpotCandles( - params: GetSpotCandlesReq, - ): Promise> { + getSpotCandles(params: GetSpotCandlesReq): Promise { return this.get('/spot/Candles', params); } @@ -1051,11 +1019,9 @@ export class RestClient extends BaseRestClient { * This API is deprecated in favour of new fee retrieving API /wallet/fee. * * @param params Parameters for querying user trading fee rates - * @returns Promise> + * @returns Promise */ - getSpotFeeRates(params?: { - currency_pair?: string; - }): Promise> { + getSpotFeeRates(params?: { currency_pair?: string }): Promise { return this.getPrivate('/spot/fee', params); } @@ -1066,7 +1032,7 @@ export class RestClient extends BaseRestClient { */ getSpotBatchFeeRates(params: { currency_pairs: string; - }): Promise>> { + }): Promise> { return this.getPrivate('/spot/batch_fee', params); } @@ -1074,11 +1040,9 @@ export class RestClient extends BaseRestClient { * List spot accounts * * @param params Parameters for listing spot accounts - * @returns Promise> + * @returns Promise */ - getSpotAccounts(params?: { - currency?: string; - }): Promise> { + getSpotAccounts(params?: { currency?: string }): Promise { return this.getPrivate('/spot/accounts', params); } @@ -1088,11 +1052,11 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days. * * @param params Parameters for querying account book - * @returns Promise> + * @returns Promise */ getSpotAccountBook( params?: GetSpotAccountBookReq, - ): Promise> { + ): Promise { return this.getPrivate('/spot/account_book', params); } @@ -1105,11 +1069,11 @@ export class RestClient extends BaseRestClient { * - No mixture of spot orders and margin orders, i.e. account must be identical for all orders * * @param params Parameters for creating a batch of orders - * @returns Promise> + * @returns Promise */ submitSpotBatchOrders( params: SpotOrder[], - ): Promise> { + ): Promise { return this.postPrivate('/spot/batch_orders', { body: params }); } @@ -1121,13 +1085,13 @@ export class RestClient extends BaseRestClient { * Spot, portfolio, and margin orders are returned by default. To list cross margin orders, account must be set to cross_margin. * * @param params Parameters for listing all open orders - * @returns Promise> + * @returns Promise */ getSpotOpenOrders(params?: { page?: number; limit?: number; account?: 'spot' | 'margin' | 'cross_margin' | 'unified'; - }): Promise> { + }): Promise { return this.getPrivate('/spot/open_orders', params); } @@ -1137,11 +1101,11 @@ export class RestClient extends BaseRestClient { * 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 * * @param params Parameters for closing position when cross-currency is disabled - * @returns Promise> + * @returns Promise */ submitSpotClosePosCrossDisabled( params: SubmitSpotClosePosCrossDisabledReq, - ): Promise> { + ): Promise { return this.postPrivate('/spot/cross_liquidate_orders', { body: params }); } @@ -1151,9 +1115,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for creating an order - * @returns Promise> + * @returns Promise */ - submitSpotOrder(params: SubmitSpotOrderReq): Promise> { + submitSpotOrder(params: SubmitSpotOrderReq): Promise { return this.postPrivate('/spot/orders', { body: params }); } @@ -1163,9 +1127,9 @@ export class RestClient extends BaseRestClient { * Spot, portfolio and margin orders are returned by default. If cross margin orders are needed, account must be set to cross_margin. * * @param params Parameters for listing orders - * @returns Promise> + * @returns Promise */ - getSpotOrders(params: GetSpotOrdersReq): Promise> { + getSpotOrders(params: GetSpotOrdersReq): Promise { return this.getPrivate('/spot/orders', params); } @@ -1176,14 +1140,14 @@ export class RestClient extends BaseRestClient { * You can set account to cancel only orders within the specified account. * * @param params Parameters for cancelling all open orders in specified currency pair - * @returns Promise> + * @returns Promise */ cancelSpotOpenOrders(params: { currency_pair: string; side?: 'buy' | 'sell'; account?: 'spot' | 'margin' | 'cross_margin' | 'unified'; action_mode?: 'ACK' | 'RESULT' | 'FULL'; - }): Promise> { + }): Promise { return this.deletePrivate('/spot/orders', { query: params }); } @@ -1193,11 +1157,11 @@ export class RestClient extends BaseRestClient { * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request. * * @param params Parameters for cancelling a batch of orders - * @returns Promise> + * @returns Promise */ batchCancelSpotOrders( params: CancelSpotBatchOrdersReq[], - ): Promise> { + ): Promise { return this.postPrivate('/spot/cancel_batch_orders', { body: params }); } @@ -1207,9 +1171,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for getting a single order - * @returns Promise> + * @returns Promise */ - getSpotOrder(params: GetSpotOrderReq): Promise> { + getSpotOrder(params: GetSpotOrderReq): Promise { const { order_id, ...query } = params; return this.getPrivate(`/spot/orders/${order_id}`, query); } @@ -1222,9 +1186,9 @@ export class RestClient extends BaseRestClient { * Currently, only supports modification of price or amount fields. * * @param params Parameters for amending an order - * @returns Promise> + * @returns Promise */ - updateSpotOrder(params: UpdateSpotOrderReq): Promise> { + updateSpotOrder(params: UpdateSpotOrderReq): Promise { const { order_id, currency_pair, account, ...body } = params; const query = { @@ -1244,9 +1208,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for cancelling a single order - * @returns Promise> + * @returns Promise */ - cancelSpotOrder(params: DeleteSpotOrderReq): Promise> { + cancelSpotOrder(params: DeleteSpotOrderReq): Promise { const { order_id, ...query } = params; return this.deletePrivate(`/spot/orders/${order_id}`, { query: query, @@ -1261,20 +1225,20 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for listing personal trading history - * @returns Promise> + * @returns Promise */ getSpotTradingHistory( params?: GetSpotTradingHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate('/spot/my_trades', params); } /** * Get server current time * - * @returns Promise> + * }> */ getServerTime(): Promise< APIResponse<{ @@ -1290,9 +1254,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for setting countdown cancel orders - * @returns Promise> + * }> */ submitSpotCountdownOrders(params: { timeout: number; @@ -1311,11 +1275,11 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for batch modification of orders - * @returns Promise> + * @returns Promise */ batchUpdateSpotOrders( params: UpdateSpotBatchOrdersReq[], - ): Promise> { + ): Promise { return this.postPrivate('/spot/amend_batch_orders', { body: params }); } @@ -1323,9 +1287,9 @@ export class RestClient extends BaseRestClient { * Create a price-triggered order * * @param params Parameters for creating a price-triggered order - * @returns Promise> + * }> */ submitSpotPriceTriggerOrder(params: SpotPriceTriggeredOrder): Promise< APIResponse<{ @@ -1339,11 +1303,11 @@ export class RestClient extends BaseRestClient { * Retrieve running auto order list * * @param params Parameters for retrieving running auto order list - * @returns Promise> + * @returns Promise */ getSpotAutoOrders( params: GetSpotAutoOrdersReq, - ): Promise> { + ): Promise { return this.getPrivate('/spot/price_orders', params); } @@ -1351,12 +1315,12 @@ export class RestClient extends BaseRestClient { * Cancel all open orders * * @param params Parameters for cancelling all open orders - * @returns Promise> + * @returns Promise */ cancelAllOpenSpotOrders(params?: { market?: string; account?: 'normal' | 'margin' | 'cross_margin'; - }): Promise> { + }): Promise { return this.deletePrivate('/spot/price_orders', { query: params }); } @@ -1364,11 +1328,11 @@ export class RestClient extends BaseRestClient { * Get a price-triggered order * * @param params Parameters for getting a price-triggered order - * @returns Promise> + * @returns Promise */ getPriceTriggeredOrder(params: { order_id: string; - }): Promise> { + }): Promise { return this.getPrivate(`/spot/price_orders/${params.order_id}`); } @@ -1376,11 +1340,11 @@ export class RestClient extends BaseRestClient { * Cancel a price-triggered order * * @param params Parameters for cancelling a price-triggered order - * @returns Promise> + * @returns Promise */ cancelSpotTriggeredOrder(params: { order_id: string; - }): Promise> { + }): Promise { return this.deletePrivate(`/spot/price_orders/${params.order_id}`); } @@ -1393,11 +1357,11 @@ export class RestClient extends BaseRestClient { * Margin account list * * @param params Parameters for listing margin accounts - * @returns Promise> + * @returns Promise */ getMarginAccounts(params?: { currency_pair?: string; - }): Promise> { + }): Promise { return this.getPrivate('/margin/accounts', params); } @@ -1407,11 +1371,11 @@ export class RestClient extends BaseRestClient { * Only transferals from and to margin account are provided for now. Time range allows 30 days at most. * * @param params Parameters for listing margin account balance change history - * @returns Promise> + * @returns Promise */ getMarginBalanceHistory( params?: GetMarginBalanceHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/account_book', params); } @@ -1419,13 +1383,13 @@ export class RestClient extends BaseRestClient { * Funding account list * * @param params Parameters for listing funding accounts - * @returns Promise> + * }[]> */ getFundingAccounts(params?: { currency?: string }): Promise< APIResponse< @@ -1445,20 +1409,20 @@ export class RestClient extends BaseRestClient { * Update user's auto repayment setting * * @param params Parameters for updating auto repayment setting - * @returns Promise> + * @returns Promise<{ status: 'on' | 'off' }> */ updateAutoRepaymentSetting(params: { status: 'on' | 'off'; - }): Promise> { + }): Promise<{ status: 'on' | 'off' }> { return this.postPrivate('/margin/auto_repay', { query: params }); } /** * Retrieve user auto repayment setting * - * @returns Promise> + * @returns Promise<{ status: 'on' | 'off' }> */ - getAutoRepaymentSetting(): Promise> { + getAutoRepaymentSetting(): Promise<{ status: 'on' | 'off' }> { return this.getPrivate('/margin/auto_repay'); } @@ -1466,11 +1430,11 @@ export class RestClient extends BaseRestClient { * Get the max transferable amount for a specific margin currency * * @param params Parameters for retrieving the max transferable amount - * @returns Promise> + * }> */ getMarginTransferableAmount(params: { currency: string; @@ -1488,9 +1452,9 @@ export class RestClient extends BaseRestClient { /** * Currencies supported by cross margin * - * @returns Promise> + * @returns Promise */ - getCrossMarginCurrencies(): Promise> { + getCrossMarginCurrencies(): Promise { return this.get('/margin/cross/currencies'); } @@ -1498,20 +1462,20 @@ export class RestClient extends BaseRestClient { * Retrieve detail of one single currency supported by cross margin * * @param params Parameters containing the currency name - * @returns Promise> + * @returns Promise */ getCrossMarginCurrency(params: { currency: string; - }): Promise> { + }): Promise { return this.get(`/margin/cross/currencies/${params.currency}`); } /** * Retrieve cross margin account * - * @returns Promise> + * @returns Promise */ - getCrossMarginAccount(): Promise> { + getCrossMarginAccount(): Promise { return this.getPrivate('/margin/cross/accounts'); } @@ -1521,11 +1485,11 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days. * * @param params Parameters for retrieving cross margin account change history - * @returns Promise> + * @returns Promise */ getCrossMarginAccountHistory( params?: GetCrossMarginAccountHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/cross/account_book', params); } @@ -1535,11 +1499,11 @@ export class RestClient extends BaseRestClient { * Borrow amount cannot be less than currency minimum borrow amount. * * @param params Parameters for creating a cross margin borrow loan - * @returns Promise> + * @returns Promise */ submitCrossMarginBorrowLoan( params: SubmitCrossMarginBorrowLoanReq, - ): Promise> { + ): Promise { return this.postPrivate('/margin/cross/loans', { body: params }); } @@ -1549,11 +1513,11 @@ export class RestClient extends BaseRestClient { * Sort by creation time in descending order by default. Set reverse=false to return ascending results. * * @param params Parameters for listing cross margin borrow history - * @returns Promise> + * @returns Promise */ getCrossMarginBorrowHistory( params: GetCrossMarginBorrowHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/cross/loans', params); } @@ -1561,11 +1525,11 @@ export class RestClient extends BaseRestClient { * Retrieve single borrow loan detail * * @param params Parameters containing the borrow loan ID - * @returns Promise> + * @returns Promise */ getCrossMarginBorrowLoan(params: { loan_id: string; - }): Promise> { + }): Promise { return this.getPrivate(`/margin/cross/loans/${params.loan_id}`); } /** @@ -1574,12 +1538,12 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for cross margin repayments - * @returns Promise> + * @returns Promise */ submitCrossMarginRepayment(params: { currency: string; amount: string; - }): Promise> { + }): Promise { return this.postPrivate('/margin/cross/repayments', { body: params }); } @@ -1589,11 +1553,11 @@ export class RestClient extends BaseRestClient { * Sort by creation time in descending order by default. Set reverse=false to return ascending results. * * @param params Parameters for retrieving cross margin repayments - * @returns Promise> + * @returns Promise */ getCrossMarginRepayments( params?: GetCrossMarginRepaymentsReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/cross/repayments', params); } @@ -1601,11 +1565,11 @@ export class RestClient extends BaseRestClient { * Interest records for the cross margin account * * @param params Parameters for retrieving interest records - * @returns Promise> + * @returns Promise */ getCrossMarginInterestRecords( params?: GetCrossMarginInterestRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/cross/interest_records', params); } @@ -1613,10 +1577,10 @@ export class RestClient extends BaseRestClient { * Get the max transferable amount for a specific cross margin currency * * @param params Parameters for retrieving the max transferable amount - * @returns Promise> + * }> */ getCrossMarginTransferableAmount(params: { currency: string }): Promise< APIResponse<{ @@ -1633,11 +1597,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for retrieving estimated interest rates - * @returns Promise> + * @returns Promise */ - getEstimatedInterestRates(params: { - currencies: string[]; - }): Promise> { + getEstimatedInterestRates(params: { currencies: string[] }): Promise { return this.getPrivate('/margin/cross/estimate_rate', params); } @@ -1645,10 +1607,10 @@ export class RestClient extends BaseRestClient { * Get the max borrowable amount for a specific cross margin currency * * @param params Parameters for retrieving the max borrowable amount - * @returns Promise> + * }> */ getCrossMarginBorrowableAmount(params: { currency: string }): Promise< APIResponse<{ @@ -1666,9 +1628,9 @@ export class RestClient extends BaseRestClient { /** * List lending markets * - * @returns Promise> + * @returns Promise */ - getLendingMarkets(): Promise> { + getLendingMarkets(): Promise { return this.get('/margin/uni/currency_pairs'); } @@ -1676,16 +1638,14 @@ export class RestClient extends BaseRestClient { * Get detail of lending market * * @param params Parameters containing the currency pair - * @returns Promise> + * }> */ - getLendingMarket(params: { - currency_pair: string; - }): Promise> { + getLendingMarket(params: { currency_pair: string }): Promise { return this.get(`/margin/uni/currency_pairs/${params.currency_pair}`); } @@ -1695,11 +1655,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for retrieving estimated interest rates - * @returns Promise> + * @returns Promise */ - getEstimatedInterestRate(params: { - currencies: string[]; - }): Promise> { + getEstimatedInterestRate(params: { currencies: string[] }): Promise { return this.getPrivate('/margin/uni/estimate_rate', params); } @@ -1723,11 +1681,9 @@ export class RestClient extends BaseRestClient { * List loans * * @param params Parameters for listing loans - * @returns Promise> + * @returns Promise */ - getMarginUNILoans( - params?: GetMarginUNILoansReq, - ): Promise> { + getMarginUNILoans(params?: GetMarginUNILoansReq): Promise { return this.getPrivate('/margin/uni/loans', params); } @@ -1735,11 +1691,11 @@ export class RestClient extends BaseRestClient { * Get loan records * * @param params Parameters for retrieving loan records - * @returns Promise> + * @returns Promise */ getMarginUNILoanRecords( params?: GetMarginUNILoanRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/uni/loan_records', params); } @@ -1747,11 +1703,11 @@ export class RestClient extends BaseRestClient { * List interest records * * @param params Parameters for listing interest records - * @returns Promise> + * @returns Promise */ getMarginUNIInterestRecords( params?: GetMarginUNIInterestRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/uni/interest_records', params); } @@ -1759,11 +1715,11 @@ export class RestClient extends BaseRestClient { * Get maximum borrowable * * @param params Parameters for retrieving the maximum borrowable amount - * @returns Promise> + * @returns Promise */ getMarginUNIMaxBorrow( params: GetMarginUNIMaxBorrowReq, - ): Promise> { + ): Promise { return this.getPrivate('/margin/uni/borrowable', params); } /**========================================================================================================================== @@ -1775,11 +1731,11 @@ export class RestClient extends BaseRestClient { * List All Supported Currency Pairs In Flash Swap * * @param params Parameters for retrieving data of the specified currency - * @returns Promise> + * @returns Promise */ getFlashSwapCurrencyPairs(params?: { currency?: string; - }): Promise> { + }): Promise { return this.get('/flash_swap/currency_pairs', params); } @@ -1789,11 +1745,11 @@ export class RestClient extends BaseRestClient { * Initiate a flash swap preview in advance because order creation requires a preview result. * * @param params Parameters for creating a flash swap order - * @returns Promise> + * @returns Promise */ submitFlashSwapOrder( params: SubmitFlashSwapOrderReq, - ): Promise> { + ): Promise { return this.postPrivate('/flash_swap/orders', { body: params }); } @@ -1801,11 +1757,11 @@ export class RestClient extends BaseRestClient { * List all flash swap orders * * @param params Parameters for listing flash swap orders - * @returns Promise> + * @returns Promise */ getFlashSwapOrders( params?: GetFlashSwapOrdersReq, - ): Promise> { + ): Promise { return this.getPrivate('/flash_swap/orders', params); } @@ -1813,11 +1769,9 @@ export class RestClient extends BaseRestClient { * Get a single flash swap order's detail * * @param params Parameters containing the flash swap order ID - * @returns Promise> + * @returns Promise */ - getFlashSwapOrder(params: { - order_id: number; - }): Promise> { + getFlashSwapOrder(params: { order_id: number }): Promise { return this.getPrivate(`/flash_swap/orders/${params.order_id}`); } @@ -1825,11 +1779,11 @@ export class RestClient extends BaseRestClient { * Initiate a flash swap order preview * * @param params Parameters for initiating a flash swap order preview - * @returns Promise> + * @returns Promise */ submitFlashSwapOrderPreview( params: SubmitFlashSwapOrderPreviewReq, - ): Promise> { + ): Promise { return this.postPrivate('/flash_swap/orders/preview', { body: params }); } @@ -1842,13 +1796,13 @@ export class RestClient extends BaseRestClient { * List all futures contracts * * @param params Parameters for listing futures contracts - * @returns Promise> + * @returns Promise */ getFuturesContracts(params: { settle: 'btc' | 'usdt' | 'usd'; limit?: number; offset?: number; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/contracts`, query); } @@ -1857,12 +1811,12 @@ export class RestClient extends BaseRestClient { * Get a single contract * * @param params Parameters for retrieving a single contract - * @returns Promise> + * @returns Promise */ getFuturesContract(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; - }): Promise> { + }): Promise { return this.get(`/futures/${params.settle}/contracts/${params.contract}`); } @@ -1872,11 +1826,11 @@ export class RestClient extends BaseRestClient { * Bids will be sorted by price from high to low, while asks sorted reversely. * * @param params Parameters for retrieving the futures order book - * @returns Promise> + * @returns Promise */ getFuturesOrderBook( params: GetFuturesOrderBookReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/order_book`, query); } @@ -1885,11 +1839,9 @@ export class RestClient extends BaseRestClient { * Futures trading history * * @param params Parameters for retrieving futures trading history - * @returns Promise> + * @returns Promise */ - getFuturesTrades( - params: GetFuturesTradesReq, - ): Promise> { + getFuturesTrades(params: GetFuturesTradesReq): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/trades`, query); } @@ -1902,11 +1854,9 @@ export class RestClient extends BaseRestClient { * Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval. * * @param params Parameters for retrieving futures Candles - * @returns Promise> + * @returns Promise */ - getFuturesCandles( - params: GetFuturesCandlesReq, - ): Promise> { + getFuturesCandles(params: GetFuturesCandlesReq): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/Candles`, query); } @@ -1917,11 +1867,11 @@ export class RestClient extends BaseRestClient { * Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval. * * @param params Parameters for retrieving premium index K-Line - * @returns Promise> + * @returns Promise */ getPremiumIndexKLines( params: GetFuturesCandlesReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/premium_index`, query); } @@ -1930,12 +1880,12 @@ export class RestClient extends BaseRestClient { * List futures tickers * * @param params Parameters for listing futures tickers - * @returns Promise> + * @returns Promise */ getFuturesTickers(params: { settle: 'btc' | 'usdt' | 'usd'; contract?: string; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/tickers`, query); } @@ -1944,10 +1894,10 @@ export class RestClient extends BaseRestClient { * Funding rate history * * @param params Parameters for retrieving funding rate history - * @returns Promise> + * }[]> */ getFundingRates(params: { settle: 'btc' | 'usdt' | 'usd'; @@ -1969,10 +1919,10 @@ export class RestClient extends BaseRestClient { * Futures insurance balance history * * @param params Parameters for retrieving futures insurance balance history - * @returns Promise> + * }[]> */ getFuturesInsuranceBalanceHistory(params: { settle: 'btc' | 'usdt' | 'usd'; @@ -1993,11 +1943,9 @@ export class RestClient extends BaseRestClient { * Futures stats * * @param params Parameters for retrieving futures stats - * @returns Promise> + * @returns Promise */ - getFuturesStats( - params: GetFuturesStatsReq, - ): Promise> { + getFuturesStats(params: GetFuturesStatsReq): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/contract_stats`, query); } @@ -2006,12 +1954,12 @@ export class RestClient extends BaseRestClient { * Get index constituents * * @param params Parameters for retrieving index constituents - * @returns Promise> + * @returns Promise */ getIndexConstituents(params: { settle: 'btc' | 'usdt' | 'usd'; index: string; - }): Promise> { + }): Promise { return this.get( `/futures/${params.settle}/index_constituents/${params.index}`, ); @@ -2023,11 +1971,11 @@ export class RestClient extends BaseRestClient { * Interval between from and to cannot exceed 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail. * * @param params Parameters for retrieving liquidation history - * @returns Promise> + * @returns Promise */ getLiquidationHistory( params: GetLiquidationHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/liq_orders`, query); } @@ -2040,11 +1988,9 @@ export class RestClient extends BaseRestClient { * This only takes effect when the 'contract' parameter is empty. * * @param params Parameters for listing risk limit tiers - * @returns Promise> + * @returns Promise */ - getRiskLimitTiers( - params: GetRiskLimitTiersReq, - ): Promise> { + getRiskLimitTiers(params: GetRiskLimitTiersReq): Promise { const { settle, ...query } = params; return this.get(`/futures/${settle}/risk_limit_tiers`, query); } @@ -2053,11 +1999,11 @@ export class RestClient extends BaseRestClient { * Query futures account * * @param params Parameters for querying futures account - * @returns Promise> + * @returns Promise */ getFuturesAccount(params: { settle: 'btc' | 'usdt' | 'usd'; - }): Promise> { + }): Promise { return this.getPrivate(`/futures/${params.settle}/accounts`); } @@ -2067,11 +2013,11 @@ export class RestClient extends BaseRestClient { * If the contract field is provided, it can only filter records that include this field after 2023-10-30. * * @param params Parameters for querying account book - * @returns Promise> + * @returns Promise */ getFuturesAccountBook( params: GetFuturesAccountBookReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/account_book`, query); } @@ -2080,11 +2026,11 @@ export class RestClient extends BaseRestClient { * List all positions of a user * * @param params Parameters for listing all positions of a user - * @returns Promise> + * @returns Promise */ getFuturesPositions( params: GetFuturesPositionsReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/positions`, query); } @@ -2092,12 +2038,12 @@ export class RestClient extends BaseRestClient { * Get single position * * @param params Parameters for retrieving a single position - * @returns Promise> + * @returns Promise */ getFuturesPosition(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; - }): Promise> { + }): Promise { return this.getPrivate( `/futures/${params.settle}/positions/${params.contract}`, ); @@ -2107,13 +2053,13 @@ export class RestClient extends BaseRestClient { * Update position margin * * @param params Parameters for updating position margin - * @returns Promise> + * @returns Promise */ updateFuturesMargin(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; change: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate(`/futures/${settle}/positions/${contract}/margin`, { query: query, @@ -2124,14 +2070,14 @@ export class RestClient extends BaseRestClient { * Update position leverage * * @param params Parameters for updating position leverage - * @returns Promise> + * @returns Promise */ updateFuturesLeverage(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; leverage: string; cross_leverage_limit?: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/futures/${settle}/positions/${contract}/leverage`, @@ -2143,13 +2089,13 @@ export class RestClient extends BaseRestClient { * Update position risk limit * * @param params Parameters for updating position risk limit - * @returns Promise> + * @returns Promise */ updatePositionRiskLimit(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; risk_limit: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/futures/${settle}/positions/${contract}/risk_limit`, @@ -2163,12 +2109,12 @@ export class RestClient extends BaseRestClient { * Before setting dual mode, make sure all positions are closed and no orders are open. * * @param params Parameters for enabling or disabling dual mode - * @returns Promise> + * @returns Promise */ updateFuturesDualMode(params: { settle: 'btc' | 'usdt' | 'usd'; dual_mode: boolean; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.postPrivate(`/futures/${settle}/dual_mode`, { query: query, @@ -2179,12 +2125,12 @@ export class RestClient extends BaseRestClient { * Retrieve position detail in dual mode * * @param params Parameters for retrieving position detail in dual mode - * @returns Promise> + * @returns Promise */ getDualModePosition(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; - }): Promise> { + }): Promise { return this.getPrivate( `/futures/${params.settle}/dual_comp/positions/${params.contract}`, ); @@ -2194,11 +2140,11 @@ export class RestClient extends BaseRestClient { * Update position margin in dual mode * * @param params Parameters for updating position margin in dual mode - * @returns Promise> + * @returns Promise */ updateDualModePositionMargin( params: UpdateDualModePositionMarginReq, - ): Promise> { + ): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/futures/${settle}/dual_comp/positions/${contract}/margin`, @@ -2210,11 +2156,11 @@ export class RestClient extends BaseRestClient { * Update position leverage in dual mode * * @param params Parameters for updating position leverage in dual mode - * @returns Promise> + * @returns Promise */ updateDualModePositionLeverage( params: UpdateDualModePositionLeverageReq, - ): Promise> { + ): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/futures/${settle}/dual_comp/positions/${contract}/leverage`, @@ -2226,13 +2172,13 @@ export class RestClient extends BaseRestClient { * Update position risk limit in dual mode * * @param params Parameters for updating position risk limit in dual mode - * @returns Promise> + * @returns Promise */ updateDualModePositionRiskLimit(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; risk_limit: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/futures/${settle}/dual_comp/positions/${contract}/risk_limit`, @@ -2251,11 +2197,9 @@ export class RestClient extends BaseRestClient { * Set stp_act to decide the strategy of self-trade prevention. For detailed usage, refer to the stp_act parameter in the request body. * * @param params Parameters for creating a futures order - * @returns Promise> + * @returns Promise */ - submitFuturesOrder( - params: SubmitFuturesOrderReq, - ): Promise> { + submitFuturesOrder(params: SubmitFuturesOrderReq): Promise { const { settle, ...body } = params; return this.postPrivate(`/futures/${settle}/orders`, { body: body }); } @@ -2267,11 +2211,9 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for listing futures orders - * @returns Promise> + * @returns Promise */ - getFuturesOrders( - params: GetFuturesOrdersReq, - ): Promise> { + getFuturesOrders(params: GetFuturesOrdersReq): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/orders`, query); } @@ -2282,11 +2224,11 @@ export class RestClient extends BaseRestClient { * Zero-filled order cannot be retrieved 10 minutes after order cancellation. * * @param params Parameters for cancelling all open orders matched - * @returns Promise> + * @returns Promise */ cancelAllFuturesOrders( params: DeleteAllFuturesOrdersReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.deletePrivate(`/futures/${settle}/orders`, { query: query, @@ -2297,11 +2239,11 @@ export class RestClient extends BaseRestClient { * List Futures Orders By Time Range * * @param params Parameters for listing futures orders by time range - * @returns Promise> + * @returns Promise */ getFuturesOrdersByTimeRange( params: GetFuturesOrdersByTimeRangeReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/orders_timerange`, query); } @@ -2318,12 +2260,12 @@ export class RestClient extends BaseRestClient { * In the rate limiting, each order is counted individually. * * @param params Parameters for creating a batch of futures orders - * @returns Promise> + * @returns Promise */ submitFuturesBatchOrders(params: { settle: 'btc' | 'usdt' | 'usd'; orders: SubmitFuturesOrderReq[]; - }): Promise> { + }): Promise { const { settle, orders } = params; return this.postPrivate(`/futures/${settle}/batch_orders`, { body: orders, @@ -2337,12 +2279,12 @@ export class RestClient extends BaseRestClient { * Historical orders, by default, only data within the past 6 months is supported. * * @param params Parameters for retrieving a single order - * @returns Promise> + * @returns Promise */ getFuturesOrder(params: { settle: 'btc' | 'usdt' | 'usd'; order_id: string; - }): Promise> { + }): Promise { return this.getPrivate( `/futures/${params.settle}/orders/${params.order_id}`, ); @@ -2352,12 +2294,12 @@ export class RestClient extends BaseRestClient { * Cancel a single order * * @param params Parameters for cancelling a single order - * @returns Promise> + * @returns Promise */ cancelFuturesOrder(params: { settle: 'btc' | 'usdt' | 'usd'; order_id: string; - }): Promise> { + }): Promise { return this.deletePrivate( `/futures/${params.settle}/orders/${params.order_id}`, ); @@ -2367,11 +2309,9 @@ export class RestClient extends BaseRestClient { * Amend an order * * @param params Parameters for amending an order - * @returns Promise> + * @returns Promise */ - updateFuturesOrder( - params: UpdateFuturesOrderReq, - ): Promise> { + updateFuturesOrder(params: UpdateFuturesOrderReq): Promise { const { settle, order_id, ...body } = params; return this.putPrivate(`/futures/${settle}/orders/${order_id}`, { body: body, @@ -2384,11 +2324,11 @@ export class RestClient extends BaseRestClient { * 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. * * @param params Parameters for listing personal trading history - * @returns Promise> + * @returns Promise */ getFuturesTradingHistory( params: GetFuturesTradingHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/my_trades`, query); } @@ -2397,11 +2337,11 @@ export class RestClient extends BaseRestClient { * List position close history * * @param params Parameters for listing position close history - * @returns Promise> + * @returns Promise */ getFuturesPositionHistory( params: GetFuturesPositionHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/position_close`, query); } @@ -2410,11 +2350,11 @@ export class RestClient extends BaseRestClient { * List liquidation history * * @param params Parameters for listing liquidation history - * @returns Promise> + * @returns Promise */ getFuturesLiquidationHistory( params: GetFuturesLiquidationHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/liquidates`, query); } @@ -2423,11 +2363,11 @@ export class RestClient extends BaseRestClient { * List Auto-Deleveraging History * * @param params Parameters for listing auto-deleveraging history - * @returns Promise> + * @returns Promise */ getFuturesAutoDeleveragingHistory( params: GetFuturesLiquidationHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/auto_deleverages`, query); } @@ -2440,13 +2380,13 @@ export class RestClient extends BaseRestClient { * If the timeout is set to 0 within 30 seconds, the countdown timer will expire and the cancel function will be cancelled. * * @param params Parameters for setting countdown cancel orders - * @returns Promise> + * @returns Promise<{ triggerTime: number }> */ setFuturesOrderCancelCountdown(params: { settle: 'btc' | 'usdt' | 'usd'; timeout: number; contract?: string; - }): Promise> { + }): Promise<{ triggerTime: number }> { const { settle, ...body } = params; return this.postPrivate(`/futures/${settle}/countdown_cancel_all`, { body: body, @@ -2457,12 +2397,12 @@ export class RestClient extends BaseRestClient { * Query user trading fee rates * * @param params Parameters for querying user trading fee rates - * @returns Promise>> + * @returns Promise */ getFuturesUserTradingFees(params: { settle: 'btc' | 'usdt' | 'usd'; contract?: string; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/fee`, query); } @@ -2473,12 +2413,12 @@ export class RestClient extends BaseRestClient { * Multiple distinct order ID list can be specified. Each request can cancel a maximum of 20 records. * * @param params Parameters for cancelling a batch of orders with an ID list - * @returns Promise> + * @returns Promise */ batchCancelFuturesOrders(params: { settle: 'btc' | 'usdt' | 'usd'; orderIds: string[]; - }): Promise> { + }): Promise { const { settle, ...orderIds } = params; return this.postPrivate(`/futures/${settle}/batch_cancel_orders`, { body: orderIds, @@ -2489,11 +2429,11 @@ export class RestClient extends BaseRestClient { * Create a price-triggered order * * @param params Parameters for creating a price-triggered order - * @returns Promise> + * @returns Promise<{ id: number }> */ submitFuturesPriceTriggeredOrder( params: SubmitFuturesTriggeredOrderReq, - ): Promise> { + ): Promise<{ id: number }> { const { settle, ...body } = params; return this.postPrivate(`/futures/${settle}/price_orders`, { body: body }); } @@ -2502,11 +2442,11 @@ export class RestClient extends BaseRestClient { * List all auto orders * * @param params Parameters for listing all auto orders - * @returns Promise> + * @returns Promise */ getFuturesAutoOrders( params: GetFuturesAutoOrdersReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/futures/${settle}/price_orders`, query); } @@ -2515,12 +2455,12 @@ export class RestClient extends BaseRestClient { * Cancel all open orders * * @param params Parameters for cancelling all open orders - * @returns Promise> + * @returns Promise */ cancelAllOpenFuturesOrders(params: { settle: 'btc' | 'usdt' | 'usd'; contract: string; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.deletePrivate(`/futures/${settle}/price_orders`, { query: query, @@ -2531,12 +2471,12 @@ export class RestClient extends BaseRestClient { * Get a price-triggered order * * @param params Parameters for retrieving a price-triggered order - * @returns Promise> + * @returns Promise */ getFuturesPriceTriggeredOrder(params: { settle: 'btc' | 'usdt' | 'usd'; order_id: string; - }): Promise> { + }): Promise { return this.getPrivate( `/futures/${params.settle}/price_orders/${params.order_id}`, ); @@ -2546,12 +2486,12 @@ export class RestClient extends BaseRestClient { * Cancel a price-triggered order * * @param params Parameters for cancelling a price-triggered order - * @returns Promise> + * @returns Promise */ cancelFuturesPriceTriggeredOrder(params: { settle: 'btc' | 'usdt' | 'usd'; order_id: string; - }): Promise> { + }): Promise { return this.deletePrivate( `/futures/${params.settle}/price_orders/${params.order_id}`, ); @@ -2566,11 +2506,11 @@ export class RestClient extends BaseRestClient { * List all futures contracts * * @param params Parameters for listing all futures contracts - * @returns Promise> + * @returns Promise */ getAllDeliveryContracts(params: { settle: 'usdt'; - }): Promise> { + }): Promise { return this.get(`/delivery/${params.settle}/contracts`); } @@ -2578,12 +2518,12 @@ export class RestClient extends BaseRestClient { * Get a single contract * * @param params Parameters for retrieving a single contract - * @returns Promise> + * @returns Promise */ getDeliveryContract(params: { settle: 'usdt'; contract: string; - }): Promise> { + }): Promise { return this.get(`/delivery/${params.settle}/contracts/${params.contract}`); } @@ -2593,11 +2533,11 @@ export class RestClient extends BaseRestClient { * Bids will be sorted by price from high to low, while asks sorted reversely * * @param params Parameters for retrieving the futures order book - * @returns Promise> + * @returns Promise */ getDeliveryOrderBook( params: GetDeliveryOrderBookReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.get(`/delivery/${settle}/order_book`, query); } @@ -2606,11 +2546,9 @@ export class RestClient extends BaseRestClient { * Futures trading history * * @param params Parameters for retrieving the futures trading history - * @returns Promise> + * @returns Promise */ - getDeliveryTrades( - params: GetDeliveryTradesReq, - ): Promise> { + getDeliveryTrades(params: GetDeliveryTradesReq): Promise { const { settle, ...query } = params; return this.get(`/delivery/${settle}/trades`, query); } @@ -2622,11 +2560,9 @@ export class RestClient extends BaseRestClient { * Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval. * * @param params Parameters for retrieving futures Candles - * @returns Promise> + * @returns Promise */ - getDeliveryCandles( - params: GetDeliveryCandlesReq, - ): Promise> { + getDeliveryCandles(params: GetDeliveryCandlesReq): Promise { const { settle, ...query } = params; return this.get(`/delivery/${settle}/Candles`, query); } @@ -2635,12 +2571,12 @@ export class RestClient extends BaseRestClient { * List futures tickers * * @param params Parameters for listing futures tickers - * @returns Promise> + * @returns Promise */ getDeliveryTickers(params: { settle: 'usdt'; contract?: string; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.get(`/delivery/${settle}/tickers`, query); } @@ -2649,10 +2585,10 @@ export class RestClient extends BaseRestClient { * Futures insurance balance history * * @param params Parameters for retrieving the futures insurance balance history - * @returns Promise> + * }[]> */ getDeliveryInsuranceBalanceHistory(params: { settle: 'usdt'; @@ -2673,11 +2609,9 @@ export class RestClient extends BaseRestClient { * Query futures account * * @param params Parameters for querying futures account - * @returns Promise> + * @returns Promise */ - getDeliveryAccount(params: { - settle: 'usdt'; - }): Promise> { + getDeliveryAccount(params: { settle: 'usdt' }): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/accounts`, query); } @@ -2686,11 +2620,9 @@ export class RestClient extends BaseRestClient { * Query account book * * @param params Parameters for querying account book - * @returns Promise> + * @returns Promise */ - getDeliveryBook( - params: GetDeliveryBookReq, - ): Promise> { + getDeliveryBook(params: GetDeliveryBookReq): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/account_book`, query); } @@ -2699,11 +2631,9 @@ export class RestClient extends BaseRestClient { * List all positions of a user * * @param params Parameters for listing all positions of a user - * @returns Promise> + * @returns Promise */ - getDeliveryPositions(params: { - settle: 'usdt'; - }): Promise> { + getDeliveryPositions(params: { settle: 'usdt' }): Promise { return this.getPrivate(`/delivery/${params.settle}/positions`); } @@ -2711,12 +2641,12 @@ export class RestClient extends BaseRestClient { * Get single position * * @param params Parameters for retrieving a single position - * @returns Promise> + * @returns Promise */ getDeliveryPosition(params: { settle: 'usdt'; contract: string; - }): Promise> { + }): Promise { return this.getPrivate( `/delivery/${params.settle}/positions/${params.contract}`, ); @@ -2726,13 +2656,13 @@ export class RestClient extends BaseRestClient { * Update position margin * * @param params Parameters for updating position margin - * @returns Promise> + * @returns Promise */ updateDeliveryMargin(params: { settle: 'usdt'; contract: string; change: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/delivery/${settle}/positions/${contract}/margin`, @@ -2744,13 +2674,13 @@ export class RestClient extends BaseRestClient { * Update position leverage * * @param params Parameters for updating position leverage - * @returns Promise> + * @returns Promise */ updateDeliveryLeverage(params: { settle: 'usdt'; contract: string; leverage: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/delivery/${settle}/positions/${contract}/leverage`, @@ -2762,13 +2692,13 @@ export class RestClient extends BaseRestClient { * Update position risk limit * * @param params Parameters for updating position risk limit - * @returns Promise> + * @returns Promise */ updateDeliveryRiskLimit(params: { settle: 'usdt'; contract: string; risk_limit: string; - }): Promise> { + }): Promise { const { settle, contract, ...query } = params; return this.postPrivate( `/delivery/${settle}/positions/${contract}/risk_limit`, @@ -2782,11 +2712,11 @@ export class RestClient extends BaseRestClient { * Zero-filled order cannot be retrieved 10 minutes after order cancellation * * @param params Parameters for creating a futures order - * @returns Promise> + * @returns Promise */ submitDeliveryOrder( params: SubmitDeliveryFuturesOrderReq, - ): Promise> { + ): Promise { const { settle, ...body } = params; return this.postPrivate(`/delivery/${settle}/orders`, { body: body }); } @@ -2797,11 +2727,9 @@ export class RestClient extends BaseRestClient { * Zero-fill order cannot be retrieved 10 minutes after order cancellation. * * @param params Parameters for listing futures orders - * @returns Promise> + * @returns Promise */ - getDeliveryOrders( - params: GetDeliveryOrdersReq, - ): Promise> { + getDeliveryOrders(params: GetDeliveryOrdersReq): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/orders`, query); } @@ -2811,13 +2739,13 @@ export class RestClient extends BaseRestClient { * Zero-filled order cannot be retrieved 10 minutes after order cancellation * * @param params Parameters for cancelling all open orders matched - * @returns Promise> + * @returns Promise */ cancelAllDeliveryOrders(params: { settle: 'usdt'; contract: string; side?: 'ask' | 'bid'; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.deletePrivate(`/delivery/${settle}/orders`, { query: query, @@ -2830,12 +2758,12 @@ export class RestClient extends BaseRestClient { * Zero-filled order cannot be retrieved 10 minutes after order cancellation * * @param params Parameters for retrieving a single order - * @returns Promise> + * @returns Promise */ getDeliveryOrder(params: { settle: 'usdt'; order_id: string; - }): Promise> { + }): Promise { return this.getPrivate( `/delivery/${params.settle}/orders/${params.order_id}`, ); @@ -2845,12 +2773,12 @@ export class RestClient extends BaseRestClient { * Cancel a single order * * @param params Parameters for cancelling a single order - * @returns Promise> + * @returns Promise */ cancelDeliveryOrder(params: { settle: 'usdt'; order_id: string; - }): Promise> { + }): Promise { return this.deletePrivate( `/delivery/${params.settle}/orders/${params.order_id}`, ); @@ -2860,11 +2788,11 @@ export class RestClient extends BaseRestClient { * List personal trading history * * @param params Parameters for listing personal trading history - * @returns Promise> + * @returns Promise */ getDeliveryTradingHistory( params: GetDeliveryTradingHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/my_trades`, query); } @@ -2873,11 +2801,11 @@ export class RestClient extends BaseRestClient { * List position close history * * @param params Parameters for listing position close history - * @returns Promise> + * @returns Promise */ getDeliveryClosedPositions( params: GetDeliveryClosedPositionsReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/position_close`, query); } @@ -2886,11 +2814,11 @@ export class RestClient extends BaseRestClient { * List liquidation history * * @param params Parameters for listing liquidation history - * @returns Promise> + * @returns Promise */ getDeliveryLiquidationHistory( params: GetDeliveryLiquidationHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/liquidates`, query); } @@ -2899,11 +2827,11 @@ export class RestClient extends BaseRestClient { * List settlement history * * @param params Parameters for listing settlement history - * @returns Promise> + * @returns Promise */ getDeliverySettlementHistory( params: GetDeliverySettlementHistoryReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/settlements`, query); } @@ -2912,11 +2840,11 @@ export class RestClient extends BaseRestClient { * Create a price-triggered order * * @param params Parameters for creating a price-triggered order - * @returns Promise> + * @returns Promise<{ id: number }> */ submitDeliveryTriggeredOrder( params: SubmitFuturesTriggeredOrderReq, - ): Promise> { + ): Promise<{ id: number }> { const { settle, ...body } = params; return this.postPrivate(`/delivery/${settle}/price_orders`, { body: body, @@ -2927,11 +2855,11 @@ export class RestClient extends BaseRestClient { * List all auto orders * * @param params Parameters for listing all auto orders - * @returns Promise> + * @returns Promise */ getDeliveryAutoOrders( params: GetDeliveryAutoOrdersReq, - ): Promise> { + ): Promise { const { settle, ...query } = params; return this.getPrivate(`/delivery/${settle}/price_orders`, query); } @@ -2940,12 +2868,12 @@ export class RestClient extends BaseRestClient { * Cancel all open orders * * @param params Parameters for cancelling all open orders - * @returns Promise> + * @returns Promise */ cancelAllOpenDeliveryOrders(params: { settle: 'usdt'; contract: string; - }): Promise> { + }): Promise { const { settle, ...query } = params; return this.deletePrivate(`/delivery/${settle}/price_orders`, { query: query, @@ -2956,12 +2884,12 @@ export class RestClient extends BaseRestClient { * Get a price-triggered order * * @param params Parameters for retrieving a price-triggered order - * @returns Promise> + * @returns Promise */ getDeliveryTriggeredOrder(params: { settle: 'usdt'; order_id: string; - }): Promise> { + }): Promise { return this.getPrivate( `/delivery/${params.settle}/price_orders/${params.order_id}`, ); @@ -2971,12 +2899,12 @@ export class RestClient extends BaseRestClient { * Cancel a price-triggered order * * @param params Parameters for cancelling a price-triggered order - * @returns Promise> + * @returns Promise */ cancelTriggeredDeliveryOrder(params: { settle: 'usdt'; order_id: string; - }): Promise> { + }): Promise { return this.deletePrivate( `/delivery/${params.settle}/price_orders/${params.order_id}`, ); @@ -2990,7 +2918,7 @@ export class RestClient extends BaseRestClient { /** * List all underlyings * - * @returns Promise> + * @returns Promise<{ name: string; index_price: string }[]> */ getOptionsUnderlyings(): Promise< APIResponse<{ name: string; index_price: string }[]> @@ -3002,11 +2930,9 @@ export class RestClient extends BaseRestClient { * List all expiration times * * @param params Parameters for listing expiration times - * @returns Promise> + * @returns Promise */ - getOptionsExpirationTimes(params: { - underlying: string; - }): Promise> { + getOptionsExpirationTimes(params: { underlying: string }): Promise { return this.get(`/options/expirations`, params); } @@ -3014,12 +2940,12 @@ export class RestClient extends BaseRestClient { * List all the contracts with specified underlying and expiration time * * @param params Parameters for listing contracts - * @returns Promise> + * @returns Promise */ getOptionsContracts(params: { underlying: string; expiration?: number; - }): Promise> { + }): Promise { return this.get(`/options/contracts`, params); } @@ -3027,11 +2953,9 @@ export class RestClient extends BaseRestClient { * Query specified contract detail * * @param params Parameters for querying specified contract detail - * @returns Promise> + * @returns Promise */ - getOptionsContract(params: { - contract: string; - }): Promise> { + getOptionsContract(params: { contract: string }): Promise { return this.get(`/options/contracts/${params.contract}`); } @@ -3039,11 +2963,11 @@ export class RestClient extends BaseRestClient { * List settlement history * * @param params Parameters for listing settlement history - * @returns Promise> + * @returns Promise */ getOptionsSettlementHistory( params: GetOptionsSettlementHistoryReq, - ): Promise> { + ): Promise { return this.get(`/options/settlements`, params); } @@ -3051,13 +2975,13 @@ export class RestClient extends BaseRestClient { * Get specified contract's settlement * * @param params Parameters for retrieving specified contract's settlement - * @returns Promise> + * @returns Promise */ getOptionsContractSettlement(params: { contract: string; underlying: string; at: number; - }): Promise> { + }): Promise { const { contract, ...query } = params; return this.get(`/options/settlements/${contract}`, query); } @@ -3066,11 +2990,11 @@ export class RestClient extends BaseRestClient { * List my options settlements * * @param params Parameters for listing my options settlements - * @returns Promise> + * @returns Promise */ getOptionsMySettlements( params: GetOptionsMySettlementsReq, - ): Promise> { + ): Promise { return this.getPrivate(`/options/my_settlements`, params); } @@ -3080,11 +3004,11 @@ export class RestClient extends BaseRestClient { * Bids will be sorted by price from high to low, while asks sorted reversely * * @param params Parameters for retrieving options order book - * @returns Promise> + * @returns Promise */ getOptionsOrderBook( params: GetOptionsOrderBookReq, - ): Promise> { + ): Promise { return this.get(`/options/order_book`, params); } @@ -3092,11 +3016,9 @@ export class RestClient extends BaseRestClient { * List tickers of options contracts * * @param params Parameters for listing tickers of options contracts - * @returns Promise> + * @returns Promise */ - getOptionsTickers(params: { - underlying: string; - }): Promise> { + getOptionsTickers(params: { underlying: string }): Promise { return this.get(`/options/tickers`, params); } @@ -3104,11 +3026,11 @@ export class RestClient extends BaseRestClient { * Get underlying ticker * * @param params Parameters for retrieving underlying ticker - * @returns Promise> + * }> */ getOptionsUnderlyingTicker(params: { underlying: string }): Promise< APIResponse<{ @@ -3124,11 +3046,9 @@ export class RestClient extends BaseRestClient { * Get options Candles * * @param params Parameters for retrieving options Candles - * @returns Promise> + * @returns Promise */ - getOptionsCandles( - params: GetOptionsCandlesReq, - ): Promise> { + getOptionsCandles(params: GetOptionsCandlesReq): Promise { return this.get(`/options/Candles`, params); } @@ -3136,11 +3056,11 @@ export class RestClient extends BaseRestClient { * Mark price Candles of an underlying * * @param params Parameters for retrieving mark price Candles of an underlying - * @returns Promise> + * @returns Promise */ getOptionsUnderlyingCandles( params: GetOptionsUnderlyingCandlesReq, - ): Promise> { + ): Promise { return this.get(`/options/underlying/Candles`, params); } @@ -3148,20 +3068,18 @@ export class RestClient extends BaseRestClient { * Options trade history * * @param params Parameters for retrieving options trade history - * @returns Promise> + * @returns Promise */ - getOptionsTrades( - params: GetOptionsTradesReq, - ): Promise> { + getOptionsTrades(params: GetOptionsTradesReq): Promise { return this.get(`/options/trades`, params); } /** * List options account * - * @returns Promise> + * @returns Promise */ - getOptionsAccount(): Promise> { + getOptionsAccount(): Promise { return this.getPrivate(`/options/accounts`); } @@ -3169,11 +3087,11 @@ export class RestClient extends BaseRestClient { * List account changing history * * @param params Parameters for listing account changing history - * @returns Promise> + * @returns Promise */ getOptionsAccountChange( params?: GetOptionsAccountChangeReq, - ): Promise> { + ): Promise { return this.getPrivate(`/options/account_book`, params); } @@ -3181,11 +3099,11 @@ export class RestClient extends BaseRestClient { * List user's positions of specified underlying * * @param params Parameters for listing user's positions of specified underlying - * @returns Promise> + * @returns Promise */ getOptionsPositionsUnderlying(params: { underlying?: string; - }): Promise> { + }): Promise { return this.getPrivate(`/options/positions`, params); } @@ -3193,11 +3111,11 @@ export class RestClient extends BaseRestClient { * Get specified contract position * * @param params Parameters for retrieving specified contract position - * @returns Promise> + * @returns Promise */ getOptionsPositionContract(params: { contract: string; - }): Promise> { + }): Promise { return this.getPrivate(`/options/positions/${params.contract}`); } @@ -3205,12 +3123,12 @@ export class RestClient extends BaseRestClient { * List user's liquidation history of specified underlying * * @param params Parameters for listing user's liquidation history of specified underlying - * @returns Promise> + * @returns Promise */ getOptionsLiquidation(params: { underlying: string; contract?: string; - }): Promise> { + }): Promise { return this.getPrivate(`/options/position_close`, params); } @@ -3218,11 +3136,11 @@ export class RestClient extends BaseRestClient { * Create an options order * * @param params Parameters for creating an options order - * @returns Promise> + * @returns Promise */ submitOptionsOrder( params: SubmitOptionsOrderReq, - ): Promise> { + ): Promise { return this.postPrivate(`/options/orders`, { body: params }); } @@ -3230,11 +3148,11 @@ export class RestClient extends BaseRestClient { * List options orders * * @param params Parameters for listing options orders - * @returns Promise> + * @returns Promise */ getOptionsOrders( params: GetOptionsOrdersReq, - ): Promise> { + ): Promise { return this.getPrivate(`/options/orders`, params); } @@ -3242,13 +3160,13 @@ export class RestClient extends BaseRestClient { * Cancel all open orders matched * * @param params Parameters for canceling all open orders matched - * @returns Promise> + * @returns Promise */ cancelAllOpenOptionsOrders(params: { contract?: string; underlying?: string; side?: 'ask' | 'bid'; - }): Promise> { + }): Promise { return this.deletePrivate(`/options/orders`, { query: params }); } @@ -3256,11 +3174,11 @@ export class RestClient extends BaseRestClient { * Get a single order * * @param params Parameters for retrieving a single order - * @returns Promise> + * @returns Promise */ getOptionsOrder(params: { order_id: number; - }): Promise> { + }): Promise { return this.getPrivate(`/options/orders/${params.order_id}`); } @@ -3268,11 +3186,11 @@ export class RestClient extends BaseRestClient { * Cancel a single order * * @param params Parameters for canceling a single order - * @returns Promise> + * @returns Promise */ cancelOptionsOrder(params: { order_id: number; - }): Promise> { + }): Promise { return this.deletePrivate(`/options/orders/${params.order_id}`); } @@ -3280,11 +3198,11 @@ export class RestClient extends BaseRestClient { * List personal trading history * * @param params Parameters for listing personal trading history - * @returns Promise> + * @returns Promise */ getOptionsPersonalHistory( params: GetOptionsPersonalHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate(`/options/my_trades`, params); } @@ -3296,9 +3214,9 @@ export class RestClient extends BaseRestClient { /** * List currencies for lending * - * @returns Promise> + * @returns Promise */ - getLendingCurrencies(): Promise> { + getLendingCurrencies(): Promise { return this.get(`/earn/uni/currencies`); } @@ -3306,11 +3224,9 @@ export class RestClient extends BaseRestClient { * Get currency detail for lending * * @param params Parameters for retrieving currency detail for lending - * @returns Promise> + * @returns Promise */ - getLendingCurrency(params: { - currency: string; - }): Promise> { + getLendingCurrency(params: { currency: string }): Promise { return this.get(`/earn/uni/currencies/${params.currency}`); } @@ -3318,11 +3234,9 @@ export class RestClient extends BaseRestClient { * Lend or redeem * * @param params Parameters for lending or redeeming - * @returns Promise> + * @returns Promise */ - submitLendOrRedeemOrder( - params: SubmitLendOrRedeemReq, - ): Promise> { + submitLendOrRedeemOrder(params: SubmitLendOrRedeemReq): Promise { return this.postPrivate(`/earn/uni/lends`, { body: params }); } @@ -3330,11 +3244,9 @@ export class RestClient extends BaseRestClient { * List user's lending orders * * @param params Parameters for listing user's lending orders - * @returns Promise> + * @returns Promise */ - getLendingOrders( - params?: GetLendingOrdersReq, - ): Promise> { + getLendingOrders(params?: GetLendingOrdersReq): Promise { return this.getPrivate(`/earn/uni/lends`, params); } @@ -3344,12 +3256,12 @@ export class RestClient extends BaseRestClient { * Currently only supports amending the minimum interest rate (hour) * * @param params Parameters for amending lending order - * @returns Promise> + * @returns Promise */ updateLendingOrder(params: { currency?: string; min_rate?: string; - }): Promise> { + }): Promise { return this.patchPrivate(`/earn/uni/lends`, { query: params }); } @@ -3357,11 +3269,9 @@ export class RestClient extends BaseRestClient { * List records of lending * * @param params Parameters for listing records of lending - * @returns Promise> + * @returns Promise */ - getLendingRecords( - params?: GetLendingRecordsReq, - ): Promise> { + getLendingRecords(params?: GetLendingRecordsReq): Promise { return this.getPrivate(`/earn/uni/lend_records`, params); } @@ -3369,10 +3279,10 @@ export class RestClient extends BaseRestClient { * Get the user's total interest income of specified currency * * @param params Parameters for retrieving the user's total interest income of specified currency - * @returns Promise> + * }> */ getLendingTotalInterest(params: { currency: string }): Promise< APIResponse<{ @@ -3387,11 +3297,11 @@ export class RestClient extends BaseRestClient { * List interest records * * @param params Parameters for listing interest records - * @returns Promise> + * @returns Promise */ getLendingInterestRecords( params?: GetLendingInterestRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate(`/earn/uni/interest_records`, params); } @@ -3399,12 +3309,12 @@ export class RestClient extends BaseRestClient { * Set interest reinvestment toggle * * @param params Parameters for setting interest reinvestment toggle - * @returns Promise> + * @returns Promise */ updateInterestReinvestment(params: { currency: string; status: boolean; - }): Promise> { + }): Promise { return this.putPrivate(`/earn/uni/interest_reinvest`, { body: params }); } @@ -3412,10 +3322,10 @@ export class RestClient extends BaseRestClient { * Query currency interest compounding status * * @param params Parameters for querying currency interest compounding status - * @returns Promise> + * }> */ getLendingInterestStatus(params: { currency: string }): Promise< APIResponse<{ @@ -3435,11 +3345,9 @@ export class RestClient extends BaseRestClient { * Place order * * @param params Parameters for placing an order - * @returns Promise> + * @returns Promise<{ order_id: number }> */ - submitLoanOrder( - params: SubmitLoanOrderReq, - ): Promise> { + submitLoanOrder(params: SubmitLoanOrderReq): Promise<{ order_id: number }> { return this.postPrivate(`/loan/collateral/orders`, { body: params }); } @@ -3447,18 +3355,18 @@ export class RestClient extends BaseRestClient { * List Orders * * @param params Parameters for listing orders - * @returns Promise> + * @returns Promise */ - getLoanOrders(params?: GetLoanOrdersReq): Promise> { + getLoanOrders(params?: GetLoanOrdersReq): Promise { return this.getPrivate(`/loan/collateral/orders`, params); } /** * Get a single order * * @param params Parameters for retrieving a single order - * @returns Promise> + * @returns Promise */ - getLoanOrder(params: { order_id: number }): Promise> { + getLoanOrder(params: { order_id: number }): Promise { return this.getPrivate(`/loan/collateral/orders/${params.order_id}`); } @@ -3466,10 +3374,10 @@ export class RestClient extends BaseRestClient { * Repayment * * @param params Parameters for repayment - * @returns Promise> + * }> */ submitLoanRepay(params: { order_id: number; @@ -3488,11 +3396,11 @@ export class RestClient extends BaseRestClient { * Repayment history * * @param params Parameters for retrieving repayment history - * @returns Promise> + * @returns Promise */ getLoanRepaymentHistory( params: GetLoanRepaymentHistoryReq, - ): Promise> { + ): Promise { return this.getPrivate(`/loan/collateral/repay_records`, params); } @@ -3500,11 +3408,9 @@ export class RestClient extends BaseRestClient { * Increase or redeem collateral * * @param params Parameters for increasing or redeeming collateral - * @returns Promise> + * @returns Promise */ - updateLoanCollateral( - params: UpdateLoanCollateralReq, - ): Promise> { + updateLoanCollateral(params: UpdateLoanCollateralReq): Promise { return this.postPrivate(`/loan/collateral/collaterals`, { body: params }); } @@ -3512,21 +3418,21 @@ export class RestClient extends BaseRestClient { * Query collateral adjustment records * * @param params Parameters for querying collateral adjustment records - * @returns Promise> + * @returns Promise */ getLoanCollateralRecords( params?: GetLoanCollateralRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate(`/loan/collateral/collaterals`, params); } /** * Query the total borrowing and collateral amount for the user * - * @returns Promise> + * }> */ getLoanTotalAmount(): Promise< APIResponse<{ @@ -3541,12 +3447,12 @@ export class RestClient extends BaseRestClient { * Query user's collateralization ratio * * @param params Parameters for querying user's collateralization ratio - * @returns Promise> + * @returns Promise */ getLoanCollateralizationRatio(params: { collateral_currency: string; borrow_currency: string; - }): Promise> { + }): Promise { return this.getPrivate(`/loan/collateral/ltv`, params); } @@ -3554,10 +3460,10 @@ export class RestClient extends BaseRestClient { * Query supported borrowing and collateral currencies * * @param params Parameters for querying supported borrowing and collateral currencies - * @returns Promise> + * }[]> */ getLoanSupportedCurrencies(params?: { loan_currency?: string }): Promise< APIResponse< @@ -3579,11 +3485,11 @@ export class RestClient extends BaseRestClient { * Create Multi-Collateral Order * * @param params Parameters for creating a multi-collateral order - * @returns Promise> + * @returns Promise<{ order_id: number }> */ submitMultiLoanOrder( params: SubmitMultiLoanOrderReq, - ): Promise> { + ): Promise<{ order_id: number }> { return this.postPrivate(`/loan/multi_collateral/orders`, { body: params }); } @@ -3591,11 +3497,11 @@ export class RestClient extends BaseRestClient { * List Multi-Collateral Orders * * @param params Parameters for listing multi-collateral orders - * @returns Promise> + * @returns Promise */ getMultiLoanOrders( params?: GetMultiLoanOrdersReq, - ): Promise> { + ): Promise { return this.getPrivate(`/loan/multi_collateral/orders`, params); } @@ -3603,11 +3509,9 @@ export class RestClient extends BaseRestClient { * Get Multi-Collateral Order Detail * * @param params Parameters for retrieving a multi-collateral order detail - * @returns Promise> + * @returns Promise */ - getMultiLoanOrder(params: { - order_id: string; - }): Promise> { + getMultiLoanOrder(params: { order_id: string }): Promise { return this.getPrivate(`/loan/multi_collateral/orders/${params.order_id}`); } @@ -3615,11 +3519,9 @@ export class RestClient extends BaseRestClient { * Repay Multi-Collateral Loan * * @param params Parameters for repaying a multi-collateral loan - * @returns Promise> + * @returns Promise */ - repayMultiLoan( - params: RepayMultiLoanReq, - ): Promise> { + repayMultiLoan(params: RepayMultiLoanReq): Promise { return this.postPrivate(`/loan/multi_collateral/repay`, { body: params }); } @@ -3627,11 +3529,11 @@ export class RestClient extends BaseRestClient { * List Multi-Collateral Repay Records * * @param params Parameters for listing multi-collateral repay records - * @returns Promise> + * @returns Promise */ getMultiLoanRepayRecords( params: GetMultiLoanRepayRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate(`/loan/multi_collateral/repay`, params); } @@ -3639,11 +3541,9 @@ export class RestClient extends BaseRestClient { * Operate Multi-Collateral * * @param params Parameters for operating multi-collateral - * @returns Promise> + * @returns Promise */ - updateMultiLoan( - params: UpdateMultiLoanReq, - ): Promise> { + updateMultiLoan(params: UpdateMultiLoanReq): Promise { return this.postPrivate(`/loan/multi_collateral/mortgage`, { body: params, }); @@ -3653,11 +3553,11 @@ export class RestClient extends BaseRestClient { * Query collateral adjustment records * * @param params Parameters for querying collateral adjustment records - * @returns Promise> + * @returns Promise */ getMultiLoanAdjustmentRecords( params?: GetMultiLoanAdjustmentRecordsReq, - ): Promise> { + ): Promise { return this.getPrivate(`/loan/multi_collateral/mortgage`, params); } @@ -3665,19 +3565,19 @@ export class RestClient extends BaseRestClient { * List User Currency Quota * * @param params Parameters for listing user currency quota - * @returns Promise> + * @returns Promise */ getMultiLoanCurrencyQuota(params: { type: 'collateral' | 'borrow'; currency: string; - }): Promise> { + }): Promise { return this.getPrivate(`/loan/multi_collateral/currency_quota`, params); } /** * Query supported borrowing and collateral currencies in Multi-Collateral * - * @returns Promise> + * @returns Promise */ getMultiLoanSupportedCurrencies(): Promise< APIResponse @@ -3688,18 +3588,18 @@ export class RestClient extends BaseRestClient { /** * Get Multi-Collateral ratio * - * @returns Promise> + * @returns Promise */ - getMultiLoanRatio(): Promise> { + getMultiLoanRatio(): Promise { return this.get(`/loan/multi_collateral/ltv`); } /** * Query fixed interest rates for the currency for 7 days and 30 days * - * @returns Promise> + * @returns Promise */ - getMultiLoanFixedRates(): Promise> { + getMultiLoanFixedRates(): Promise { return this.get(`/loan/multi_collateral/fixed_rate`); } @@ -3712,42 +3612,39 @@ export class RestClient extends BaseRestClient { * ETH2 swap * * @param params Parameters for ETH2 swap - * @returns Promise> + * @returns Promise */ - submitEth2Swap(params: { - side: '1' | '2'; - amount: string; - }): Promise> { + submitEth2Swap(params: { side: '1' | '2'; amount: string }): Promise { return this.postPrivate(`/earn/staking/eth2/swap`, { body: params }); } /** * Dual Investment product list * - * @returns Promise> + * @returns Promise */ - getDualInvestmentProducts(): Promise> { + getDualInvestmentProducts(): Promise { return this.get(`/earn/dual/investment_plan`); } /** * Dual Investment order list * - * @returns Promise> + * @returns Promise */ - getDualInvestmentOrders(): Promise> { + getDualInvestmentOrders(): Promise { return this.getPrivate(`/earn/dual/orders`); } /** * Place Dual Investment order * * @param params Parameters for placing a dual investment order - * @returns Promise> + * @returns Promise */ submitDualInvestmentOrder(params: { plan_id: string; copies: string; - }): Promise> { + }): Promise { return this.postPrivate(`/earn/dual/orders`, { body: params }); } @@ -3755,11 +3652,11 @@ export class RestClient extends BaseRestClient { * Structured Product List * * @param params Parameters for listing structured products - * @returns Promise> + * @returns Promise */ getStructuredProducts( params: GetStructuredProductListReq, - ): Promise> { + ): Promise { return this.get(`/earn/structured/products`, params); } @@ -3767,23 +3664,23 @@ export class RestClient extends BaseRestClient { * Structured Product Order List * * @param params Parameters for listing structured product orders - * @returns Promise> + * @returns Promise */ getStructuredProductOrders( params?: GetStructuredProductOrdersReq, - ): Promise> { + ): Promise { return this.getPrivate(`/earn/structured/orders`, params); } /** * Place Structured Product Order * * @param params Parameters for placing a structured product order - * @returns Promise> + * @returns Promise */ submitStructuredProductOrder(params: { pid?: string; amount?: string; - }): Promise> { + }): Promise { return this.postPrivate(`/earn/structured/orders`, { body: params }); } @@ -3795,9 +3692,9 @@ export class RestClient extends BaseRestClient { /** * Get account detail * - * @returns Promise> + * @returns Promise */ - getAccountDetail(): Promise> { + getAccountDetail(): Promise { return this.getPrivate(`/account/detail`); } @@ -3805,9 +3702,9 @@ export class RestClient extends BaseRestClient { * Create STP Group * * @param params Parameters for creating an STP group - * @returns Promise> + * @returns Promise */ - createStpGroup(params: CreateStpGroupReq): Promise> { + createStpGroup(params: CreateStpGroupReq): Promise { return this.postPrivate(`/account/stp_groups`, { body: params }); } @@ -3815,9 +3712,9 @@ export class RestClient extends BaseRestClient { * List STP Groups * * @param params Parameters for listing STP groups - * @returns Promise> + * @returns Promise */ - getStpGroups(params?: { name?: string }): Promise> { + getStpGroups(params?: { name?: string }): Promise { return this.getPrivate(`/account/stp_groups`, params); } @@ -3825,11 +3722,9 @@ export class RestClient extends BaseRestClient { * List users of the STP group * * @param params Parameters for listing users of the STP group - * @returns Promise> + * @returns Promise */ - getStpGroupUsers(params: { - stp_id: number; - }): Promise> { + getStpGroupUsers(params: { stp_id: number }): Promise { return this.getPrivate(`/account/stp_groups/${params.stp_id}/users`); } @@ -3837,12 +3732,12 @@ export class RestClient extends BaseRestClient { * Add users to the STP group * * @param params Parameters for adding users to the STP group - * @returns Promise> + * @returns Promise */ addUsersToStpGroup(params: { stp_id: number; body: number[]; - }): Promise> { + }): Promise { const { stp_id, ...body } = params; return this.postPrivate(`/account/stp_groups/${stp_id}/users`, { body: body, @@ -3853,12 +3748,12 @@ export class RestClient extends BaseRestClient { * Delete the user in the STP group * * @param params Parameters for deleting users from the STP group - * @returns Promise> + * @returns Promise */ deleteUserFromStpGroup(params: { stp_id: number; user_id: number; - }): Promise> { + }): Promise { const { stp_id, ...query } = params; return this.deletePrivate(`/account/stp_groups/${stp_id}/users`, { query: query, @@ -3875,7 +3770,7 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days. * * @param params Parameters for retrieving transaction history - * @returns Promise> + * @returns Promise */ getAgencyTransactionHistory( params: GetAgencyTransactionHistoryReq, @@ -3890,7 +3785,7 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days. * * @param params Parameters for retrieving commission history - * @returns Promise> + * @returns Promise */ getAgencyCommissionHistory( params: GetAgencyCommissionHistoryReq, @@ -3905,7 +3800,7 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days. * * @param params Parameters for retrieving commission rebate records - * @returns Promise> + * @returns Promise */ getBrokerCommissionHistory( params: GetBrokerCommissionHistoryReq, @@ -3920,7 +3815,7 @@ export class RestClient extends BaseRestClient { * Record time range cannot exceed 30 days. * * @param params Parameters for retrieving trading history - * @returns Promise> + * @returns Promise */ getBrokerTransactionHistory( params: GetBrokerTransactionHistoryReq, @@ -3933,7 +3828,7 @@ export class RestClient extends BaseRestClient { /** * User retrieves rebate information. */ - getUserRebateInfo(): Promise> { + getUserRebateInfo(): Promise<{ invite_uid: number }> { return this.getPrivate('/rebate/user/info'); } } From 481db09de779dc356ffd01a1ea588b1563abb401 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:55:05 +0200 Subject: [PATCH 2/2] chore(): Fixed version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8436c1..ddd629a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gateio-api", - "version": "1.0.4", + "version": "1.0.5", "description": "Complete & robust Node.js SDK for Gate.io's REST APIs, WebSockets & WebSocket APIs, with TypeScript declarations.", "scripts": { "clean": "rm -rf dist/*",