feat(): updated types to be more readable

This commit is contained in:
JJ-Cro
2024-12-17 13:44:14 +01:00
parent f35e32a836
commit ba6b83aa14
8 changed files with 1127 additions and 1028 deletions

View File

@@ -1,17 +1,21 @@
import {
AnnouncementV2,
APIResponse,
BGBConvertCoinsV2,
BGBConvertCoinV2,
BGBConvertHistoryV2,
BorrowLoanRequestV2,
BotAssetsV2,
BotAssetV2,
BrokerSubaccountFutureAssetV2,
BrokerSubaccountSpotAssetV2,
BrokerSubaccountV2,
BrokerSubaccountWithdrawalV2,
CancelAndSubmitSpotOrderResponseV2,
CloseFuturesFollowerPositionsRequestV2,
ConvertBGBResponseV2,
ConvertCurrenciesV2,
ConvertHistoryV2,
ConvertCurrencyV2,
ConvertQuotedPriceV2,
ConvertQuoteRequestV2,
ConvertRecordV2,
ConvertRequestV2,
ConvertTradeResponseV2,
CopyTradingProductTypeV2,
@@ -32,7 +36,7 @@ import {
CTFuturesFollowerHistoryOrdersV2,
CTFuturesFollowerMyTradersV2,
CTFuturesFollowerSettingsV2,
CTFuturesTraderCurrentOrderV2,
CTFuturesTraderCurrentOrdersV2,
CTFuturesTraderHistoryOrderV2,
CTFuturesTraderHistoryProfitSummaryV2,
CTFuturesTraderMyFollowersV2,
@@ -68,10 +72,10 @@ import {
EarnSharkfinProductsV2,
EarnSharkfinRecordsV2,
EarnSharkfinSubscriptionDetailV2,
FundingAssetsV2,
FundingAssetV2,
FuturesAccountBillRequestV2,
FuturesAccountBillV2,
FuturesAccountListV2,
FuturesAccountsV2,
FuturesAccountV2,
FuturesActiveBuySellVolumeV2,
FuturesActiveLongShortAccountV2,
@@ -88,7 +92,7 @@ import {
FuturesCandlestickV2,
FuturesClosePositionResponseV2,
FuturesContractConfigV2,
FuturesDiscountRateV2,
FuturesDiscountRatesV2,
FuturesFillV2,
FuturesFlashClosePositionsRequestV2,
FuturesFundingTimeV2,
@@ -101,14 +105,14 @@ import {
FuturesGetPlanOrdersRequestV2,
FuturesHistoricalFundingRateV2,
FuturesHistoricalPositionsRequestV2,
FuturesHistoricalPositionV2,
FuturesHistoricTradesRequestV2,
FuturesHistoryOrdersV2,
FuturesHistoryInterestRateV2,
FuturesHistoryOrderV2,
FuturesHistoryPlanOrderV2,
FuturesHistoryPositionV2,
FuturesInterestExchangeRateV2,
FuturesInterestHistoryRequestV2,
FuturesInterestHistoryV2,
FuturesInterestRateHistoryV2,
FuturesLongShortRatioV2,
FuturesMergeDepthRequestV2,
FuturesMergeDepthV2,
@@ -117,9 +121,9 @@ import {
FuturesModifyTPSLOrderRequestV2,
FuturesOpenCountRequestV2,
FuturesOpenInterestV2,
FuturesOpenOrdersV2,
FuturesOpenOrderV2,
FuturesOrderDetailV2,
FuturesOrderFillsV2,
FuturesOrderFillV2,
FuturesPendingPlanOrderV2,
FuturesPlaceOrderRequestV2,
FuturesPlanOrderRequestV2,
@@ -133,7 +137,7 @@ import {
FuturesSetMarginModeRequestV2,
FuturesSetPositionMarginRequestV2,
FuturesSingleAccountRequestV2,
FuturesSubAccountAssetsV2,
FuturesSubAccountAssetV2,
FuturesSymbolPriceV2,
FuturesTickerV2,
FuturesTPSLOrderRequestV2,
@@ -204,18 +208,18 @@ import {
MarginAccountAssetV2,
MarginBatchOrdersRequestV2,
MarginBatchOrdersResponseV2,
MarginBorrowHistoryV2,
MarginBorrowHistoryItemV2,
MarginCurrencyV2,
MarginCurrentOrdersV2,
MarginFinancialHistoryV2,
MarginHistoryOrdersV2,
MarginInterestHistoryV2,
MarginLiquidationHistoryV2,
MarginLiquidationOrdersV2,
MarginCurrentOrderV2,
MarginFinancialHistoryItemV2,
MarginHistoryOrderV2,
MarginInterestHistoryItemV2,
MarginLiquidationHistoryItemV2,
MarginLiquidationOrderV2,
MarginLoanGrowthRateV2,
MarginOrderFillsV2,
MarginOrderFillV2,
MarginPlaceOrderRequestV2,
MarginRepaymentHistoryV2,
MarginRepaymentHistoryItemV2,
MarginTransactionRecordV2,
MarginType,
ModifyFuturesTraderOrderTPSLRequestV2,
@@ -227,10 +231,11 @@ import {
ModifyVirtualSubAccountApiKeyV2,
ModifyVirtualSubApiKeyRequestV2,
ModifyVirtualSubRequestV2,
P2PMerchantAdvertisementV2,
P2PMerchantAdvertismentV2,
P2PMerchantInfoV2,
P2PMerchantListV2,
P2PMerchantOrdersV2,
P2PMerchantOrderV2,
P2PMerchantV2,
RedeemSavingsRequestV2,
RepayLoanRequestV2,
SetLeverageResponseV2,
@@ -255,6 +260,7 @@ import {
SpotFundFlowV2,
SpotHistoricCandlesRequestV2,
SpotHistoricTradesRequestV2,
SpotHistoryPlanOrderV2,
SpotMainSubTransferRecordRequestV2,
SpotMainSubTransferRecordV2,
SpotMergeDepthV2,
@@ -278,21 +284,17 @@ import {
SpotWhaleNetFlowV2,
SpotWithdrawalRecordV2,
SpotWithdrawalRequestV2,
SubAccountApiKeyListV2,
SubAccountApiKeyItemV2,
SubaccountApiKeyV2,
SubaccountDepositV2,
SubaccountEmailV2,
SubaccountFutureAssetsV2,
SubaccountsListV2,
SubaccountSpotAssetsV2,
SubaccountWithdrawalV2,
SubDepositRecordsRequestV2,
SubmitSpotBatchOrdersResponseV2,
SubWithdrawalRecordsRequestV2,
SubWithdrawalRequestV2,
UpdateFuturesFollowerSettingsRequestV2,
UpdateFuturesFollowerTPSLRequestV2,
VirtualSubAccountListV2,
VirtualSubAccountV2,
} from './types';
import { assertMarginType, REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient';
@@ -448,7 +450,7 @@ export class RestClientV2 extends BaseRestClient {
getP2PTransactionRecords(
params: GetP2PTransactionsRequestV2,
): Promise<APIResponse<P2PMerchantOrderV2[]>> {
): Promise<APIResponse<P2PMerchantOrdersV2[]>> {
return this.getPrivate('/api/v2/tax/p2p-record', params);
}
@@ -458,9 +460,12 @@ export class RestClientV2 extends BaseRestClient {
*
*/
getP2PMerchantList(
params?: GetP2PMerchantsRequestV2,
): Promise<APIResponse<P2PMerchantListV2>> {
getP2PMerchantList(params?: GetP2PMerchantsRequestV2): Promise<
APIResponse<{
merchantList: P2PMerchantV2[];
minMerchantId: string;
}>
> {
return this.getPrivate('/api/v2/p2p/merchantList', params);
}
@@ -468,15 +473,23 @@ export class RestClientV2 extends BaseRestClient {
return this.getPrivate('/api/v2/p2p/merchantInfo');
}
getP2PMerchantOrders(
params: GetMerchantP2POrdersRequestV2,
): Promise<APIResponse<P2PMerchantOrderV2>> {
getP2PMerchantOrders(params: GetMerchantP2POrdersRequestV2): Promise<
APIResponse<{
orderList: P2PMerchantOrderV2[];
minOrderId: string;
}>
> {
return this.getPrivate('/api/v2/p2p/orderList', params);
}
getP2PMerchantAdvertisementList(
params: GetMerchantAdvertisementsRequestV2,
): Promise<APIResponse<P2PMerchantAdvertisementV2>> {
): Promise<
APIResponse<{
advList: P2PMerchantAdvertismentV2[];
minAdvId: string;
}>
> {
return this.getPrivate('/api/v2/p2p/advList', params);
}
@@ -603,7 +616,12 @@ export class RestClientV2 extends BaseRestClient {
limit?: string;
idLessThan?: string;
status?: 'normal' | 'freeze';
}): Promise<APIResponse<VirtualSubAccountListV2>> {
}): Promise<
APIResponse<{
endId: string;
subAccountList: VirtualSubAccountV2[];
}>
> {
return this.getPrivate('/api/v2/user/virtual-subaccount-list', params);
}
@@ -627,7 +645,7 @@ export class RestClientV2 extends BaseRestClient {
getVirtualSubaccountAPIKeys(params: {
subAccountUid: string;
}): Promise<APIResponse<SubAccountApiKeyListV2[]>> {
}): Promise<APIResponse<SubAccountApiKeyItemV2[]>> {
return this.getPrivate(
'/api/v2/user/virtual-subaccount-apikey-list',
params,
@@ -641,13 +659,13 @@ export class RestClientV2 extends BaseRestClient {
*/
getFundingAssets(params?: {
coin?: string;
}): Promise<APIResponse<FundingAssetsV2[]>> {
}): Promise<APIResponse<FundingAssetV2[]>> {
return this.getPrivate('/api/v2/account/funding-assets', params);
}
getBotAccount(params?: {
accountType?: string;
}): Promise<APIResponse<BotAssetsV2[]>> {
}): Promise<APIResponse<BotAssetV2[]>> {
return this.getPrivate('/api/v2/account/bot-assets', params);
}
@@ -669,7 +687,7 @@ export class RestClientV2 extends BaseRestClient {
*
*/
getConvertCoins(): Promise<APIResponse<ConvertCurrenciesV2[]>> {
getConvertCoins(): Promise<APIResponse<ConvertCurrencyV2[]>> {
return this.getPrivate('/api/v2/convert/currencies');
}
@@ -685,9 +703,12 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate('/api/v2/convert/trade', params);
}
getConvertHistory(
params: GetConvertHistoryRequestV2,
): Promise<APIResponse<ConvertHistoryV2>> {
getConvertHistory(params: GetConvertHistoryRequestV2): Promise<
APIResponse<{
dataList: ConvertRecordV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/convert/convert-record', params);
}
@@ -697,7 +718,11 @@ export class RestClientV2 extends BaseRestClient {
*
*/
getConvertBGBCoins(): Promise<APIResponse<BGBConvertCoinsV2>> {
getConvertBGBCoins(): Promise<
APIResponse<{
coinList: BGBConvertCoinV2[];
}>
> {
return this.getPrivate('/api/v2/convert/bgb-convert-coin-list');
}
@@ -908,9 +933,13 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate('/api/v2/spot/trade/cancel-plan-order', params);
}
getSpotCurrentPlanOrders(
params: GetSpotCurrentPlanOrdersRequestV2,
): Promise<APIResponse<SpotCurrentPlanOrderV2>> {
getSpotCurrentPlanOrders(params: GetSpotCurrentPlanOrdersRequestV2): Promise<
APIResponse<{
nextFlag: boolean;
idLessThan: string;
orderList: SpotCurrentPlanOrderV2[];
}>
> {
return this.getPrivate('/api/v2/spot/trade/current-plan-order', params);
}
@@ -920,9 +949,13 @@ export class RestClientV2 extends BaseRestClient {
return this.getPrivate('/api/v2/spot/trade/plan-sub-order', params);
}
getSpotHistoricPlanOrders(
params: GetSpotHistoryPlanOrdersRequestV2,
): Promise<APIResponse<SpotCurrentPlanOrderV2>> {
getSpotHistoricPlanOrders(params: GetSpotHistoryPlanOrdersRequestV2): Promise<
APIResponse<{
nextFlag: boolean;
idLessThan: string;
orderList: SpotHistoryPlanOrderV2[];
}>
> {
return this.getPrivate('/api/v2/spot/trade/history-plan-order', params);
}
@@ -1100,19 +1133,27 @@ export class RestClientV2 extends BaseRestClient {
return this.get('/api/v2/mix/market/vip-fee-rate');
}
getFuturesInterestRateHistory(params: {
getFuturesInterestRateHistory(params: { coin: string }): Promise<
APIResponse<{
coin: string;
}): Promise<APIResponse<FuturesInterestRateHistoryV2>> {
historyInterestRateList: FuturesHistoryInterestRateV2[];
}>
> {
return this.get('/api/v2/mix/market/union-interest-rate-history', params);
}
getFuturesInterestExchangeRate(): Promise<
APIResponse<FuturesInterestExchangeRateV2[]>
APIResponse<
{
coin: string;
exchangeRateList: FuturesInterestExchangeRateV2[];
}[]
>
> {
return this.get('/api/v2/mix/market/exchange-rate');
}
getFuturesDiscountRate(): Promise<APIResponse<FuturesDiscountRateV2[]>> {
getFuturesDiscountRate(): Promise<APIResponse<FuturesDiscountRatesV2[]>> {
return this.get('/api/v2/mix/market/discount-rate');
}
@@ -1174,7 +1215,12 @@ export class RestClientV2 extends BaseRestClient {
getFuturesOpenInterest(params: {
symbol: string;
productType: FuturesProductTypeV2;
}): Promise<APIResponse<FuturesOpenInterestV2>> {
}): Promise<
APIResponse<{
openInterestList: FuturesOpenInterestV2[];
ts: string;
}>
> {
return this.get('/api/v2/mix/market/open-interest', params);
}
@@ -1236,13 +1282,20 @@ export class RestClientV2 extends BaseRestClient {
getFuturesAccountAssets(params: {
productType: FuturesProductTypeV2;
}): Promise<APIResponse<FuturesAccountListV2[]>> {
}): Promise<APIResponse<FuturesAccountsV2[]>> {
return this.getPrivate('/api/v2/mix/account/accounts', params);
}
getFuturesSubAccountAssets(params: {
productType: FuturesProductTypeV2;
}): Promise<APIResponse<FuturesSubAccountAssetsV2[]>> {
}): Promise<
APIResponse<
{
userId: number;
assetList: FuturesSubAccountAssetV2[];
}[]
>
> {
return this.getPrivate('/api/v2/mix/account/sub-account-assets', params);
}
@@ -1302,9 +1355,12 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate('/api/v2/mix/account/set-position-mode', params);
}
getFuturesAccountBills(
params: FuturesAccountBillRequestV2,
): Promise<APIResponse<FuturesAccountBillV2>> {
getFuturesAccountBills(params: FuturesAccountBillRequestV2): Promise<
APIResponse<{
bills: FuturesAccountBillV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/account/bill', params);
}
@@ -1338,7 +1394,12 @@ export class RestClientV2 extends BaseRestClient {
getFuturesHistoricPositions(
params?: FuturesHistoricalPositionsRequestV2,
): Promise<APIResponse<FuturesHistoricalPositionV2>> {
): Promise<
APIResponse<{
list: FuturesHistoryPositionV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/position/history-position', params);
}
@@ -1408,27 +1469,41 @@ export class RestClientV2 extends BaseRestClient {
return this.getPrivate('/api/v2/mix/order/detail', params);
}
getFuturesFills(
params: FuturesGetOrderFillsRequestV2,
): Promise<APIResponse<FuturesOrderFillsV2>> {
getFuturesFills(params: FuturesGetOrderFillsRequestV2): Promise<
APIResponse<{
fillList: FuturesOrderFillV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/order/fills', params);
}
getFuturesHistoricOrderFills(
params: FuturesGetHistoricalFillsRequestV2,
): Promise<APIResponse<FuturesOrderFillsV2>> {
): Promise<
APIResponse<{
fillList: FuturesOrderFillV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/order/fill-history', params);
}
getFuturesOpenOrders(
params: FuturesGetOpenOrdersRequestV2,
): Promise<APIResponse<FuturesOpenOrdersV2>> {
getFuturesOpenOrders(params: FuturesGetOpenOrdersRequestV2): Promise<
APIResponse<{
entrustedList: FuturesOpenOrderV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/order/orders-pending', params);
}
getFuturesHistoricOrders(
params: FuturesGetHistoryOrdersRequestV2,
): Promise<APIResponse<FuturesHistoryOrdersV2>> {
getFuturesHistoricOrders(params: FuturesGetHistoryOrdersRequestV2): Promise<
APIResponse<{
entrustedList: FuturesHistoryOrderV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/order/orders-history', params);
}
@@ -1488,9 +1563,12 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate('/api/v2/mix/order/modify-plan-order', params);
}
getFuturesPlanOrders(
params: FuturesGetPlanOrdersRequestV2,
): Promise<APIResponse<FuturesPendingPlanOrderV2>> {
getFuturesPlanOrders(params: FuturesGetPlanOrdersRequestV2): Promise<
APIResponse<{
entrustedList: FuturesPendingPlanOrderV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/order/orders-plan-pending', params);
}
@@ -1502,7 +1580,12 @@ export class RestClientV2 extends BaseRestClient {
getFuturesHistoricPlanOrders(
params: FuturesGetHistoryPlanOrdersRequestV2,
): Promise<APIResponse<FuturesHistoryPlanOrderV2>> {
): Promise<
APIResponse<{
entrustedList: FuturesHistoryPlanOrderV2[];
endId: string;
}>
> {
return this.getPrivate('/api/v2/mix/order/orders-plan-history', params);
}
@@ -1547,9 +1630,13 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate('/api/v2/broker/account/create-subaccount', params);
}
getSubaccounts(
params?: GetSubAccountsRequestV2,
): Promise<APIResponse<SubaccountsListV2>> {
getSubaccounts(params?: GetSubAccountsRequestV2): Promise<
APIResponse<{
hasNextPage: boolean;
idLessThan: number;
subList: BrokerSubaccountV2[];
}>
> {
return this.getPrivate('/api/v2/broker/account/subaccount-list', params);
}
@@ -1569,7 +1656,11 @@ export class RestClientV2 extends BaseRestClient {
subUid: string;
coin?: string;
assetType?: 'hold_only' | 'all';
}): Promise<APIResponse<SubaccountSpotAssetsV2>> {
}): Promise<
APIResponse<{
assetsList: BrokerSubaccountSpotAssetV2[];
}>
> {
return this.getPrivate(
'/api/v2/broker/account/subaccount-spot-assets',
params,
@@ -1579,7 +1670,11 @@ export class RestClientV2 extends BaseRestClient {
getSubaccountFuturesAssets(params: {
subUid: string;
productType: FuturesProductTypeV2;
}): Promise<APIResponse<SubaccountFutureAssetsV2>> {
}): Promise<
APIResponse<{
assetsList: BrokerSubaccountFutureAssetV2[];
}>
> {
return this.getPrivate(
'/api/v2/broker/account/subaccount-future-assets',
params,
@@ -1626,9 +1721,12 @@ export class RestClientV2 extends BaseRestClient {
return this.postPrivate('/api/v2/broker/subaccount-deposit', params);
}
subaccountWithdrawalRecords(
params: SubWithdrawalRecordsRequestV2,
): Promise<APIResponse<SubaccountWithdrawalV2>> {
subaccountWithdrawalRecords(params: SubWithdrawalRecordsRequestV2): Promise<
APIResponse<{
resultList: BrokerSubaccountWithdrawalV2[];
endId: string;
}>
> {
return this.postPrivate('/api/v2/broker/subaccount-withdrawal', params);
}
@@ -1692,7 +1790,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginBorrowHistory(
marginType: MarginType,
params: GetBorrowHistoryRequestV2,
): Promise<APIResponse<MarginBorrowHistoryV2>> {
): Promise<
APIResponse<{
resultList: MarginBorrowHistoryItemV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/borrow-history`,
@@ -1703,7 +1807,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginRepayHistory(
marginType: MarginType,
params: GetRepayHistoryRequestV2,
): Promise<APIResponse<MarginRepaymentHistoryV2>> {
): Promise<
APIResponse<{
resultList: MarginRepaymentHistoryItemV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/repay-history`,
@@ -1714,7 +1824,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginInterestHistory(
marginType: MarginType,
params: GetInterestHistoryRequestV2,
): Promise<APIResponse<MarginInterestHistoryV2>> {
): Promise<
APIResponse<{
resultList: MarginInterestHistoryItemV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/interest-history`,
@@ -1725,7 +1841,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginLiquidationHistory(
marginType: MarginType,
params: GetLiquidationHistoryRequestV2,
): Promise<APIResponse<MarginLiquidationHistoryV2>> {
): Promise<
APIResponse<{
resultList: MarginLiquidationHistoryItemV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/liquidation-history`,
@@ -1736,7 +1858,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginFinancialHistory(
marginType: MarginType,
params: GetFinancialHistoryRequestV2,
): Promise<APIResponse<MarginFinancialHistoryV2>> {
): Promise<
APIResponse<{
resultList: MarginFinancialHistoryItemV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/financial-records`,
@@ -1980,7 +2108,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginOpenOrders(
marginType: MarginType,
params: GetMarginCurrentOrdersRequestV2,
): Promise<APIResponse<MarginCurrentOrdersV2>> {
): Promise<
APIResponse<{
orderList: MarginCurrentOrderV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(`/api/v2/margin/${marginType}/open-orders`, params);
}
@@ -1988,7 +2122,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginHistoricOrders(
marginType: MarginType,
params: GetHistoryOrdersRequestV2,
): Promise<APIResponse<MarginHistoryOrdersV2>> {
): Promise<
APIResponse<{
orderList: MarginHistoryOrderV2[];
maxId: string;
minId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/history-orders`,
@@ -1999,7 +2139,13 @@ export class RestClientV2 extends BaseRestClient {
getMarginHistoricOrderFills(
marginType: MarginType,
params: GetMarginOrderFillsRequestV2,
): Promise<APIResponse<MarginOrderFillsV2>> {
): Promise<
APIResponse<{
fills: MarginOrderFillV2[];
minId: string;
maxId: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(`/api/v2/margin/${marginType}/fills`, params);
}
@@ -2007,7 +2153,12 @@ export class RestClientV2 extends BaseRestClient {
getMarginLiquidationOrders(
marginType: MarginType,
params: GetMarginLiquidationOrdersRequestV2,
): Promise<APIResponse<MarginLiquidationOrdersV2>> {
): Promise<
APIResponse<{
resultList: MarginLiquidationOrderV2[];
idLessThan: string;
}>
> {
assertMarginType(marginType);
return this.getPrivate(
`/api/v2/margin/${marginType}/liquidation-order`,
@@ -2033,7 +2184,7 @@ export class RestClientV2 extends BaseRestClient {
getFuturesTraderCurrentOrder(
params: GetFuturesTraderCurrentOrdersRequestV2,
): Promise<APIResponse<CTFuturesTraderCurrentOrderV2>> {
): Promise<APIResponse<CTFuturesTraderCurrentOrdersV2>> {
return this.getPrivate(
'/api/v2/copy/mix-trader/order-current-track',
params,

View File

@@ -13,10 +13,7 @@ export interface CreateSubaccountResponseV2 {
cTime: string;
}
export interface SubaccountsListV2 {
hasNextPage: boolean;
idLessThan: number;
subList: {
export interface BrokerSubaccountV2 {
subUid: string;
subaccountName: string;
status: string;
@@ -25,7 +22,6 @@ export interface SubaccountsListV2 {
language: string;
cTime: string;
uTime: string;
}[];
}
export interface ModifySubaccountResponseV2 {
@@ -47,18 +43,15 @@ export interface SubaccountEmailV2 {
uTime: string;
}
export interface SubaccountSpotAssetsV2 {
assetsList: {
export interface BrokerSubaccountSpotAssetV2 {
coin: string;
available: string;
frozen: string;
locked: string;
uTime: string;
}[];
}
export interface SubaccountFutureAssetsV2 {
assetsList: {
export interface BrokerSubaccountFutureAssetV2 {
marginCoin: string;
available: string;
frozen: string;
@@ -70,7 +63,6 @@ export interface SubaccountFutureAssetsV2 {
usdtEquity: string;
btcEquity: string;
uTime: string;
}[];
}
export interface CreateSubaccountDepositAddressV2 {
@@ -101,8 +93,7 @@ export interface SubaccountDepositV2 {
uTime: string;
}
export interface SubaccountWithdrawalV2 {
resultList: {
export interface BrokerSubaccountWithdrawalV2 {
orderId: string;
txId: string;
coin: string;
@@ -119,8 +110,6 @@ export interface SubaccountWithdrawalV2 {
userId: string;
cTime: string;
uTime: string;
}[];
endId: string;
}
/**

View File

@@ -56,7 +56,7 @@ export interface MarginTransactionRecordV2 {
ts: string;
}
export interface P2PMerchantOrderV2 {
export interface P2PMerchantOrdersV2 {
id: string;
coin: string;
p2pTaxType: string;
@@ -70,8 +70,7 @@ export interface P2PMerchantOrderV2 {
*
*/
export interface P2PMerchantListV2 {
merchantList: {
export interface P2PMerchantV2 {
registerTime: string;
nickName: string;
isOnline: string;
@@ -85,8 +84,6 @@ export interface P2PMerchantListV2 {
sell30d: string;
buy30d: string;
completionRate30d: string;
}[];
minMerchantId: string;
}
export interface P2PMerchantInfoV2 {
@@ -111,7 +108,6 @@ export interface P2PMerchantInfoV2 {
}
export interface P2PMerchantOrderV2 {
orderList: {
orderId: string;
orderNo: string;
advNo: string;
@@ -140,12 +136,9 @@ export interface P2PMerchantOrderV2 {
value: string;
}[];
};
}[];
minOrderId: string;
}
export interface P2PMerchantAdvertisementV2 {
advList: {
export interface P2PMerchantAdvertismentV2 {
advId: string;
advNo: string;
side: string;
@@ -188,8 +181,6 @@ export interface P2PMerchantAdvertisementV2 {
}[];
utime: string;
ctime: string;
}[];
minAdvId: string;
}
/**
@@ -291,9 +282,7 @@ export interface CreateVirtualSubAccountAndApiKeyV2 {
ipList: string[];
}
export interface VirtualSubAccountListV2 {
endId: string;
subAccountList: {
export interface VirtualSubAccountV2 {
subAccountUid: string;
subAccountName: string;
status: string;
@@ -303,7 +292,6 @@ export interface VirtualSubAccountListV2 {
bindingTime: string;
cTime: string;
uTime: string;
}[];
}
export interface CreateVirtualSubAccountApiKeyV2 {
@@ -324,7 +312,7 @@ export interface ModifyVirtualSubAccountApiKeyV2 {
ipList: string[];
}
export interface SubAccountApiKeyListV2 {
export interface SubAccountApiKeyItemV2 {
subAccountUid: string;
label: string;
subAccountApiKey: string;
@@ -338,14 +326,14 @@ export interface SubAccountApiKeyListV2 {
*
*/
export interface FundingAssetsV2 {
export interface FundingAssetV2 {
coin: string;
available: string;
frozen: string;
usdtValue: string;
}
export interface BotAssetsV2 {
export interface BotAssetV2 {
coin: string;
available: string;
equity: string;
@@ -360,8 +348,7 @@ export interface BotAssetsV2 {
*
*/
export interface ConvertCurrenciesV2 {
// array type
export interface ConvertCurrencyV2 {
coin: string;
available: string;
maxAmount: string;
@@ -385,8 +372,7 @@ export interface ConvertTradeResponseV2 {
toCoin: string;
}
export interface ConvertHistoryV2 {
dataList: {
export interface ConvertRecordV2 {
id: string;
ts: string;
cnvtPrice: string;
@@ -395,18 +381,16 @@ export interface ConvertHistoryV2 {
fromCoin: string;
toCoinSize: string;
toCoin: string;
}[];
endId: string;
}
/**
*
* * Common | BGB Convert
*
*/
export interface BGBConvertCoinsV2 {
coinList: {
export interface BGBConvertCoinV2 {
coin: string;
available: string;
bgbEstAmount: string;
@@ -416,9 +400,9 @@ export interface BGBConvertCoinsV2 {
fee: string;
}[];
cTime: string;
}[];
}
export interface ConvertBGBResponseV2 {
orderList: {
coin: string;

View File

@@ -7,7 +7,6 @@
*/
export interface CTFuturesTraderCurrentOrderV2 {
trackingList: {
trackingNo: string;
openOrderId: string;
symbol: string;
@@ -20,12 +19,14 @@ export interface CTFuturesTraderCurrentOrderV2 {
presetStopLossPrice: string;
openFee: string;
followCount: string;
}[];
}
export interface CTFuturesTraderCurrentOrdersV2 {
trackingList: CTFuturesTraderCurrentOrderV2[];
endId: string;
}
export interface CTFuturesTraderHistoryOrderV2 {
trackingList: {
trackingNo: string;
symbol: string;
openOrderId: string;
@@ -44,10 +45,23 @@ export interface CTFuturesTraderHistoryOrderV2 {
openFee: string;
closeFee: string;
cTime: string;
}[];
}
export interface CTFuturesTraderHistoryOrderV2 {
trackingList: CTFuturesTraderHistoryOrderV2[];
endId: string;
}
export interface CTRateCTimeV2 {
rate: string;
ctime: string;
}
export interface CTAmountCTimeV2 {
amount: string;
ctime: string;
}
export interface CTFuturesTraderTotalOrderSummaryV2 {
roi: string;
tradingOrderNum: string;
@@ -58,25 +72,19 @@ export interface CTFuturesTraderTotalOrderSummaryV2 {
lossNum: string;
winRate: string;
tradingPairsAvailableList: string[];
lastWeekRoiList: {
rate: string;
ctime: string;
}[];
lastWeekProfitList: {
amount: string;
ctime: string;
}[];
lastMonthRoiList: {
rate: string;
ctime: string;
}[];
lastMonthProfitList: {
amount: string;
ctime: string;
}[];
lastWeekRoiList: CTRateCTimeV2[];
lastWeekProfitList: CTAmountCTimeV2[];
lastMonthRoiList: CTRateCTimeV2[];
lastMonthProfitList: CTAmountCTimeV2[];
totalEquity: string;
}
export interface CTFuturesTraderProfitHistoryItemV2 {
coin: string;
profitCount: string;
lastProfitTime: string;
}
export interface CTFuturesTraderHistoryProfitSummaryV2 {
profitSummary: {
yesterdayProfit: string;
@@ -84,21 +92,19 @@ export interface CTFuturesTraderHistoryProfitSummaryV2 {
waitProfit: string;
yesterdayTime: string;
};
profitHistoryList: {
coin: string;
profitCount: string;
lastProfitTime: string;
}[];
profitHistoryList: CTFuturesTraderProfitHistoryItemV2[];
}
export interface CTFuturesTraderProfitShareHistoryV2 {
profitList: {
export interface CTFuturesTraderProfitShare {
profitId: string;
coin: string;
profit: string;
nickName: string;
profitTime: string;
}[];
}
export interface CTFuturesTraderProfitShareHistoryV2 {
profitList: CTFuturesTraderProfitShare[];
endId: string;
}
@@ -146,8 +152,7 @@ export interface CTFuturesFollowerCurrentOrdersV2 {
closeTime: string;
}
export interface CTFuturesFollowerHistoryOrdersV2 {
trackingList: {
export interface CTFuturesFollowerHistoryOrderV2 {
trackingNo: string;
posSide: string;
openLeverage: string;
@@ -167,13 +172,14 @@ export interface CTFuturesFollowerHistoryOrdersV2 {
closeTime: string;
traderId: string;
productType: string;
}[];
}
export interface CTFuturesFollowerHistoryOrdersV2 {
trackingList: CTFuturesFollowerHistoryOrderV2[];
endId: string;
}
export interface CTFuturesFollowerSettingsV2 {
followerEnable: string;
detailList: {
export interface CTFuturesFollowerSettingV2 {
symbol: string;
productType: string;
marginType: string;
@@ -182,11 +188,11 @@ export interface CTFuturesFollowerSettingsV2 {
longLeverage: string;
shortLeverage: string;
traceType: string;
traceValue: string;
maxHoldSize: string;
stopSurplusRatio: string;
stopLossRatio: string;
}[];
}
export interface CTFuturesFollowerSettingsV2 {
followerEnable: string;
detailList: CTFuturesFollowerSettingV2[];
}
export interface CTFuturesFollowerMyTradersV2 {
@@ -230,16 +236,18 @@ export interface CTSpotTraderProfitSummaryV2 {
}[];
}
export interface CTSpotTraderHistoryProfitSharingV2 {
endId: string;
profitList: {
export interface CTSpotTraderHistoryProfitShareItemV2 {
profitId: string;
coin: string;
distributeRatio: string;
profit: string;
followerName: string;
profitTime: string;
}[];
}
export interface CTSpotTraderHistoryProfitSharingV2 {
endId: string;
profitList: CTSpotTraderHistoryProfitShareItemV2[];
}
export interface CTSpotTraderUnrealizedProfitV2 {
@@ -259,27 +267,13 @@ export interface CTSpotTraderTotalOrderDetailV2 {
lossNum: string;
totalEquity: string;
winRate: string;
lastWeekRoiList: {
rate: string;
ctime: string;
}[];
lastMonthRoiList: {
rate: string;
ctime: string;
}[];
lastWeekProfitList: {
amount: string;
ctime: string;
}[];
lastMonthProfitList: {
amount: string;
ctime: string;
}[];
lastWeekRoiList: CTAmountCTimeV2[];
lastMonthRoiList: CTRateCTimeV2[];
lastWeekProfitList: CTAmountCTimeV2[];
lastMonthProfitList: CTAmountCTimeV2[];
}
export interface CTSpotTraderHistoryOrdersV2 {
endId: string;
trackingList: {
export interface CTSpotTraderHistoryOrderV2 {
trackingNo: string;
fillSize: string;
buyPrice: string;
@@ -293,12 +287,13 @@ export interface CTSpotTraderHistoryOrdersV2 {
symbol: string;
netProfit: string;
followCount: string;
}[];
}
export interface CTSpotTraderHistoryOrdersV2 {
endId: string;
trackingList: CTSpotTraderHistoryOrderV2[];
}
export interface CTSpotTraderCurrentTrackingOrdersV2 {
endId: string;
trackingList: {
export interface CTSpotTraderCurrentTrackingOrderV2 {
trackingNo: string;
orderId: string;
buyFillSize: string;
@@ -312,7 +307,11 @@ export interface CTSpotTraderCurrentTrackingOrdersV2 {
stopLossPrice: string | null;
stopSurplusPrice: string | null;
followCount: string;
}[];
}
export interface CTSpotTraderCurrentTrackingOrdersV2 {
endId: string;
trackingList: CTSpotTraderCurrentTrackingOrderV2[];
}
export interface CTSpotTraderFollowerListV2 {
@@ -332,8 +331,7 @@ export interface CTSpotTraderFollowerListV2 {
*
*/
export interface CTSpotFollowerMyTradersV2 {
resultList: {
export interface CTSpotFollowerMyTraderV2 {
certificationType: string;
traceTotalAmount: string;
traceTotalNetProfit: string;
@@ -345,21 +343,21 @@ export interface CTSpotFollowerMyTradersV2 {
followCount: string;
bgbFollowCount: string;
followerTime: string;
}[];
}
export interface CTSpotFollowerFollowConfigurationV2 {
enable: string;
profitRate: string;
settledInDays: string;
tradeSettingList: {
export interface CTSpotFollowerMyTradersV2 {
resultList: CTSpotFollowerMyTraderV2[];
}
export interface CTSpotFollowerTradeSettingV2 {
maxTraceAmount: string;
stopLossRation: string;
stopSurplusRation: string;
symbol: string;
traceType: string;
}[];
tradeSymbolSettingList: {
}
export interface CTSpotFollowerTradeSymbolSettingV2 {
maxStopLossRation: string;
maxStopSurplusRation: string;
maxTraceAmount: string;
@@ -374,14 +372,19 @@ export interface CTSpotFollowerFollowConfigurationV2 {
sliderMaxStopLossRatio: string;
sliderMaxStopSurplusRatio: string;
symbol: string;
}[];
}
export interface CTSpotFollowerFollowConfigurationV2 {
enable: string;
profitRate: string;
settledInDays: string;
tradeSettingList: CTSpotFollowerTradeSettingV2[];
tradeSymbolSettingList: CTSpotFollowerTradeSymbolSettingV2[];
traderHeadPic: string;
traderName: string;
}
export interface CTSpotFollowerHistoryOrdersV2 {
endId: string;
trackingList: {
export interface CTSpotFollowerHistoryOrderV2 {
trackingNo: string;
traderId: string;
fillSize: string;
@@ -394,12 +397,13 @@ export interface CTSpotFollowerHistoryOrdersV2 {
symbol: string;
buyTime: string;
sellTime: string;
}[];
}
export interface CTSpotFollowerHistoryOrdersV2 {
endId: string;
trackingList: CTSpotFollowerHistoryOrderV2[];
}
export interface CTSpotFollowerCurrentOrdersV2 {
endId: string;
trackingList: {
export interface CTSpotFollowerCurrentOrderV2 {
trackingNo: string;
traderId: string;
buyFillSize: string;
@@ -412,5 +416,9 @@ export interface CTSpotFollowerCurrentOrdersV2 {
symbol: string;
stopSurplusPrice: string | null;
stopLossPrice: string | null;
}[];
}
export interface CTSpotFollowerCurrentOrdersV2 {
endId: string;
trackingList: CTSpotFollowerCurrentOrderV2[];
}

View File

@@ -33,8 +33,7 @@ export interface EarnSavingsAccountV2 {
usdtTotalEarning: string;
}
export interface EarnSavingsAssetsV2 {
resultList: {
export interface EarnSavingsAssetV2 {
productId: string;
orderId: string;
productCoin: string;
@@ -54,12 +53,14 @@ export interface EarnSavingsAssetsV2 {
maxApy: string;
currentApy: string;
}[];
}[];
}
export interface EarnSavingsAssetsV2 {
resultList: EarnSavingsAssetV2[];
endId: string;
}
export interface EarnSavingsRecordsV2 {
resultList: {
export interface EarnSavingsRecordV2 {
orderId: string;
coinName: string;
settleCoinName: string;
@@ -69,7 +70,10 @@ export interface EarnSavingsRecordsV2 {
amount: string;
ts: string;
orderType: string;
}[];
}
export interface EarnSavingsRecordsV2 {
resultList: EarnSavingsRecordV2[];
endId: string;
}
@@ -110,8 +114,7 @@ export interface EarnSavingsSubscriptionDetailV2 {
*
*/
export interface EarnSharkfinProductsV2 {
resultList: {
export interface EarnSharkfinProductV2 {
productId: string;
productName: string;
productCoin: string;
@@ -129,7 +132,10 @@ export interface EarnSharkfinProductsV2 {
soldAmount: string;
endTime: string;
startTime: string;
}[];
}
export interface EarnSharkfinProductsV2 {
resultList: EarnSharkfinProductV2[];
endId: string;
}
@@ -142,8 +148,7 @@ export interface EarnSharkfinAccountV2 {
usdtTotalEarning: string;
}
export interface EarnSharkfinAssetsV2 {
resultList: {
export interface EarnSharkfinAssetV2 {
productId: string;
interestStartTime: string;
interestEndTime: string;
@@ -153,19 +158,23 @@ export interface EarnSharkfinAssetsV2 {
settleTime: string;
interestAmount: string;
productStatus: string;
}[];
}
export interface EarnSharkfinAssetsV2 {
resultList: EarnSharkfinAssetV2[];
endId: string;
}
export interface EarnSharkfinRecordsV2 {
resultList: {
export interface EarnSharkfinRecordV2 {
orderId: string;
product: string;
period: string;
amount: string;
ts: string;
type: string;
}[];
}
export interface EarnSharkfinRecordsV2 {
resultList: EarnSharkfinRecordV2[];
endId: string;
}
@@ -197,8 +206,7 @@ export interface EarnSharkfinSubscriptionDetailV2 {
*
*/
export interface EarnLoanCurrenciesV2 {
loanInfos: {
export interface EarnLoanCurrencyLoanInfoV2 {
coin: string;
hourRate7D: string;
rate7D: string;
@@ -208,15 +216,19 @@ export interface EarnLoanCurrenciesV2 {
maxUsdt: string;
min: string;
max: string;
}[];
pledgeInfos: {
}
export interface EarnLoanCurrencyPledgeInfoV2 {
coin: string;
initRate: string;
supRate: string;
forceRate: string;
minUsdt: string;
maxUsdt: string;
}[];
}
export interface EarnLoanCurrenciesV2 {
loanInfos: EarnLoanCurrencyLoanInfoV2[];
pledgeInfos: EarnLoanCurrencyPledgeInfoV2[];
}
export interface EarnLoanOrdersV2 {
@@ -277,17 +289,21 @@ export interface EarnLoanHistoryV2 {
status: string;
}
export interface EarnLoanDebtPledgeInfoV2 {
coin: string;
amount: string;
amountUsdt: string;
}
export interface EarnLoanDebtLoanInfoV2 {
coin: string;
amount: string;
amountUsdt: string;
}
export interface EarnLoanDebtsV2 {
pledgeInfos: {
coin: string;
amount: string;
amountUsdt: string;
}[];
loanInfos: {
coin: string;
amount: string;
amountUsdt: string;
}[];
pledgeInfos: EarnLoanDebtPledgeInfoV2[];
loanInfos: EarnLoanDebtLoanInfoV2[];
}
export interface EarnLoanLiquidationRecordsV2 {

View File

@@ -14,35 +14,31 @@ export interface FuturesVipFeeRateV2 {
usdtWithdrawAmount: string;
}
export interface FuturesInterestRateHistoryV2 {
coin: string;
historyInterestRateList: {
export interface FuturesHistoryInterestRateV2 {
ts: string;
annualInterestRate: string;
dailyInterestRate: string;
}[];
}
export interface FuturesInterestExchangeRateV2 {
coin: string;
exchangeRateList: {
tier: string;
minAmount: string;
maxAmount: string;
exchangeRate: string;
}[];
}
export interface FuturesDiscountRateV2 {
coin: string;
userLimit: string;
totalLimit: string;
discountRateList: {
tier: string;
minAmount: string;
maxAmount: string;
discountRate: string;
}[];
}
export interface FuturesDiscountRatesV2 {
coin: string;
userLimit: string;
totalLimit: string;
discountRateList: FuturesDiscountRateV2[];
}
export interface FuturesMergeDepthV2 {
@@ -100,11 +96,8 @@ export interface FuturesCandlestickV2 {
}
export interface FuturesOpenInterestV2 {
openInterestList: {
symbol: string;
size: string;
}[];
ts: string;
}
export interface FuturesFundingTimeV2 {
@@ -190,7 +183,7 @@ export interface FuturesAccountV2 {
assetMode: string;
}
export interface FuturesAccountListV2 {
export interface FuturesAccountsV2 {
marginCoin: string;
locked: string;
available: string;
@@ -217,9 +210,7 @@ export interface FuturesAccountListV2 {
assetMode: string;
}
export interface FuturesSubAccountAssetsV2 {
userId: number;
assetList: {
export interface FuturesSubAccountAssetV2 {
marginCoin: string;
locked: string;
available: string;
@@ -231,14 +222,9 @@ export interface FuturesSubAccountAssetsV2 {
btcEquity: string;
unrealizedPL: string;
coupon: string;
}[];
}
export interface FuturesInterestHistoryV2 {
nextSettleTime: string;
borrowAmount: string;
borrowLimit: string;
interestList: {
export interface FuturesInterestV2 {
coin: string;
liability: string;
interestFreeLimit: string;
@@ -246,7 +232,12 @@ export interface FuturesInterestHistoryV2 {
hourInterestRate: string;
interest: string;
cTime: string;
}[];
}
export interface FuturesInterestHistoryV2 {
nextSettleTime: string;
borrowAmount: string;
borrowLimit: string;
interestList: FuturesInterestV2[];
endId: string;
}
@@ -268,7 +259,6 @@ export interface SetMarginModeResponseV2 {
}
export interface FuturesAccountBillV2 {
bills: {
billId: string;
symbol: string;
amount: string;
@@ -278,8 +268,6 @@ export interface FuturesAccountBillV2 {
coin: string;
balance: string;
cTime: string;
}[];
endId: string;
}
/**
@@ -325,8 +313,7 @@ export interface FuturesPositionV2 {
cTime: string;
}
export interface FuturesHistoricalPositionV2 {
list: {
export interface FuturesHistoryPositionV2 {
positionId: string;
marginCoin: string;
symbol: string;
@@ -343,8 +330,6 @@ export interface FuturesHistoricalPositionV2 {
closeFee: string;
cTime: string;
uTime: string;
}[];
endId: string;
}
/**
@@ -412,8 +397,7 @@ export interface FuturesOrderDetailV2 {
uTime: string;
}
export interface FuturesOrderFillsV2 {
fillList: {
export interface FuturesOrderFillV2 {
tradeId: string;
symbol: string;
orderId: string;
@@ -433,12 +417,9 @@ export interface FuturesOrderFillsV2 {
posMode: string;
tradeScope: string;
cTime: string;
}[];
endId: string;
}
export interface FuturesOpenOrdersV2 {
entrustedList: {
export interface FuturesOpenOrderV2 {
symbol: string;
size: string;
orderId: string;
@@ -469,12 +450,9 @@ export interface FuturesOpenOrdersV2 {
presetStopLossPrice: string;
presetStopLossType: string;
presetStopLossExecutePrice: string;
}[];
endId: string;
}
export interface FuturesHistoryOrdersV2 {
entrustedList: {
export interface FuturesHistoryOrderV2 {
symbol: string;
size: string;
orderId: string;
@@ -501,8 +479,6 @@ export interface FuturesHistoryOrdersV2 {
uTime: string;
presetStopSurplusPrice: string;
presetStopLossPrice: string;
}[];
endId: string;
}
export interface FuturesCancelAllOrdersV2 {
@@ -532,7 +508,6 @@ export interface FuturesTriggerSubOrderV2 {
}
export interface FuturesPendingPlanOrderV2 {
entrustedList: {
planType: string;
symbol: string;
size: string;
@@ -561,8 +536,6 @@ export interface FuturesPendingPlanOrderV2 {
stopLossExecutePrice: string;
stopLossTriggerPrice: string;
stopLossTriggerType: string;
}[];
endId: string;
}
export interface FuturesCancelPlanOrderV2 {
@@ -578,7 +551,6 @@ export interface FuturesCancelPlanOrderV2 {
}
export interface FuturesHistoryPlanOrderV2 {
entrustedList: {
planType: string;
symbol: string;
size: string;
@@ -609,6 +581,4 @@ export interface FuturesHistoryPlanOrderV2 {
stopLossExecutePrice: string;
stopLossTriggerPrice: string;
stopLossTriggerType: string;
}[];
endId: string;
}

View File

@@ -33,21 +33,16 @@ export interface MarginCurrencyV2 {
*
*/
export interface MarginBorrowHistoryV2 {
resultList: {
export interface MarginBorrowHistoryItemV2 {
loanId: string;
coin: string;
borrowAmount: string;
borrowType: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
export interface MarginRepaymentHistoryV2 {
resultList: {
export interface MarginRepaymentHistoryItemV2 {
repayId: string;
coin: string;
repayAmount: string;
@@ -57,13 +52,9 @@ export interface MarginRepaymentHistoryV2 {
symbol: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
export interface MarginInterestHistoryV2 {
resultList: {
export interface MarginInterestHistoryItemV2 {
interestId: string;
interestCoin: string;
dailyInterestRate: string;
@@ -73,13 +64,9 @@ export interface MarginInterestHistoryV2 {
symbol: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
export interface MarginLiquidationHistoryV2 {
resultList: {
export interface MarginLiquidationHistoryItemV2 {
liqId: string;
symbol: string;
liqStartTime: string;
@@ -90,13 +77,9 @@ export interface MarginLiquidationHistoryV2 {
liqFee: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
export interface MarginFinancialHistoryV2 {
resultList: {
export interface MarginFinancialHistoryItemV2 {
coin: string;
symbol: string;
marginId: string;
@@ -106,9 +89,6 @@ export interface MarginFinancialHistoryV2 {
marginType: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
/**
@@ -242,8 +222,7 @@ export interface MarginBatchOrdersResponseV2 {
}[];
}
export interface MarginCurrentOrdersV2 {
orderList: {
export interface MarginCurrentOrderV2 {
orderId: string;
symbol: string;
orderType: string;
@@ -261,13 +240,9 @@ export interface MarginCurrentOrdersV2 {
force: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
export interface MarginHistoryOrdersV2 {
orderList: {
export interface MarginHistoryOrderV2 {
orderId: string;
symbol: string;
orderType: string;
@@ -285,13 +260,9 @@ export interface MarginHistoryOrdersV2 {
force: string;
cTime: string;
uTime: string;
}[];
maxId: string;
minId: string;
}
export interface MarginOrderFillsV2 {
fills: {
export interface MarginOrderFillV2 {
orderId: string;
tradeId: string;
orderType: string;
@@ -308,13 +279,9 @@ export interface MarginOrderFillsV2 {
};
cTime: string;
uTime: string;
}[];
minId: string;
maxId: string;
}
export interface MarginLiquidationOrdersV2 {
resultList: {
export interface MarginLiquidationOrderV2 {
symbol: string;
orderType: string;
side: string;
@@ -330,6 +297,4 @@ export interface MarginLiquidationOrdersV2 {
toSize: string;
cTime: string;
uTime: string;
}[];
idLessThan: string;
}

View File

@@ -4,11 +4,7 @@
*
*/
export interface SpotCoinInfoV2 {
coinId: string;
coin: string;
transfer: boolean;
chains: {
export interface SpotCoinChainV2 {
chain: string;
needTag: boolean;
withdrawable: boolean;
@@ -24,7 +20,13 @@ export interface SpotCoinInfoV2 {
withdrawStep: string;
withdrawMinScale: string;
congestion: string;
}[];
}
export interface SpotCoinInfoV2 {
coinId: string;
coin: string;
transfer: boolean;
chains: SpotCoinChainV2[];
}
export interface SpotSymbolInfoV2 {
@@ -225,9 +227,6 @@ export interface SpotFillV2 {
*/
export interface SpotCurrentPlanOrderV2 {
nextFlag: boolean;
idLessThan: string;
orderList: {
orderId: string;
clientOid: string;
symbol: string;
@@ -242,7 +241,23 @@ export interface SpotCurrentPlanOrderV2 {
enterPointSource: string;
uTime: string;
cTime: string;
}[];
}
export interface SpotHistoryPlanOrderV2 {
orderId: string;
clientOid: string;
symbol: string;
size: string;
executePrice: string;
triggerPrice: string;
status: string;
orderType: string;
side: string;
planType: string;
triggerType: string;
enterPointSource: string;
uTime: string;
cTime: string;
}
export interface SpotPlanSubOrderV2 {
@@ -291,16 +306,17 @@ export interface SpotAccountAssetV2 {
uTime: string;
}
export interface SpotSubAccountAssetsV2 {
userId: number;
assetsList: {
export interface SpotSubAccountAssetV2 {
coin: string;
available: string;
limitAvailable: string;
frozen: string;
locked: string;
uTime: string;
}[];
}
export interface SpotSubAccountAssetsV2 {
userId: number;
assetsList: SpotSubAccountAssetV2[];
}
export interface SpotAccountBillV2 {