chore(): updated type suffixes, added V2

This commit is contained in:
JJ-Cro
2024-12-10 14:31:23 +01:00
parent d7dfaf205c
commit 0c8813ec32
7 changed files with 290 additions and 288 deletions

View File

@@ -6,30 +6,30 @@ import {
SpotCandlesRequestV2, SpotCandlesRequestV2,
SpotAccountBill, SpotAccountBill,
SpotHistoricCandlesRequestV2, SpotHistoricCandlesRequestV2,
SpotHistoricTradesRequest, SpotHistoricTradesRequestV2,
SpotOrderRequest, SpotOrderRequestV2,
SpotCancelandSubmitOrderRequest, SpotCancelandSubmitOrderRequestV2,
SpotCancelOrderRequest, SpotCancelOrderRequestV2,
SpotBatchOrderRequest, SpotBatchOrderRequestV2,
SpotBatchCancelOrderRequest, SpotBatchCancelOrderRequestV2,
GetSpotOrderInfoRequest, GetSpotOrderInfoRequestV2,
GetSpotOpenOrdersRequest, GetSpotOpenOrdersRequestV2,
GetSpotHistoryOrdersRequest, GetSpotHistoryOrdersRequestV2,
GetSpotFillsRequest, GetSpotFillsRequestV2,
SpotPlanOrderRequest, SpotPlanOrderRequestV2,
SpotModifyPlanOrderRequest, SpotModifyPlanOrderRequestV2,
GetSpotCurrentPlanOrdersRequest, GetSpotCurrentPlanOrdersRequestV2,
GetSpotHistoryPlanOrdersRequest, GetSpotHistoryPlanOrdersRequestV2,
GetSpotAccountBillsRequest, GetSpotAccountBillsRequestV2,
SpotTransferRequest, SpotTransferRequestV2,
SpotAccountType, SpotAccountType,
SpotSubAccountTransferRequest, SpotSubAccountTransferRequestV2,
SpotWithdrawalRequest, SpotWithdrawalRequestV2,
SpotMainSubTransferRecordRequest, SpotMainSubTransferRecordRequestV2,
GetSpotTransferRecordRequest, GetSpotTransferRecordRequestV2,
GetSpotSubAccountDepositRecordRequest, GetSpotSubAccountDepositRecordRequestV2,
GetSpotWithdrawalRecordRequest, GetSpotWithdrawalRecordRequestV2,
GetSpotDepositRecordRequest, GetSpotDepositRecordRequestV2,
FuturesMergeDepthRequestV2, FuturesMergeDepthRequestV2,
FuturesProductTypeV2, FuturesProductTypeV2,
FuturesRecentTradesRequestV2, FuturesRecentTradesRequestV2,
@@ -62,78 +62,78 @@ import {
FuturesGetPlanOrdersRequestV2, FuturesGetPlanOrdersRequestV2,
FuturesCancelPlanOrderRequestV2, FuturesCancelPlanOrderRequestV2,
FuturesGetHistoryPlanOrdersRequestV2, FuturesGetHistoryPlanOrdersRequestV2,
GetBorrowHistoryRequest, GetBorrowHistoryRequestV2,
GetRepayHistoryRequest, GetRepayHistoryRequestV2,
GetInterestHistoryRequest, GetInterestHistoryRequestV2,
GetLiquidationHistoryRequest, GetLiquidationHistoryRequestV2,
GetFinancialHistoryRequest, GetFinancialHistoryRequestV2,
MarginPlaceOrderRequest, MarginPlaceOrderRequestV2,
MarginBatchOrdersRequest, MarginBatchOrdersRequestV2,
GetMarginCurrentOrdersRequest, GetMarginCurrentOrdersRequestV2,
GetHistoryOrdersRequest, GetHistoryOrdersRequestV2,
GetMarginOrderFillsRequest, GetMarginOrderFillsRequestV2,
GetMarginLiquidationOrdersRequest, GetMarginLiquidationOrdersRequestV2,
GetFuturesTraderCurrentOrdersRequest, GetFuturesTraderCurrentOrdersRequestV2,
GetFuturesTraderHistoryOrdersRequest, GetFuturesTraderHistoryOrdersRequestV2,
ModifyFuturesTraderOrderTPSLRequest, ModifyFuturesTraderOrderTPSLRequestV2,
GetFuturesTraderProfitShareDetailRequest, GetFuturesTraderProfitShareDetailRequestV2,
CopyTradingProductType, CopyTradingProductType,
FuturesTraderSymbolSettingReq, FuturesTraderSymbolSettingRequestV2,
GetFuturesTraderFollowers, GetFuturesTraderFollowersRequestV2,
GetFollowerFuturesCurrentTrackingOrdersRequest, GetFollowerFuturesCurrentTrackingOrdersRequestV2,
GetFollowerFuturesHistoryTrackingOrdersRequest, GetFollowerFuturesHistoryTrackingOrdersRequestV2,
UpdateFuturesFollowerTPSLRequest, UpdateFuturesFollowerTPSLRequestV2,
UpdateFuturesFollowerSettingsRequest, UpdateFuturesFollowerSettingsRequestV2,
GetFuturesFollowerTradersRequest, GetFuturesFollowerTradersRequestV2,
CloseFuturesFollowerPositionsRequest, CloseFuturesFollowerPositionsRequestV2,
getSpotTraderHistoryProfitReq, GetSpotTraderHistoryProfitRequestV2,
GetSpotTraderHistoryOrdersReq, GetSpotTraderHistoryOrdersRequestV2,
GetSpotTraderCurrentOrdersReq, GetSpotTraderCurrentOrdersRequestV2,
GetSpotTraderFollowersRequest, GetSpotTraderFollowersRequestV2,
SpotFollowerCopyTradeSetting, SpotFollowerCopyTradeSettingV2,
GetSpotFollowerHistoryOrdersRequest, GetSpotFollowerHistoryOrdersRequestV2,
GetSpotFollowerOpenOrdersRequest, GetSpotFollowerOpenOrdersRequestV2,
GetEarnSavingsAssetsRequest, GetEarnSavingsAssetsRequestV2,
GetEarnSavingsRecordsRequest, GetEarnSavingsRecordsRequestV2,
RedeemSavingsRequest, RedeemSavingsRequestV2,
GetSharkfinAssetsRequest, GetSharkfinAssetsRequestV2,
GetSharkfinRecordsRequest, GetSharkfinRecordsRequestV2,
GetLoanEstInterestAndBorrowableRequest, GetLoanEstInterestAndBorrowableRequestV2,
BorrowLoanRequest, BorrowLoanRequestV2,
RepayLoanRequest, RepayLoanRequestV2,
GetLoanRepayHistoryRequest, GetLoanRepayHistoryRequestV2,
ModifyLoanPledgeRateRequest, ModifyLoanPledgeRateRequestV2,
GetLoanPledgeRateHistoryRequest, GetLoanPledgeRateHistoryRequestV2,
GetLoanHistoryRequest, GetLoanHistoryRequestV2,
GetLiquidationRecordsRequest, GetLiquidationRecordsRequestV2,
} from './types'; } from './types';
import { import {
CreateSubaccountApiKeyRequest, CreateSubAccountApiKeyRequestV2,
GetSubaccountsRequest, GetSubAccountsRequestV2,
ModifySubaccountApiKeyRequest, ModifySubAccountApiKeyRequestV2,
ModifySubRequest, ModifySubRequestV2,
SubDepositRecordsRequest, SubDepositRecordsRequestV2,
SubWithdrawalRecordsRequest, SubWithdrawalRecordsRequestV2,
SubWithdrawalRequest, SubWithdrawalRequestV2,
} from './types/request/v2/broker'; } from './types/request/v2/broker';
import { import {
ConvertQuoteRequest, ConvertQuoteRequestV2,
ConvertRequest, ConvertRequestV2,
CreateVirtualSubApiKeyRequest, CreateVirtualSubApiKeyRequestV2,
CreateVirtualSubRequest, CreateVirtualSubRequestV2,
GetAnnouncementsRequest, GetAnnouncementsRequestV2,
GetConvertHistoryRequest, GetConvertHistoryRequestV2,
GetFuturesTransactionsRequest, GetFuturesTransactionsRequestV2,
GetMarginTransactionsRequest, GetMarginTransactionsRequestV2,
GetMerchantAdvertisementsRequest, GetMerchantAdvertisementsRequestV2,
GetMerchantP2POrdersRequest, GetMerchantP2POrdersRequestV2,
GetP2PMerchantsRequest, GetP2PMerchantsRequestV2,
GetP2PTransactionsRequest, GetP2PTransactionsRequestV2,
GetSpotTransactionsRequest, GetSpotTransactionsRequestV2,
GetTradeRateRequest, GetTradeRateRequestV2,
ModifyVirtualSubRequest, ModifyVirtualSubRequestV2,
ModifyVirtualSubApiKeyRequest, ModifyVirtualSubApiKeyRequestV2,
GetConvertBGBHistoryRequest, GetConvertBGBHistoryRequestV2,
} from './types/request/v2/common'; } from './types/request/v2/common';
import { REST_CLIENT_TYPE_ENUM, assertMarginType } from './util'; import { REST_CLIENT_TYPE_ENUM, assertMarginType } from './util';
import BaseRestClient from './util/BaseRestClient'; import BaseRestClient from './util/BaseRestClient';
@@ -235,7 +235,7 @@ export class RestClientV2 extends BaseRestClient {
*/ */
getAnnouncements( getAnnouncements(
params?: GetAnnouncementsRequest, params?: GetAnnouncementsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.get(`/api/v2/public/annoucements`, params); return this.get(`/api/v2/public/annoucements`, params);
} }
@@ -250,7 +250,7 @@ export class RestClientV2 extends BaseRestClient {
return this.get(`/api/v2/public/time`); return this.get(`/api/v2/public/time`);
} }
getTradeRate(params: GetTradeRateRequest): Promise<APIResponse<any>> { getTradeRate(params: GetTradeRateRequestV2): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/common/trade-rate`, params); return this.getPrivate(`/api/v2/common/trade-rate`, params);
} }
@@ -261,25 +261,25 @@ export class RestClientV2 extends BaseRestClient {
*/ */
getSpotTransactionRecords( getSpotTransactionRecords(
params: GetSpotTransactionsRequest, params: GetSpotTransactionsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/tax/spot-record`, params); return this.getPrivate(`/api/v2/tax/spot-record`, params);
} }
getFuturesTransactionRecords( getFuturesTransactionRecords(
params: GetFuturesTransactionsRequest, params: GetFuturesTransactionsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/tax/future-record`, params); return this.getPrivate(`/api/v2/tax/future-record`, params);
} }
getMarginTransactionRecords( getMarginTransactionRecords(
params: GetMarginTransactionsRequest, params: GetMarginTransactionsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/tax/margin-record`, params); return this.getPrivate(`/api/v2/tax/margin-record`, params);
} }
getP2PTransactionRecords( getP2PTransactionRecords(
params: GetP2PTransactionsRequest, params: GetP2PTransactionsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/tax/p2p-record`, params); return this.getPrivate(`/api/v2/tax/p2p-record`, params);
} }
@@ -291,7 +291,7 @@ export class RestClientV2 extends BaseRestClient {
*/ */
getP2PMerchantList( getP2PMerchantList(
params?: GetP2PMerchantsRequest, params?: GetP2PMerchantsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/p2p/merchantList`, params); return this.getPrivate(`/api/v2/p2p/merchantList`, params);
} }
@@ -301,13 +301,13 @@ export class RestClientV2 extends BaseRestClient {
} }
getP2PMerchantOrders( getP2PMerchantOrders(
params: GetMerchantP2POrdersRequest, params: GetMerchantP2POrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/p2p/orderList`, params); return this.getPrivate(`/api/v2/p2p/orderList`, params);
} }
getP2PMerchantAdvertisementList( getP2PMerchantAdvertisementList(
params: GetMerchantAdvertisementsRequest, params: GetMerchantAdvertisementsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/p2p/advList`, params); return this.getPrivate(`/api/v2/p2p/advList`, params);
} }
@@ -405,13 +405,13 @@ export class RestClientV2 extends BaseRestClient {
} }
modifyVirtualSubaccount( modifyVirtualSubaccount(
params: ModifyVirtualSubRequest, params: ModifyVirtualSubRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/user/modify-virtual-subaccount`, params); return this.postPrivate(`/api/v2/user/modify-virtual-subaccount`, params);
} }
batchCreateVirtualSubaccountAndAPIKey( batchCreateVirtualSubaccountAndAPIKey(
params: CreateVirtualSubRequest, params: CreateVirtualSubRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
'/api/v2/user/batch-create-subaccount-and-apikey', '/api/v2/user/batch-create-subaccount-and-apikey',
@@ -428,7 +428,7 @@ export class RestClientV2 extends BaseRestClient {
} }
createVirtualSubaccountAPIKey( createVirtualSubaccountAPIKey(
params: CreateVirtualSubApiKeyRequest, params: CreateVirtualSubApiKeyRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
'/api/v2/user/create-virtual-subaccount-apikey', '/api/v2/user/create-virtual-subaccount-apikey',
@@ -437,7 +437,7 @@ export class RestClientV2 extends BaseRestClient {
} }
modifyVirtualSubaccountAPIKey( modifyVirtualSubaccountAPIKey(
params: ModifyVirtualSubApiKeyRequest, params: ModifyVirtualSubApiKeyRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
'/api/v2/user/modify-virtual-subaccount-apikey', '/api/v2/user/modify-virtual-subaccount-apikey',
@@ -483,17 +483,17 @@ export class RestClientV2 extends BaseRestClient {
} }
getConvertQuotedPrice( getConvertQuotedPrice(
params: ConvertQuoteRequest, params: ConvertQuoteRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/convert/quoted-price`, params); return this.getPrivate(`/api/v2/convert/quoted-price`, params);
} }
convert(params: ConvertRequest): Promise<APIResponse<any>> { convert(params: ConvertRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/convert/trade`, params); return this.postPrivate(`/api/v2/convert/trade`, params);
} }
getConvertHistory( getConvertHistory(
params: GetConvertHistoryRequest, params: GetConvertHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/convert/convert-record`, params); return this.getPrivate(`/api/v2/convert/convert-record`, params);
} }
@@ -513,7 +513,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getConvertBGBHistory( getConvertBGBHistory(
params: GetConvertBGBHistoryRequest, params: GetConvertBGBHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/convert/bgb-convert-records`, params); return this.getPrivate(`/api/v2/convert/bgb-convert-records`, params);
} }
@@ -582,7 +582,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotHistoricTrades( getSpotHistoricTrades(
params: SpotHistoricTradesRequest, params: SpotHistoricTradesRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/market/fills-history`, params); return this.getPrivate(`/api/v2/spot/market/fills-history`, params);
} }
@@ -593,18 +593,18 @@ export class RestClientV2 extends BaseRestClient {
* *
*/ */
spotSubmitOrder(params: SpotOrderRequest): Promise<APIResponse<any>> { spotSubmitOrder(params: SpotOrderRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/place-order`, params); return this.postPrivate(`/api/v2/spot/trade/place-order`, params);
} }
spotCancelandSubmitOrder( spotCancelandSubmitOrder(
params: SpotCancelandSubmitOrderRequest, params: SpotCancelandSubmitOrderRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/cancel-replace-order`, params); return this.postPrivate(`/api/v2/spot/trade/cancel-replace-order`, params);
} }
spotBatchCancelandSubmitOrder(params: { spotBatchCancelandSubmitOrder(params: {
orderList: SpotCancelandSubmitOrderRequest[]; orderList: SpotCancelandSubmitOrderRequestV2[];
}): Promise<APIResponse<any>> { }): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/spot/trade/batch-cancel-replace-order`, `/api/v2/spot/trade/batch-cancel-replace-order`,
@@ -612,18 +612,18 @@ export class RestClientV2 extends BaseRestClient {
); );
} }
spotCancelOrder(params: SpotCancelOrderRequest): Promise<APIResponse<any>> { spotCancelOrder(params: SpotCancelOrderRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/cancel-order`, params); return this.postPrivate(`/api/v2/spot/trade/cancel-order`, params);
} }
spotBatchSubmitOrders( spotBatchSubmitOrders(
params: SpotBatchOrderRequest, params: SpotBatchOrderRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/batch-orders`, params); return this.postPrivate(`/api/v2/spot/trade/batch-orders`, params);
} }
spotBatchCancelOrders( spotBatchCancelOrders(
params: SpotBatchCancelOrderRequest, params: SpotBatchCancelOrderRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/batch-cancel-order`, params); return this.postPrivate(`/api/v2/spot/trade/batch-cancel-order`, params);
} }
@@ -632,23 +632,23 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate(`/api/v2/spot/trade/cancel-symbol-order`, params); return this.postPrivate(`/api/v2/spot/trade/cancel-symbol-order`, params);
} }
getSpotOrder(params?: GetSpotOrderInfoRequest): Promise<APIResponse<any>> { getSpotOrder(params?: GetSpotOrderInfoRequestV2): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/trade/orderInfo`, params); return this.getPrivate(`/api/v2/spot/trade/orderInfo`, params);
} }
getSpotOpenOrders( getSpotOpenOrders(
params?: GetSpotOpenOrdersRequest, params?: GetSpotOpenOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/trade/unfilled-orders`, params); return this.getPrivate(`/api/v2/spot/trade/unfilled-orders`, params);
} }
getSpotHistoricOrders( getSpotHistoricOrders(
params?: GetSpotHistoryOrdersRequest, params?: GetSpotHistoryOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/trade/history-orders`, params); return this.getPrivate(`/api/v2/spot/trade/history-orders`, params);
} }
getSpotFills(params: GetSpotFillsRequest): Promise<APIResponse<any>> { getSpotFills(params: GetSpotFillsRequestV2): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/trade/fills`, params); return this.getPrivate(`/api/v2/spot/trade/fills`, params);
} }
@@ -658,12 +658,14 @@ export class RestClientV2 extends BaseRestClient {
* *
*/ */
spotSubmitPlanOrder(params: SpotPlanOrderRequest): Promise<APIResponse<any>> { spotSubmitPlanOrder(
params: SpotPlanOrderRequestV2,
): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/place-plan-order`, params); return this.postPrivate(`/api/v2/spot/trade/place-plan-order`, params);
} }
spotModifyPlanOrder( spotModifyPlanOrder(
params: SpotModifyPlanOrderRequest, params: SpotModifyPlanOrderRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/trade/modify-plan-order`, params); return this.postPrivate(`/api/v2/spot/trade/modify-plan-order`, params);
} }
@@ -676,7 +678,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotCurrentPlanOrders( getSpotCurrentPlanOrders(
params: GetSpotCurrentPlanOrdersRequest, params: GetSpotCurrentPlanOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/trade/current-plan-order`, params); return this.getPrivate(`/api/v2/spot/trade/current-plan-order`, params);
} }
@@ -688,7 +690,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotHistoricPlanOrders( getSpotHistoricPlanOrders(
params: GetSpotHistoryPlanOrdersRequest, params: GetSpotHistoryPlanOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/trade/history-plan-order`, params); return this.getPrivate(`/api/v2/spot/trade/history-plan-order`, params);
} }
@@ -734,12 +736,12 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotAccountBills( getSpotAccountBills(
params?: GetSpotAccountBillsRequest, params?: GetSpotAccountBillsRequestV2,
): Promise<APIResponse<SpotAccountBill[]>> { ): Promise<APIResponse<SpotAccountBill[]>> {
return this.getPrivate(`/api/v2/spot/account/bills`, params); return this.getPrivate(`/api/v2/spot/account/bills`, params);
} }
spotTransfer(params: SpotTransferRequest): Promise<APIResponse<any>> { spotTransfer(params: SpotTransferRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/wallet/transfer`, params); return this.postPrivate(`/api/v2/spot/wallet/transfer`, params);
} }
@@ -751,17 +753,17 @@ export class RestClientV2 extends BaseRestClient {
} }
spotSubTransfer( spotSubTransfer(
params: SpotSubAccountTransferRequest, params: SpotSubAccountTransferRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/wallet/subaccount-transfer`, params); return this.postPrivate(`/api/v2/spot/wallet/subaccount-transfer`, params);
} }
spotWithdraw(params: SpotWithdrawalRequest): Promise<APIResponse<any>> { spotWithdraw(params: SpotWithdrawalRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/spot/wallet/withdrawal`, params); return this.postPrivate(`/api/v2/spot/wallet/withdrawal`, params);
} }
getSpotMainSubTransferRecord( getSpotMainSubTransferRecord(
params: SpotMainSubTransferRecordRequest, params: SpotMainSubTransferRecordRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/spot/account/sub-main-trans-record`, `/api/v2/spot/account/sub-main-trans-record`,
@@ -770,7 +772,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotTransferHistory( getSpotTransferHistory(
params: GetSpotTransferRecordRequest, params: GetSpotTransferRecordRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/account/transferRecords`, params); return this.getPrivate(`/api/v2/spot/account/transferRecords`, params);
} }
@@ -807,7 +809,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSubAccountDepositRecords( getSubAccountDepositRecords(
params: GetSpotSubAccountDepositRecordRequest, params: GetSpotSubAccountDepositRecordRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/spot/wallet/subaccount-deposit-records`, `/api/v2/spot/wallet/subaccount-deposit-records`,
@@ -816,13 +818,13 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotDepositHistory( getSpotDepositHistory(
params: GetSpotDepositRecordRequest, params: GetSpotDepositRecordRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/wallet/deposit-records`, params); return this.getPrivate(`/api/v2/spot/wallet/deposit-records`, params);
} }
getSpotWithdrawalHistory( getSpotWithdrawalHistory(
params: GetSpotWithdrawalRecordRequest, params: GetSpotWithdrawalRecordRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/spot/wallet/withdrawal-records`, params); return this.getPrivate(`/api/v2/spot/wallet/withdrawal-records`, params);
} }
@@ -1245,11 +1247,11 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate(`/api/v2/broker/account/create-subaccount`, params); return this.postPrivate(`/api/v2/broker/account/create-subaccount`, params);
} }
getSubaccounts(params?: GetSubaccountsRequest): Promise<APIResponse<any>> { getSubaccounts(params?: GetSubAccountsRequestV2): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/broker/account/subaccount-list`, params); return this.getPrivate(`/api/v2/broker/account/subaccount-list`, params);
} }
modifySubaccount(params: ModifySubRequest): Promise<APIResponse<any>> { modifySubaccount(params: ModifySubRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/broker/account/modify-subaccount`, params); return this.postPrivate(`/api/v2/broker/account/modify-subaccount`, params);
} }
@@ -1290,7 +1292,7 @@ export class RestClientV2 extends BaseRestClient {
} }
subaccountWithdrawal( subaccountWithdrawal(
params: SubWithdrawalRequest, params: SubWithdrawalRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/broker/account/subaccount-withdrawal`, `/api/v2/broker/account/subaccount-withdrawal`,
@@ -1310,13 +1312,13 @@ export class RestClientV2 extends BaseRestClient {
} }
subaccountDepositRecords( subaccountDepositRecords(
params: SubDepositRecordsRequest, params: SubDepositRecordsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/broker/subaccount-deposit`, params); return this.postPrivate(`/api/v2/broker/subaccount-deposit`, params);
} }
subaccountWithdrawalRecords( subaccountWithdrawalRecords(
params: SubWithdrawalRecordsRequest, params: SubWithdrawalRecordsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/broker/subaccount-withdrawal`, params); return this.postPrivate(`/api/v2/broker/subaccount-withdrawal`, params);
} }
@@ -1328,7 +1330,7 @@ export class RestClientV2 extends BaseRestClient {
*/ */
createSubaccountApiKey( createSubaccountApiKey(
params: CreateSubaccountApiKeyRequest, params: CreateSubAccountApiKeyRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/broker/manage/create-subaccount-apikey`, `/api/v2/broker/manage/create-subaccount-apikey`,
@@ -1344,7 +1346,7 @@ export class RestClientV2 extends BaseRestClient {
} }
modifySubaccountApiKey( modifySubaccountApiKey(
params: ModifySubaccountApiKeyRequest, params: ModifySubAccountApiKeyRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/broker/manage/modify-subaccount-apikey`, `/api/v2/broker/manage/modify-subaccount-apikey`,
@@ -1378,7 +1380,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginBorrowHistory( getMarginBorrowHistory(
marginType: MarginType, marginType: MarginType,
params: GetBorrowHistoryRequest, params: GetBorrowHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1389,7 +1391,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginRepayHistory( getMarginRepayHistory(
marginType: MarginType, marginType: MarginType,
params: GetRepayHistoryRequest, params: GetRepayHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1400,7 +1402,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginInterestHistory( getMarginInterestHistory(
marginType: MarginType, marginType: MarginType,
params: GetInterestHistoryRequest, params: GetInterestHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1411,7 +1413,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginLiquidationHistory( getMarginLiquidationHistory(
marginType: MarginType, marginType: MarginType,
params: GetLiquidationHistoryRequest, params: GetLiquidationHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1422,7 +1424,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginFinancialHistory( getMarginFinancialHistory(
marginType: MarginType, marginType: MarginType,
params: GetFinancialHistoryRequest, params: GetFinancialHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1553,7 +1555,7 @@ export class RestClientV2 extends BaseRestClient {
marginSubmitOrder( marginSubmitOrder(
marginType: MarginType, marginType: MarginType,
params: MarginPlaceOrderRequest, params: MarginPlaceOrderRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.postPrivate(`/api/v2/margin/${marginType}/place-order`, params); return this.postPrivate(`/api/v2/margin/${marginType}/place-order`, params);
@@ -1561,7 +1563,7 @@ export class RestClientV2 extends BaseRestClient {
marginBatchSubmitOrders( marginBatchSubmitOrders(
marginType: MarginType, marginType: MarginType,
params: MarginBatchOrdersRequest, params: MarginBatchOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.postPrivate( return this.postPrivate(
@@ -1601,7 +1603,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginOpenOrders( getMarginOpenOrders(
marginType: MarginType, marginType: MarginType,
params: GetMarginCurrentOrdersRequest, params: GetMarginCurrentOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate(`/api/v2/margin/${marginType}/open-orders`, params); return this.getPrivate(`/api/v2/margin/${marginType}/open-orders`, params);
@@ -1609,7 +1611,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginHistoricOrders( getMarginHistoricOrders(
marginType: MarginType, marginType: MarginType,
params: GetHistoryOrdersRequest, params: GetHistoryOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1620,7 +1622,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginHistoricOrderFills( getMarginHistoricOrderFills(
marginType: MarginType, marginType: MarginType,
params: GetMarginOrderFillsRequest, params: GetMarginOrderFillsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate(`/api/v2/margin/${marginType}/fills`, params); return this.getPrivate(`/api/v2/margin/${marginType}/fills`, params);
@@ -1628,7 +1630,7 @@ export class RestClientV2 extends BaseRestClient {
getMarginLiquidationOrders( getMarginLiquidationOrders(
marginType: MarginType, marginType: MarginType,
params: GetMarginLiquidationOrdersRequest, params: GetMarginLiquidationOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
assertMarginType(marginType); assertMarginType(marginType);
return this.getPrivate( return this.getPrivate(
@@ -1654,7 +1656,7 @@ export class RestClientV2 extends BaseRestClient {
*/ */
getFuturesTraderCurrentOrder( getFuturesTraderCurrentOrder(
params: GetFuturesTraderCurrentOrdersRequest, params: GetFuturesTraderCurrentOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/mix-trader/order-current-track`, `/api/v2/copy/mix-trader/order-current-track`,
@@ -1663,7 +1665,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getFuturesTraderHistoryOrders( getFuturesTraderHistoryOrders(
params: GetFuturesTraderHistoryOrdersRequest, params: GetFuturesTraderHistoryOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/mix-trader/order-history-track`, `/api/v2/copy/mix-trader/order-history-track`,
@@ -1672,7 +1674,7 @@ export class RestClientV2 extends BaseRestClient {
} }
modifyFuturesTraderOrderTPSL( modifyFuturesTraderOrderTPSL(
params: ModifyFuturesTraderOrderTPSLRequest, params: ModifyFuturesTraderOrderTPSLRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/copy/mix-trader/order-modify-tpsl`, `/api/v2/copy/mix-trader/order-modify-tpsl`,
@@ -1689,7 +1691,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getFuturesTraderProfitShareHistory( getFuturesTraderProfitShareHistory(
params: GetFuturesTraderProfitShareDetailRequest, params: GetFuturesTraderProfitShareDetailRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/mix-trader/profit-history-details`, `/api/v2/copy/mix-trader/profit-history-details`,
@@ -1736,7 +1738,7 @@ export class RestClientV2 extends BaseRestClient {
} }
updateFuturesTraderSymbolSettings(params: { updateFuturesTraderSymbolSettings(params: {
settingList: FuturesTraderSymbolSettingReq[]; settingList: FuturesTraderSymbolSettingRequestV2[];
}): Promise<APIResponse<any>> { }): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/copy/mix-trader/config-setting-symbols`, `/api/v2/copy/mix-trader/config-setting-symbols`,
@@ -1756,7 +1758,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getFuturesTraderFollowers( getFuturesTraderFollowers(
params?: GetFuturesTraderFollowers, params?: GetFuturesTraderFollowersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/mix-trader/config-query-followers`, `/api/v2/copy/mix-trader/config-query-followers`,
@@ -1782,7 +1784,7 @@ export class RestClientV2 extends BaseRestClient {
*/ */
getFuturesFollowerCurrentOrders( getFuturesFollowerCurrentOrders(
params: GetFollowerFuturesCurrentTrackingOrdersRequest, params: GetFollowerFuturesCurrentTrackingOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/mix-follower/query-current-orders`, `/api/v2/copy/mix-follower/query-current-orders`,
@@ -1791,7 +1793,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getFuturesFollowerHistoryOrders( getFuturesFollowerHistoryOrders(
params: GetFollowerFuturesHistoryTrackingOrdersRequest, params: GetFollowerFuturesHistoryTrackingOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/mix-follower/query-history-orders`, `/api/v2/copy/mix-follower/query-history-orders`,
@@ -1800,13 +1802,13 @@ export class RestClientV2 extends BaseRestClient {
} }
updateFuturesFollowerTPSL( updateFuturesFollowerTPSL(
params: UpdateFuturesFollowerTPSLRequest, params: UpdateFuturesFollowerTPSLRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/copy/mix-follower/setting-tpsl`, params); return this.postPrivate(`/api/v2/copy/mix-follower/setting-tpsl`, params);
} }
updateFuturesFollowerSettings( updateFuturesFollowerSettings(
params: UpdateFuturesFollowerSettingsRequest, params: UpdateFuturesFollowerSettingsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/copy/mix-follower/settings`, params); return this.postPrivate(`/api/v2/copy/mix-follower/settings`, params);
} }
@@ -1818,7 +1820,7 @@ export class RestClientV2 extends BaseRestClient {
} }
closeFuturesFollowerPositions( closeFuturesFollowerPositions(
params: CloseFuturesFollowerPositionsRequest, params: CloseFuturesFollowerPositionsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate( return this.postPrivate(
`/api/v2/copy/mix-follower/close-positions`, `/api/v2/copy/mix-follower/close-positions`,
@@ -1827,7 +1829,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getFuturesFollowerTraders( getFuturesFollowerTraders(
params: GetFuturesFollowerTradersRequest, params: GetFuturesFollowerTradersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/copy/mix-follower/query-traders`, params); return this.getPrivate(`/api/v2/copy/mix-follower/query-traders`, params);
} }
@@ -1887,7 +1889,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotTraderHistoryProfit( getSpotTraderHistoryProfit(
params: getSpotTraderHistoryProfitReq, params: GetSpotTraderHistoryProfitRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/spot-trader/profit-history-details`, `/api/v2/copy/spot-trader/profit-history-details`,
@@ -1919,7 +1921,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotTraderHistoryOrders( getSpotTraderHistoryOrders(
params: GetSpotTraderHistoryOrdersReq, params: GetSpotTraderHistoryOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/spot-trader/order-history-track`, `/api/v2/copy/spot-trader/order-history-track`,
@@ -1928,7 +1930,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotTraderCurrentOrders( getSpotTraderCurrentOrders(
params: GetSpotTraderCurrentOrdersReq, params: GetSpotTraderCurrentOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/spot-trader/order-current-track`, `/api/v2/copy/spot-trader/order-current-track`,
@@ -1970,7 +1972,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotTraderFollowers( getSpotTraderFollowers(
params: GetSpotTraderFollowersRequest, params: GetSpotTraderFollowersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/spot-trader/config-query-followers`, `/api/v2/copy/spot-trader/config-query-followers`,
@@ -1996,7 +1998,7 @@ export class RestClientV2 extends BaseRestClient {
traderId: string; traderId: string;
autoCopy?: 'on' | 'off'; autoCopy?: 'on' | 'off';
mode?: 'basic' | 'advanced'; mode?: 'basic' | 'advanced';
settings: SpotFollowerCopyTradeSetting[]; settings: SpotFollowerCopyTradeSettingV2[];
}): Promise<APIResponse<any>> { }): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/copy/spot-follower/settings`, params); return this.postPrivate(`/api/v2/copy/spot-follower/settings`, params);
} }
@@ -2034,7 +2036,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotFollowerHistoryOrders( getSpotFollowerHistoryOrders(
params: GetSpotFollowerHistoryOrdersRequest, params: GetSpotFollowerHistoryOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/spot-follower/query-history-orders`, `/api/v2/copy/spot-follower/query-history-orders`,
@@ -2043,7 +2045,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getSpotFollowerOpenOrders( getSpotFollowerOpenOrders(
params: GetSpotFollowerOpenOrdersRequest, params: GetSpotFollowerOpenOrdersRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate( return this.getPrivate(
`/api/v2/copy/spot-follower/query-current-orders`, `/api/v2/copy/spot-follower/query-current-orders`,
@@ -2085,13 +2087,13 @@ export class RestClientV2 extends BaseRestClient {
} }
getEarnSavingsAssets( getEarnSavingsAssets(
params: GetEarnSavingsAssetsRequest, params: GetEarnSavingsAssetsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/savings/assets`, params); return this.getPrivate(`/api/v2/earn/savings/assets`, params);
} }
getEarnSavingsRecords( getEarnSavingsRecords(
params: GetEarnSavingsRecordsRequest, params: GetEarnSavingsRecordsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/savings/records`, params); return this.getPrivate(`/api/v2/earn/savings/records`, params);
} }
@@ -2118,7 +2120,7 @@ export class RestClientV2 extends BaseRestClient {
return this.getPrivate(`/api/v2/earn/savings/subscribe-result`, params); return this.getPrivate(`/api/v2/earn/savings/subscribe-result`, params);
} }
earnRedeemSavings(params: RedeemSavingsRequest): Promise<APIResponse<any>> { earnRedeemSavings(params: RedeemSavingsRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/earn/savings/redeem`, params); return this.postPrivate(`/api/v2/earn/savings/redeem`, params);
} }
@@ -2162,13 +2164,13 @@ export class RestClientV2 extends BaseRestClient {
} }
getSharkfinAssets( getSharkfinAssets(
params: GetSharkfinAssetsRequest, params: GetSharkfinAssetsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/sharkfin/assets`, params); return this.getPrivate(`/api/v2/earn/sharkfin/assets`, params);
} }
getSharkfinRecords( getSharkfinRecords(
params: GetSharkfinRecordsRequest, params: GetSharkfinRecordsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/sharkfin/records`, params); return this.getPrivate(`/api/v2/earn/sharkfin/records`, params);
} }
@@ -2205,12 +2207,12 @@ export class RestClientV2 extends BaseRestClient {
} }
getLoanEstInterestAndBorrowable( getLoanEstInterestAndBorrowable(
params: GetLoanEstInterestAndBorrowableRequest, params: GetLoanEstInterestAndBorrowableRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.get(`/api/v2/earn/loan/public/hour-interest`, params); return this.get(`/api/v2/earn/loan/public/hour-interest`, params);
} }
borrowLoan(params: BorrowLoanRequest): Promise<APIResponse<any>> { borrowLoan(params: BorrowLoanRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/earn/loan/borrow`, params); return this.postPrivate(`/api/v2/earn/loan/borrow`, params);
} }
@@ -2222,29 +2224,29 @@ export class RestClientV2 extends BaseRestClient {
return this.getPrivate(`/api/v2/earn/loan/ongoing-orders`, params); return this.getPrivate(`/api/v2/earn/loan/ongoing-orders`, params);
} }
repayLoan(params: RepayLoanRequest): Promise<APIResponse<any>> { repayLoan(params: RepayLoanRequestV2): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/earn/loan/repay`, params); return this.postPrivate(`/api/v2/earn/loan/repay`, params);
} }
getRepayHistory( getRepayHistory(
params: GetLoanRepayHistoryRequest, params: GetLoanRepayHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/loan/repay-history`, params); return this.getPrivate(`/api/v2/earn/loan/repay-history`, params);
} }
updateLoanPledgeRate( updateLoanPledgeRate(
params: ModifyLoanPledgeRateRequest, params: ModifyLoanPledgeRateRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.postPrivate(`/api/v2/earn/loan/revise-pledge`, params); return this.postPrivate(`/api/v2/earn/loan/revise-pledge`, params);
} }
getLoanPledgeRateHistory( getLoanPledgeRateHistory(
params: GetLoanPledgeRateHistoryRequest, params: GetLoanPledgeRateHistoryRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/loan/revise-history`, params); return this.getPrivate(`/api/v2/earn/loan/revise-history`, params);
} }
getLoanHistory(params: GetLoanHistoryRequest): Promise<APIResponse<any>> { getLoanHistory(params: GetLoanHistoryRequestV2): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/loan/borrow-history`, params); return this.getPrivate(`/api/v2/earn/loan/borrow-history`, params);
} }
@@ -2253,7 +2255,7 @@ export class RestClientV2 extends BaseRestClient {
} }
getLoanLiquidationRecords( getLoanLiquidationRecords(
params: GetLiquidationRecordsRequest, params: GetLiquidationRecordsRequestV2,
): Promise<APIResponse<any>> { ): Promise<APIResponse<any>> {
return this.getPrivate(`/api/v2/earn/loan/reduces`, params); return this.getPrivate(`/api/v2/earn/loan/reduces`, params);
} }

View File

@@ -4,7 +4,7 @@
* *
*/ */
export interface GetSubaccountsRequest { export interface GetSubAccountsRequestV2 {
limit?: string; limit?: string;
idLessThan?: string; idLessThan?: string;
status?: 'normal' | 'freeze' | 'del'; status?: 'normal' | 'freeze' | 'del';
@@ -12,7 +12,7 @@ export interface GetSubaccountsRequest {
endTime?: string; endTime?: string;
} }
export type SubaccountPermission = export type SubAccountPermission =
| 'withdraw' | 'withdraw'
| 'transfer' | 'transfer'
| 'spot_trade' | 'spot_trade'
@@ -21,7 +21,7 @@ export type SubaccountPermission =
| 'deposit' | 'deposit'
| 'margin_trade'; | 'margin_trade';
export type SubaccountLanguage = export type SubAccountLanguage =
| 'en_US' | 'en_US'
| 'zh_CN' | 'zh_CN'
| 'ja_JP' | 'ja_JP'
@@ -35,16 +35,16 @@ export type SubaccountLanguage =
| 'pt_PT' | 'pt_PT'
| 'th_TH'; | 'th_TH';
export type SubaccountStatus = 'normal' | 'freeze'; export type SubAccountStatus = 'normal' | 'freeze';
export interface ModifySubRequest { export interface ModifySubRequestV2 {
subUid: string; subUid: string;
permList: SubaccountPermission[]; permList: SubAccountPermission[];
status: SubaccountStatus; status: SubAccountStatus;
language?: SubaccountLanguage; language?: SubAccountLanguage;
} }
export interface SubWithdrawalRequest { export interface SubWithdrawalRequestV2 {
subUid: string; subUid: string;
coin: string; coin: string;
dest: 'on_chain' | 'internal_transfer'; dest: 'on_chain' | 'internal_transfer';
@@ -55,7 +55,7 @@ export interface SubWithdrawalRequest {
clientOid?: string; clientOid?: string;
} }
export interface SubDepositRecordsRequest { export interface SubDepositRecordsRequestV2 {
orderId?: string; orderId?: string;
userId?: string; userId?: string;
startTime?: string; startTime?: string;
@@ -64,7 +64,7 @@ export interface SubDepositRecordsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface SubWithdrawalRecordsRequest { export interface SubWithdrawalRecordsRequestV2 {
orderId?: string; orderId?: string;
userId?: string; userId?: string;
startTime?: string; startTime?: string;
@@ -79,7 +79,7 @@ export interface SubWithdrawalRecordsRequest {
* *
*/ */
export interface CreateSubaccountApiKeyRequest { export interface CreateSubAccountApiKeyRequestV2 {
subUid: string; subUid: string;
passphrase: string; passphrase: string;
label?: string; label?: string;
@@ -88,7 +88,7 @@ export interface CreateSubaccountApiKeyRequest {
permList: string[]; permList: string[];
} }
export interface ModifySubaccountApiKeyRequest { export interface ModifySubAccountApiKeyRequestV2 {
subUid: string; subUid: string;
apiKey: string; apiKey: string;
label?: string; label?: string;

View File

@@ -6,7 +6,7 @@ import { FuturesProductTypeV2, MarginType } from '../shared';
* *
*/ */
export interface GetAnnouncementsRequest { export interface GetAnnouncementsRequestV2 {
annType?: string; annType?: string;
startTime?: string; startTime?: string;
endTime?: string; endTime?: string;
@@ -19,7 +19,7 @@ export interface GetAnnouncementsRequest {
* *
*/ */
export interface GetTradeRateRequest { export interface GetTradeRateRequestV2 {
symbol: string; symbol: string;
businessType: string; businessType: string;
} }
@@ -30,7 +30,7 @@ export interface GetTradeRateRequest {
* *
*/ */
export interface GetSpotTransactionsRequest { export interface GetSpotTransactionsRequestV2 {
coin?: string; coin?: string;
startTime: string; startTime: string;
endTime: string; endTime: string;
@@ -38,7 +38,7 @@ export interface GetSpotTransactionsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetFuturesTransactionsRequest { export interface GetFuturesTransactionsRequestV2 {
productType?: FuturesProductTypeV2; productType?: FuturesProductTypeV2;
marginCoin?: string; marginCoin?: string;
startTime: string; startTime: string;
@@ -47,7 +47,7 @@ export interface GetFuturesTransactionsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetMarginTransactionsRequest { export interface GetMarginTransactionsRequestV2 {
marginType?: MarginType; marginType?: MarginType;
coin?: string; coin?: string;
startTime: string; startTime: string;
@@ -56,7 +56,7 @@ export interface GetMarginTransactionsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetP2PTransactionsRequest { export interface GetP2PTransactionsRequestV2 {
coin?: string; coin?: string;
startTime: string; startTime: string;
endTime: string; endTime: string;
@@ -70,13 +70,13 @@ export interface GetP2PTransactionsRequest {
* *
*/ */
export interface GetP2PMerchantsRequest { export interface GetP2PMerchantsRequestV2 {
online?: 'yes' | 'no'; online?: 'yes' | 'no';
idLessThan?: string; idLessThan?: string;
limit?: string; limit?: string;
} }
export interface GetMerchantP2POrdersRequest { export interface GetMerchantP2POrdersRequestV2 {
startTime: string; startTime: string;
endTime?: string; endTime?: string;
idLessThan?: string; idLessThan?: string;
@@ -90,7 +90,7 @@ export interface GetMerchantP2POrdersRequest {
orderNo?: string; orderNo?: string;
} }
export interface GetMerchantAdvertisementsRequest { export interface GetMerchantAdvertisementsRequestV2 {
startTime: string; startTime: string;
endTime?: string; endTime?: string;
idLessThan?: string; idLessThan?: string;
@@ -112,13 +112,13 @@ export interface GetMerchantAdvertisementsRequest {
* *
*/ */
export interface ModifyVirtualSubRequest { export interface ModifyVirtualSubRequestV2 {
subAccountUid: string; subAccountUid: string;
permList: string[]; permList: string[];
status: string; status: string;
} }
export interface CreateVirtualSubRequest { export interface CreateVirtualSubRequestV2 {
subAccountName: string; subAccountName: string;
passphrase: string; passphrase: string;
label: string; label: string;
@@ -126,7 +126,7 @@ export interface CreateVirtualSubRequest {
permList?: string[]; permList?: string[];
} }
export interface CreateVirtualSubApiKeyRequest { export interface CreateVirtualSubApiKeyRequestV2 {
subAccountUid: string; subAccountUid: string;
passphrase: string; passphrase: string;
label: string; label: string;
@@ -134,7 +134,7 @@ export interface CreateVirtualSubApiKeyRequest {
permList?: string[]; permList?: string[];
} }
export interface ModifyVirtualSubApiKeyRequest { export interface ModifyVirtualSubApiKeyRequestV2 {
subAccountUid: string; subAccountUid: string;
subAccountApiKey: string; subAccountApiKey: string;
passphrase: string; passphrase: string;
@@ -149,14 +149,14 @@ export interface ModifyVirtualSubApiKeyRequest {
* *
*/ */
export interface ConvertQuoteRequest { export interface ConvertQuoteRequestV2 {
fromCoin: string; fromCoin: string;
fromCoinSize?: string; fromCoinSize?: string;
toCoin: string; toCoin: string;
toCoinSize?: string; toCoinSize?: string;
} }
export interface ConvertRequest { export interface ConvertRequestV2 {
fromCoin: string; fromCoin: string;
fromCoinSize: string; fromCoinSize: string;
cnvtPrice: string; cnvtPrice: string;
@@ -165,7 +165,7 @@ export interface ConvertRequest {
traceId: string; traceId: string;
} }
export interface GetConvertHistoryRequest { export interface GetConvertHistoryRequestV2 {
startTime: string; startTime: string;
endTime: string; endTime: string;
limit?: string; limit?: string;
@@ -178,7 +178,7 @@ export interface GetConvertHistoryRequest {
* *
*/ */
export interface GetConvertBGBHistoryRequest { export interface GetConvertBGBHistoryRequestV2 {
orderId?: string; orderId?: string;
startTime: string; startTime: string;
endTime: string; endTime: string;

View File

@@ -11,7 +11,7 @@ export type CopyTradingProductType =
| 'COIN-FUTURES' | 'COIN-FUTURES'
| 'USDC-FUTURES'; | 'USDC-FUTURES';
export interface GetFuturesTraderCurrentOrdersRequest { export interface GetFuturesTraderCurrentOrdersRequestV2 {
symbol?: string; symbol?: string;
productType: CopyTradingProductType; productType: CopyTradingProductType;
startTime?: string; startTime?: string;
@@ -21,7 +21,7 @@ export interface GetFuturesTraderCurrentOrdersRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetFuturesTraderHistoryOrdersRequest { export interface GetFuturesTraderHistoryOrdersRequestV2 {
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
startTime?: string; startTime?: string;
@@ -32,14 +32,14 @@ export interface GetFuturesTraderHistoryOrdersRequest {
productType: CopyTradingProductType; productType: CopyTradingProductType;
} }
export interface ModifyFuturesTraderOrderTPSLRequest { export interface ModifyFuturesTraderOrderTPSLRequestV2 {
trackingNo: string; trackingNo: string;
productType: CopyTradingProductType; productType: CopyTradingProductType;
stopSurplusPrice?: string; stopSurplusPrice?: string;
stopLossPrice?: string; stopLossPrice?: string;
} }
export interface GetFuturesTraderProfitShareDetailRequest { export interface GetFuturesTraderProfitShareDetailRequestV2 {
coin?: string; coin?: string;
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
@@ -48,7 +48,7 @@ export interface GetFuturesTraderProfitShareDetailRequest {
limit?: string; limit?: string;
} }
export interface FuturesTraderSymbolSettingReq { export interface FuturesTraderSymbolSettingRequestV2 {
symbol: string; symbol: string;
productType: CopyTradingProductType; productType: CopyTradingProductType;
settingType: 'ADD' | 'DELETE' | 'UPDATE'; settingType: 'ADD' | 'DELETE' | 'UPDATE';
@@ -56,7 +56,7 @@ export interface FuturesTraderSymbolSettingReq {
stopLossRatio?: string; stopLossRatio?: string;
} }
export interface GetFuturesTraderFollowers { export interface GetFuturesTraderFollowersRequestV2 {
pageNo?: string; pageNo?: string;
pageSize?: string; pageSize?: string;
startTime?: string; startTime?: string;
@@ -71,7 +71,7 @@ export interface GetFuturesTraderFollowers {
* *
*/ */
export interface GetFollowerFuturesCurrentTrackingOrdersRequest { export interface GetFollowerFuturesCurrentTrackingOrdersRequestV2 {
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
startTime?: string; startTime?: string;
@@ -82,7 +82,7 @@ export interface GetFollowerFuturesCurrentTrackingOrdersRequest {
traderId?: string; traderId?: string;
} }
export interface GetFollowerFuturesHistoryTrackingOrdersRequest { export interface GetFollowerFuturesHistoryTrackingOrdersRequestV2 {
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
startTime?: string; startTime?: string;
@@ -93,7 +93,7 @@ export interface GetFollowerFuturesHistoryTrackingOrdersRequest {
traderId?: string; traderId?: string;
} }
export interface UpdateFuturesFollowerTPSLRequest { export interface UpdateFuturesFollowerTPSLRequestV2 {
trackingNo: string; trackingNo: string;
symbol?: string; symbol?: string;
productType: CopyTradingProductType; productType: CopyTradingProductType;
@@ -106,7 +106,7 @@ export type FollowMode = 'basic' | 'advanced';
export type LeverageType = 'position' | 'specify' | 'trader'; export type LeverageType = 'position' | 'specify' | 'trader';
export type TraceType = 'percent' | 'amount' | 'count'; export type TraceType = 'percent' | 'amount' | 'count';
export interface FollowerCopyTradeSetting { export interface FollowerCopyTradeSettingRequestV2 {
symbol: string; symbol: string;
productType: CopyTradingProductType; productType: CopyTradingProductType;
marginType: 'trader' | 'specify'; marginType: 'trader' | 'specify';
@@ -121,13 +121,13 @@ export interface FollowerCopyTradeSetting {
stopLossRatio?: string; stopLossRatio?: string;
} }
export interface UpdateFuturesFollowerSettingsRequest { export interface UpdateFuturesFollowerSettingsRequestV2 {
traderId: string; traderId: string;
autoCopy?: AutoCopyOption; autoCopy?: AutoCopyOption;
mode?: FollowMode; mode?: FollowMode;
settings: FollowerCopyTradeSetting[]; settings: FollowerCopyTradeSettingRequestV2[];
} }
export interface CloseFuturesFollowerPositionsRequest { export interface CloseFuturesFollowerPositionsRequestV2 {
productType: CopyTradingProductType; productType: CopyTradingProductType;
trackingNo?: string; trackingNo?: string;
symbol?: string; symbol?: string;
@@ -136,7 +136,7 @@ export interface CloseFuturesFollowerPositionsRequest {
holdSide?: 'long' | 'short'; holdSide?: 'long' | 'short';
} }
export interface GetFuturesFollowerTradersRequest { export interface GetFuturesFollowerTradersRequestV2 {
startTime?: string; startTime?: string;
endTime?: string; endTime?: string;
pageNo?: string; pageNo?: string;
@@ -151,7 +151,7 @@ export interface GetFuturesFollowerTradersRequest {
* *
*/ */
export interface getSpotTraderHistoryProfitReq { export interface GetSpotTraderHistoryProfitRequestV2 {
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
startTime?: string; startTime?: string;
@@ -160,7 +160,7 @@ export interface getSpotTraderHistoryProfitReq {
coin?: string; coin?: string;
} }
export interface GetSpotTraderHistoryOrdersReq { export interface GetSpotTraderHistoryOrdersRequestV2 {
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
startTime?: string; startTime?: string;
@@ -169,7 +169,7 @@ export interface GetSpotTraderHistoryOrdersReq {
symbol?: string; symbol?: string;
} }
export interface GetSpotTraderCurrentOrdersReq { export interface GetSpotTraderCurrentOrdersRequestV2 {
symbol?: string; symbol?: string;
idLessThan?: string; idLessThan?: string;
idGreaterThan?: string; idGreaterThan?: string;
@@ -178,7 +178,7 @@ export interface GetSpotTraderCurrentOrdersReq {
limit?: string; limit?: string;
} }
export interface GetSpotTraderFollowersRequest { export interface GetSpotTraderFollowersRequestV2 {
pageNo?: string; pageNo?: string;
pageSize?: string; pageSize?: string;
startTime?: string; startTime?: string;
@@ -193,7 +193,7 @@ export interface GetSpotTraderFollowersRequest {
* *
*/ */
export interface SpotFollowerCopyTradeSetting { export interface SpotFollowerCopyTradeSettingV2 {
symbol: string; symbol: string;
traceType: 'percent' | 'amount' | 'count'; traceType: 'percent' | 'amount' | 'count';
maxHoldSize: string; maxHoldSize: string;
@@ -202,7 +202,7 @@ export interface SpotFollowerCopyTradeSetting {
stopSurplusRatio?: string; stopSurplusRatio?: string;
} }
export interface GetSpotFollowerHistoryOrdersRequest { export interface GetSpotFollowerHistoryOrdersRequestV2 {
symbol?: string; symbol?: string;
traderId?: string; traderId?: string;
idLessThan?: string; idLessThan?: string;
@@ -212,7 +212,7 @@ export interface GetSpotFollowerHistoryOrdersRequest {
limit?: string; limit?: string;
} }
export interface GetSpotFollowerOpenOrdersRequest { export interface GetSpotFollowerOpenOrdersRequestV2 {
symbol?: string; symbol?: string;
traderId?: string; traderId?: string;
idLessThan?: string; idLessThan?: string;

View File

@@ -6,7 +6,7 @@
* *
*/ */
export interface GetEarnSavingsAssetsRequest { export interface GetEarnSavingsAssetsRequestV2 {
periodType: string; periodType: string;
startTime?: string; startTime?: string;
endTime?: string; endTime?: string;
@@ -14,7 +14,7 @@ export interface GetEarnSavingsAssetsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetEarnSavingsRecordsRequest { export interface GetEarnSavingsRecordsRequestV2 {
coin?: string; coin?: string;
periodType: string; periodType: string;
orderType?: string; orderType?: string;
@@ -24,7 +24,7 @@ export interface GetEarnSavingsRecordsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface RedeemSavingsRequest { export interface RedeemSavingsRequestV2 {
productId: string; productId: string;
orderId?: string; orderId?: string;
periodType: string; periodType: string;
@@ -39,7 +39,7 @@ export interface RedeemSavingsRequest {
* *
*/ */
export interface GetSharkfinAssetsRequest { export interface GetSharkfinAssetsRequestV2 {
status: string; status: string;
startTime?: string; startTime?: string;
endTime?: string; endTime?: string;
@@ -47,7 +47,7 @@ export interface GetSharkfinAssetsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetSharkfinRecordsRequest { export interface GetSharkfinRecordsRequestV2 {
coin?: string; coin?: string;
type: string; type: string;
startTime?: string; startTime?: string;
@@ -64,14 +64,14 @@ export interface GetSharkfinRecordsRequest {
* *
*/ */
export interface GetLoanEstInterestAndBorrowableRequest { export interface GetLoanEstInterestAndBorrowableRequestV2 {
loanCoin: string; loanCoin: string;
pledgeCoin: string; pledgeCoin: string;
daily: 'SEVEN' | 'THIRTY'; daily: 'SEVEN' | 'THIRTY';
pledgeAmount?: string; pledgeAmount?: string;
} }
export interface BorrowLoanRequest { export interface BorrowLoanRequestV2 {
loanCoin: string; loanCoin: string;
pledgeCoin: string; pledgeCoin: string;
daily: 'SEVEN' | 'THIRTY'; daily: 'SEVEN' | 'THIRTY';
@@ -79,14 +79,14 @@ export interface BorrowLoanRequest {
loanAmount?: string; loanAmount?: string;
} }
export interface RepayLoanRequest { export interface RepayLoanRequestV2 {
orderId: string; orderId: string;
amount?: string; amount?: string;
repayUnlock?: string; repayUnlock?: string;
repayAll: string; repayAll: string;
} }
export interface GetLoanRepayHistoryRequest { export interface GetLoanRepayHistoryRequestV2 {
orderId?: string; orderId?: string;
loanCoin?: string; loanCoin?: string;
pledgeCoin?: string; pledgeCoin?: string;
@@ -96,14 +96,14 @@ export interface GetLoanRepayHistoryRequest {
pageSize?: string; pageSize?: string;
} }
export interface ModifyLoanPledgeRateRequest { export interface ModifyLoanPledgeRateRequestV2 {
orderId: string; orderId: string;
amount: string; amount: string;
pledgeCoin: string; pledgeCoin: string;
reviseType: string; reviseType: string;
} }
export interface GetLoanPledgeRateHistoryRequest { export interface GetLoanPledgeRateHistoryRequestV2 {
orderId?: string; orderId?: string;
reviseSide?: string; reviseSide?: string;
pledgeCoin?: string; pledgeCoin?: string;
@@ -113,7 +113,7 @@ export interface GetLoanPledgeRateHistoryRequest {
pageSize?: string; pageSize?: string;
} }
export interface GetLoanHistoryRequest { export interface GetLoanHistoryRequestV2 {
orderId?: string; orderId?: string;
loanCoin?: string; loanCoin?: string;
pledgeCoin?: string; pledgeCoin?: string;
@@ -124,7 +124,7 @@ export interface GetLoanHistoryRequest {
pageSize?: string; pageSize?: string;
} }
export interface GetLiquidationRecordsRequest { export interface GetLiquidationRecordsRequestV2 {
orderId?: string; orderId?: string;
loanCoin?: string; loanCoin?: string;
pledgeCoin?: string; pledgeCoin?: string;

View File

@@ -4,7 +4,7 @@
* *
*/ */
export interface GetBorrowHistoryRequest { export interface GetBorrowHistoryRequestV2 {
loanId?: string; loanId?: string;
coin?: string; coin?: string;
startTime: string; startTime: string;
@@ -13,7 +13,7 @@ export interface GetBorrowHistoryRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetRepayHistoryRequest { export interface GetRepayHistoryRequestV2 {
repayId?: string; repayId?: string;
coin?: string; coin?: string;
startTime: string; startTime: string;
@@ -22,7 +22,7 @@ export interface GetRepayHistoryRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetInterestHistoryRequest { export interface GetInterestHistoryRequestV2 {
coin?: string; coin?: string;
startTime: string; startTime: string;
endTime?: string; endTime?: string;
@@ -30,14 +30,14 @@ export interface GetInterestHistoryRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetLiquidationHistoryRequest { export interface GetLiquidationHistoryRequestV2 {
startTime: string; startTime: string;
endTime?: string; endTime?: string;
limit?: string; limit?: string;
idLessThan?: string; idLessThan?: string;
} }
export interface GetFinancialHistoryRequest { export interface GetFinancialHistoryRequestV2 {
marginType?: string; marginType?: string;
coin?: string; coin?: string;
startTime: string; startTime: string;
@@ -76,7 +76,7 @@ export type MarginSTPMode =
| 'cancel_maker' | 'cancel_maker'
| 'cancel_both'; | 'cancel_both';
export interface MarginPlaceOrderRequest { export interface MarginPlaceOrderRequestV2 {
symbol: string; symbol: string;
orderType: MarginOrderType; orderType: MarginOrderType;
price?: string; price?: string;
@@ -101,12 +101,12 @@ export interface MarginBatchOrderEntry {
stpMode?: MarginSTPMode; stpMode?: MarginSTPMode;
} }
export interface MarginBatchOrdersRequest { export interface MarginBatchOrdersRequestV2 {
symbol: string; symbol: string;
orderList: MarginBatchOrderEntry[]; orderList: MarginBatchOrderEntry[];
} }
export interface GetMarginCurrentOrdersRequest { export interface GetMarginCurrentOrdersRequestV2 {
symbol: string; symbol: string;
orderId?: string; orderId?: string;
clientOid?: string; clientOid?: string;
@@ -116,7 +116,7 @@ export interface GetMarginCurrentOrdersRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetHistoryOrdersRequest { export interface GetHistoryOrdersRequestV2 {
symbol: string; symbol: string;
orderId?: string; orderId?: string;
enterPointSource?: string; enterPointSource?: string;
@@ -127,7 +127,7 @@ export interface GetHistoryOrdersRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetMarginOrderFillsRequest { export interface GetMarginOrderFillsRequestV2 {
symbol: string; symbol: string;
orderId?: string; orderId?: string;
idLessThan?: string; idLessThan?: string;
@@ -136,7 +136,7 @@ export interface GetMarginOrderFillsRequest {
limit?: string; limit?: string;
} }
export interface GetMarginLiquidationOrdersRequest { export interface GetMarginLiquidationOrdersRequestV2 {
type?: 'swap' | 'place_order'; type?: 'swap' | 'place_order';
symbol?: string; symbol?: string;
fromCoin?: string; fromCoin?: string;

View File

@@ -33,7 +33,7 @@ export interface SpotHistoricCandlesRequestV2 {
limit?: string; limit?: string;
} }
export interface SpotHistoricTradesRequest { export interface SpotHistoricTradesRequestV2 {
symbol: string; symbol: string;
limit?: string; limit?: string;
idLessThan?: string; idLessThan?: string;
@@ -63,7 +63,7 @@ export type SpotSTPMode =
export type SpotBatchMode = 'single' | 'multiple'; export type SpotBatchMode = 'single' | 'multiple';
export interface SpotOrderRequest { export interface SpotOrderRequestV2 {
symbol: string; symbol: string;
side: SpotOrderSide; side: SpotOrderSide;
orderType: SpotOrderType; orderType: SpotOrderType;
@@ -82,7 +82,7 @@ export interface SpotOrderRequest {
executeStopLossPrice?: string; executeStopLossPrice?: string;
} }
export interface SpotCancelandSubmitOrderRequest { export interface SpotCancelandSubmitOrderRequestV2 {
symbol: string; symbol: string;
price: string; price: string;
size: string; size: string;
@@ -95,14 +95,14 @@ export interface SpotCancelandSubmitOrderRequest {
executeStopLossPrice?: string; executeStopLossPrice?: string;
} }
export interface SpotCancelOrderRequest { export interface SpotCancelOrderRequestV2 {
symbol: string; symbol: string;
tpslType?: SpotTPSLType; tpslType?: SpotTPSLType;
orderId?: string; orderId?: string;
clientOid?: string; clientOid?: string;
} }
export interface SpotBatchOrderRequestItem { export interface SpotBatchOrderRequestItemV2 {
symbol?: string; symbol?: string;
side: SpotOrderSide; side: SpotOrderSide;
orderType: SpotOrderType; orderType: SpotOrderType;
@@ -117,13 +117,13 @@ export interface SpotBatchOrderRequestItem {
executeStopLossPrice?: string; executeStopLossPrice?: string;
} }
export interface SpotBatchOrderRequest { export interface SpotBatchOrderRequestV2 {
symbol?: string; symbol?: string;
batchMode?: SpotBatchMode; batchMode?: SpotBatchMode;
orderList: SpotBatchOrderRequestItem[]; orderList: SpotBatchOrderRequestItemV2[];
} }
export interface SpotBatchCancelOrderRequest { export interface SpotBatchCancelOrderRequestV2 {
symbol?: string; symbol?: string;
batchMode?: SpotBatchMode; batchMode?: SpotBatchMode;
orderList: { orderList: {
@@ -133,14 +133,14 @@ export interface SpotBatchCancelOrderRequest {
}[]; }[];
} }
export interface GetSpotOrderInfoRequest { export interface GetSpotOrderInfoRequestV2 {
orderId?: string; orderId?: string;
clientOid?: string; clientOid?: string;
requestTime?: string; requestTime?: string;
receiveWindow?: string; receiveWindow?: string;
} }
export interface GetSpotOpenOrdersRequest { export interface GetSpotOpenOrdersRequestV2 {
symbol?: string; symbol?: string;
startTime?: string; startTime?: string;
endTime?: string; endTime?: string;
@@ -152,7 +152,7 @@ export interface GetSpotOpenOrdersRequest {
receiveWindow?: string; receiveWindow?: string;
} }
export interface GetSpotHistoryOrdersRequest { export interface GetSpotHistoryOrdersRequestV2 {
symbol?: string; symbol?: string;
startTime?: string; startTime?: string;
endTime?: string; endTime?: string;
@@ -164,7 +164,7 @@ export interface GetSpotHistoryOrdersRequest {
receiveWindow?: string; receiveWindow?: string;
} }
export interface GetSpotFillsRequest { export interface GetSpotFillsRequestV2 {
symbol: string; symbol: string;
orderId?: string; orderId?: string;
startTime?: string; startTime?: string;
@@ -183,7 +183,7 @@ export type SpotPlanType = 'amount' | 'total';
export type SpotTriggerType = 'fill_price' | 'mark_price'; export type SpotTriggerType = 'fill_price' | 'mark_price';
export interface SpotPlanOrderRequest { export interface SpotPlanOrderRequestV2 {
symbol: string; symbol: string;
side: SpotOrderSide; side: SpotOrderSide;
triggerPrice: string; triggerPrice: string;
@@ -197,7 +197,7 @@ export interface SpotPlanOrderRequest {
stpMode?: SpotSTPMode; stpMode?: SpotSTPMode;
} }
export interface SpotModifyPlanOrderRequest { export interface SpotModifyPlanOrderRequestV2 {
orderId?: string; orderId?: string;
clientOid?: string; clientOid?: string;
triggerPrice: string; triggerPrice: string;
@@ -206,7 +206,7 @@ export interface SpotModifyPlanOrderRequest {
size: string; size: string;
} }
export interface GetSpotCurrentPlanOrdersRequest { export interface GetSpotCurrentPlanOrdersRequestV2 {
symbol: string; symbol: string;
limit?: string; limit?: string;
idLessThan?: string; idLessThan?: string;
@@ -214,7 +214,7 @@ export interface GetSpotCurrentPlanOrdersRequest {
endTime?: string; endTime?: string;
} }
export interface GetSpotHistoryPlanOrdersRequest { export interface GetSpotHistoryPlanOrdersRequestV2 {
symbol: string; symbol: string;
startTime: string; startTime: string;
endTime: string; endTime: string;
@@ -258,7 +258,7 @@ export type SpotAccountType =
| 'crossed_margin' | 'crossed_margin'
| 'isolated_margin'; | 'isolated_margin';
export interface GetSpotAccountBillsRequest { export interface GetSpotAccountBillsRequestV2 {
coin?: string; coin?: string;
groupType?: SpotBillGroupType; groupType?: SpotBillGroupType;
businessType?: SpotBusinessType; businessType?: SpotBusinessType;
@@ -268,7 +268,7 @@ export interface GetSpotAccountBillsRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface SpotTransferRequest { export interface SpotTransferRequestV2 {
fromType: SpotAccountType; fromType: SpotAccountType;
toType: SpotAccountType; toType: SpotAccountType;
amount: string; amount: string;
@@ -277,7 +277,7 @@ export interface SpotTransferRequest {
clientOid?: string; clientOid?: string;
} }
export interface SpotSubAccountTransferRequest { export interface SpotSubAccountTransferRequestV2 {
fromType: SpotAccountType; fromType: SpotAccountType;
toType: SpotAccountType; toType: SpotAccountType;
amount: string; amount: string;
@@ -288,7 +288,7 @@ export interface SpotSubAccountTransferRequest {
toUserId: string; toUserId: string;
} }
export interface SpotWithdrawalRequest { export interface SpotWithdrawalRequestV2 {
coin: string; coin: string;
transferType: 'on_chain' | 'internal_transfer'; transferType: 'on_chain' | 'internal_transfer';
address: string; address: string;
@@ -301,7 +301,7 @@ export interface SpotWithdrawalRequest {
clientOid?: string; clientOid?: string;
} }
export interface SpotMainSubTransferRecordRequest { export interface SpotMainSubTransferRecordRequestV2 {
coin?: string; coin?: string;
role?: 'initiator' | 'receiver'; role?: 'initiator' | 'receiver';
subUid?: string; subUid?: string;
@@ -312,7 +312,7 @@ export interface SpotMainSubTransferRecordRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetSpotTransferRecordRequest { export interface GetSpotTransferRecordRequestV2 {
coin: string; coin: string;
fromType: SpotAccountType; fromType: SpotAccountType;
startTime?: string; startTime?: string;
@@ -322,7 +322,7 @@ export interface GetSpotTransferRecordRequest {
idLessThan?: string; idLessThan?: string;
} }
export interface GetSpotSubAccountDepositRecordRequest { export interface GetSpotSubAccountDepositRecordRequestV2 {
subUid: string; subUid: string;
coin?: string; coin?: string;
startTime?: string; startTime?: string;
@@ -331,7 +331,7 @@ export interface GetSpotSubAccountDepositRecordRequest {
limit?: string; limit?: string;
} }
export interface GetSpotWithdrawalRecordRequest { export interface GetSpotWithdrawalRecordRequestV2 {
coin?: string; coin?: string;
clientOid?: string; clientOid?: string;
startTime: string; startTime: string;
@@ -341,7 +341,7 @@ export interface GetSpotWithdrawalRecordRequest {
limit?: string; limit?: string;
} }
export interface GetSpotDepositRecordRequest { export interface GetSpotDepositRecordRequestV2 {
coin?: string; coin?: string;
orderId?: string; orderId?: string;
startTime: string; startTime: string;