Merge pull request #419 from JJ-Cro/wsapi

feat(): added/updated types with latest documentation changes
This commit is contained in:
Tiago
2025-02-17 14:55:04 +00:00
committed by GitHub
12 changed files with 201 additions and 118 deletions

View File

@@ -170,7 +170,6 @@ import {
SpotBorrowCheckResultV5, SpotBorrowCheckResultV5,
SpotLeveragedTokenOrderHistoryV5, SpotLeveragedTokenOrderHistoryV5,
SpotMarginStateV5, SpotMarginStateV5,
SubAccountAllApiKeysResultV5,
SubMemberV5, SubMemberV5,
SwitchIsolatedMarginParamsV5, SwitchIsolatedMarginParamsV5,
SwitchPositionModeParamsV5, SwitchPositionModeParamsV5,
@@ -191,6 +190,7 @@ import {
VipCollateralCoinsV5, VipCollateralCoinsV5,
WalletBalanceV5, WalletBalanceV5,
WithdrawParamsV5, WithdrawParamsV5,
WithdrawableAmountV5,
WithdrawalRecordV5, WithdrawalRecordV5,
} from './types'; } from './types';
@@ -551,7 +551,9 @@ export class RestClientV5 extends BaseRestClient {
cancelAllOrders( cancelAllOrders(
params: CancelAllOrdersParamsV5, params: CancelAllOrdersParamsV5,
): Promise<APIResponseV3WithTime<{ list: OrderResultV5[] }>> { ): Promise<
APIResponseV3WithTime<{ list: OrderResultV5[]; success: string }>
> {
return this.postPrivate('/v5/order/cancel-all', params); return this.postPrivate('/v5/order/cancel-all', params);
} }
@@ -566,6 +568,18 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/order/history', params); return this.getPrivate('/v5/order/history', params);
} }
/**
* Query users' execution records, sorted by execTime in descending order
*
* Unified account covers: Spot / Linear contract / Options
* Normal account covers: USDT perpetual / Inverse perpetual / Inverse futures
*/
getExecutionList(
params: GetExecutionListParamsV5,
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>> {
return this.getPrivate('/v5/execution/list', params);
}
/** /**
* This endpoint allows you to place more than one order in a single request. * This endpoint allows you to place more than one order in a single request.
* Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro) * Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro)
@@ -675,7 +689,7 @@ export class RestClientV5 extends BaseRestClient {
* Only for institutional clients! * Only for institutional clients!
*/ */
setDisconnectCancelAllWindowV2(params: { setDisconnectCancelAllWindowV2(params: {
product: 'OPTION' | 'SPOT' | 'DERIVATIVES'; product?: 'OPTION' | 'SPOT' | 'DERIVATIVES';
timeWindow: number; timeWindow: number;
}): Promise<APIResponseV3<undefined>> { }): Promise<APIResponseV3<undefined>> {
return this.postPrivate('/v5/order/disconnected-cancel-all', params); return this.postPrivate('/v5/order/disconnected-cancel-all', params);
@@ -733,6 +747,7 @@ export class RestClientV5 extends BaseRestClient {
} }
/** /**
* @deprecated
* This endpoint sets the take profit/stop loss (TP/SL) mode to full or partial. * This endpoint sets the take profit/stop loss (TP/SL) mode to full or partial.
* *
* Unified account covers: Linear contract; normal account covers: USDT perpetual, inverse perpetual, inverse futures. * Unified account covers: Linear contract; normal account covers: USDT perpetual, inverse perpetual, inverse futures.
@@ -761,6 +776,7 @@ export class RestClientV5 extends BaseRestClient {
} }
/** /**
* @deprecated
* The risk limit will limit the maximum position value you can hold under different margin requirements. * The risk limit will limit the maximum position value you can hold under different margin requirements.
* If you want to hold a bigger position size, you need more margin. * If you want to hold a bigger position size, you need more margin.
* *
@@ -811,18 +827,6 @@ export class RestClientV5 extends BaseRestClient {
return this.postPrivate('/v5/position/add-margin', params); return this.postPrivate('/v5/position/add-margin', params);
} }
/**
* Query users' execution records, sorted by execTime in descending order
*
* Unified account covers: Spot / Linear contract / Options
* Normal account covers: USDT perpetual / Inverse perpetual / Inverse futures
*/
getExecutionList(
params: GetExecutionListParamsV5,
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>> {
return this.getPrivate('/v5/execution/list', params);
}
/** /**
* Query user's closed profit and loss records. The results are sorted by createdTime in descending order. * Query user's closed profit and loss records. The results are sorted by createdTime in descending order.
* *
@@ -1099,6 +1103,19 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/account/info'); return this.getPrivate('/v5/account/info');
} }
/**
* Query the DCP configuration of the account's contracts (USDT perpetual, USDC perpetual and USDC Futures) / spot / options.
*
* Only the configured main / sub account can query information from this API. Calling this API by an account always returns empty.
*
* INFO
* support linear contract (USDT, USDC Perp & USDC Futures) / Spot / Options only
* Unified account only
*/
getDCPInfo(): Promise<APIResponseV3WithTime<{ dcpInfos: DCPInfoV5[] }>> {
return this.getPrivate('/v5/account/query-dcp-info');
}
/** /**
* Query transaction logs in Unified account. * Query transaction logs in Unified account.
*/ */
@@ -1183,39 +1200,12 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/account/mmp-state', { baseCoin }); return this.getPrivate('/v5/account/mmp-state', { baseCoin });
} }
/**
* Query the DCP configuration of the account's contracts (USDT perpetual, USDC perpetual and USDC Futures) / spot / options.
*
* Only the configured main / sub account can query information from this API. Calling this API by an account always returns empty.
*
* INFO
* support linear contract (USDT, USDC Perp & USDC Futures) / Spot / Options only
* Unified account only
*/
getDCPInfo(): Promise<APIResponseV3WithTime<{ dcpInfos: DCPInfoV5[] }>> {
return this.getPrivate('/v5/account/query-dcp-info');
}
/** /**
* *
****** Asset APIs ****** Asset APIs
* *
*/ */
/**
* Query the coin exchange records.
*
* CAUTION: You may experience long delays with this endpoint.
*/
getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise<
APIResponseV3WithTime<{
orderBody: CoinExchangeRecordV5[];
nextPageCursor?: string;
}>
> {
return this.getPrivate('/v5/asset/exchange/order-record', params);
}
/** /**
* Query option delivery records, sorted by deliveryTime in descending order. * Query option delivery records, sorted by deliveryTime in descending order.
* *
@@ -1240,6 +1230,46 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/asset/settlement-record', params); return this.getPrivate('/v5/asset/settlement-record', params);
} }
/**
* Query the coin exchange records.
*
* CAUTION: You may experience long delays with this endpoint.
*/
getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise<
APIResponseV3WithTime<{
orderBody: CoinExchangeRecordV5[];
nextPageCursor?: string;
}>
> {
return this.getPrivate('/v5/asset/exchange/order-record', params);
}
/**
* Query coin information, including chain information, withdraw and deposit status.
*/
getCoinInfo(
coin?: string,
): Promise<APIResponseV3WithTime<{ rows: CoinInfoV5[] }>> {
return this.getPrivate(
'/v5/asset/coin/query-info',
coin ? { coin } : undefined,
);
}
/**
* Query the sub UIDs under a main UID
*
* CAUTION: Can query by the master UID's api key only
*/
getSubUID(): Promise<
APIResponseV3WithTime<{
subMemberIds: string[];
transferableSubMemberIds: string[];
}>
> {
return this.getPrivate('/v5/asset/transfer/query-sub-member-list');
}
/** /**
* Query asset information. * Query asset information.
* *
@@ -1280,6 +1310,15 @@ export class RestClientV5 extends BaseRestClient {
); );
} }
/**
* Query withdrawable amount.
*/
getWithdrawableAmount(params: {
coin: string;
}): Promise<APIResponseV3<{ rows: WithdrawableAmountV5[] }>> {
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
}
/** /**
* Query the transferable coin list between each account type. * Query the transferable coin list between each account type.
*/ */
@@ -1327,20 +1366,6 @@ export class RestClientV5 extends BaseRestClient {
); );
} }
/**
* Query the sub UIDs under a main UID
*
* CAUTION: Can query by the master UID's api key only
*/
getSubUID(): Promise<
APIResponseV3WithTime<{
subMemberIds: string[];
transferableSubMemberIds: string[];
}>
> {
return this.getPrivate('/v5/asset/transfer/query-sub-member-list');
}
/** /**
* Enable Universal Transfer for Sub UID * Enable Universal Transfer for Sub UID
* *
@@ -1396,7 +1421,7 @@ export class RestClientV5 extends BaseRestClient {
nextPageCursor: string; nextPageCursor: string;
}> }>
> { > {
return this.get('/v5/asset/deposit/query-allowed-list', params); return this.getPrivate('/v5/asset/deposit/query-allowed-list', params);
} }
/** /**
@@ -1497,6 +1522,7 @@ export class RestClientV5 extends BaseRestClient {
} }
/** /**
* @deprecated - duplicate function, use getSubDepositAddress() instead
* Query the deposit address information of SUB account. * Query the deposit address information of SUB account.
* @deprecated Duplicate endpoint - Use getSubDepositAddress() instead * @deprecated Duplicate endpoint - Use getSubDepositAddress() instead
* *
@@ -1520,18 +1546,6 @@ export class RestClientV5 extends BaseRestClient {
}); });
} }
/**
* Query coin information, including chain information, withdraw and deposit status.
*/
getCoinInfo(
coin?: string,
): Promise<APIResponseV3WithTime<{ rows: CoinInfoV5[] }>> {
return this.getPrivate(
'/v5/asset/coin/query-info',
coin ? { coin } : undefined,
);
}
/** /**
* Query withdrawal records. * Query withdrawal records.
*/ */
@@ -1541,15 +1555,6 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/asset/withdraw/query-record', params); return this.getPrivate('/v5/asset/withdraw/query-record', params);
} }
/**
* Query withdrawable amount.
*/
getWithdrawableAmount(params: {
coin: string;
}): Promise<APIResponseV3<{ rows: WithdrawalRecordV5[] }>> {
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
}
/** /**
* Get Exchange Entity List. * Get Exchange Entity List.
* *
@@ -1621,7 +1626,7 @@ export class RestClientV5 extends BaseRestClient {
* Query the exchange result by sending quoteTxId. * Query the exchange result by sending quoteTxId.
*/ */
getConvertStatus(params: { getConvertStatus(params: {
quoteTxId?: string; quoteTxId: string;
accountType: accountType:
| 'eb_convert_funding' | 'eb_convert_funding'
| 'eb_convert_uta' | 'eb_convert_uta'
@@ -1701,15 +1706,6 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/user/submembers', params); return this.getPrivate('/v5/user/submembers', params);
} }
/**
* Query all api keys information of a sub UID.
*/
getSubAccountAllApiKeys(
params: GetSubAccountAllApiKeysParamsV5,
): Promise<APIResponseV3WithTime<SubAccountAllApiKeysResultV5>> {
return this.getPrivate('/v5/user/sub-apikeys', params);
}
/** /**
* Froze sub uid. Use master user's api key only. * Froze sub uid. Use master user's api key only.
* *
@@ -1733,6 +1729,18 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/user/query-api'); return this.getPrivate('/v5/user/query-api');
} }
/**
* Query all api keys information of a sub UID.
*/
getSubAccountAllApiKeys(params: GetSubAccountAllApiKeysParamsV5): Promise<
APIResponseV3WithTime<{
result: ApiKeyInfoV5[];
nextPageCursor: string;
}>
> {
return this.getPrivate('/v5/user/sub-apikeys', params);
}
getUIDWalletType(params: { memberIds: string }): Promise< getUIDWalletType(params: { memberIds: string }): Promise<
APIResponseV3WithTime<{ APIResponseV3WithTime<{
accounts: { accounts: {
@@ -1741,7 +1749,7 @@ export class RestClientV5 extends BaseRestClient {
}[]; }[];
}> }>
> { > {
return this.getPrivate('/v5/user/query-api', params); return this.getPrivate('/v5/user/get-member-type', params);
} }
/** /**
@@ -1770,6 +1778,19 @@ export class RestClientV5 extends BaseRestClient {
return this.postPrivate('/v5/user/update-sub-api', params); return this.postPrivate('/v5/user/update-sub-api', params);
} }
/**
* Delete a sub UID. Before deleting the UID, please make sure there are no assets.
*
* TIP:
* The API key must have one of the permissions to be allowed to call the following API endpoint.
* - master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"
*/
deleteSubMember(
params: DeleteSubMemberParamsV5,
): Promise<APIResponseV3WithTime<{}>> {
return this.postPrivate('/v5/user/del-submember', params);
}
/** /**
* Delete the api key of master account. Use the api key pending to be delete to call the endpoint. Use master user's api key only. * Delete the api key of master account. Use the api key pending to be delete to call the endpoint. Use master user's api key only.
* *
@@ -1799,19 +1820,6 @@ export class RestClientV5 extends BaseRestClient {
return this.postPrivate('/v5/user/delete-sub-api', params); return this.postPrivate('/v5/user/delete-sub-api', params);
} }
/**
* Delete a sub UID. Before deleting the UID, please make sure there are no assets.
*
* TIP:
* The API key must have one of the permissions to be allowed to call the following API endpoint.
* - master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"
*/
deleteSubMember(
params: DeleteSubMemberParamsV5,
): Promise<APIResponseV3WithTime<{}>> {
return this.postPrivate('/v5/user/del-submember', params);
}
/** /**
* *
****** Affiliate APIs ****** Affiliate APIs

View File

@@ -20,6 +20,8 @@ export interface GetDeliveryRecordParamsV5 {
export interface GetSettlementRecordParamsV5 { export interface GetSettlementRecordParamsV5 {
category: CategoryV5; category: CategoryV5;
symbol?: string; symbol?: string;
startTime?: number;
endTime?: number;
limit?: number; limit?: number;
cursor?: string; cursor?: string;
} }
@@ -102,6 +104,7 @@ export interface GetSubAccountDepositRecordParamsV5 {
} }
export interface GetInternalDepositRecordParamsV5 { export interface GetInternalDepositRecordParamsV5 {
txID?: string;
startTime?: number; startTime?: number;
endTime?: number; endTime?: number;
coin?: string; coin?: string;
@@ -111,6 +114,7 @@ export interface GetInternalDepositRecordParamsV5 {
export interface GetWithdrawalRecordsParamsV5 { export interface GetWithdrawalRecordsParamsV5 {
withdrawID?: string; withdrawID?: string;
txID?: string;
coin?: string; coin?: string;
withdrawType?: number; withdrawType?: number;
startTime?: number; startTime?: number;
@@ -131,7 +135,7 @@ export interface WithdrawParamsV5 {
feeType?: 0 | 1; feeType?: 0 | 1;
requestId?: string; requestId?: string;
beneficiary?: { beneficiary?: {
vaspEntityId: string; vaspEntityId?: string;
beneficiaryName?: string; beneficiaryName?: string;
}; };
} }

View File

@@ -108,6 +108,7 @@ export interface GetInsuranceParamsV5 {
export interface GetRiskLimitParamsV5 { export interface GetRiskLimitParamsV5 {
category?: 'linear' | 'inverse'; category?: 'linear' | 'inverse';
symbol?: string; symbol?: string;
cursor?: string;
} }
export interface GetOptionDeliveryPriceParamsV5 { export interface GetOptionDeliveryPriceParamsV5 {

View File

@@ -8,6 +8,7 @@ import {
OrderTriggerByV5, OrderTriggerByV5,
OrderTypeV5, OrderTypeV5,
PositionIdx, PositionIdx,
StopOrderTypeV5,
} from '../shared-v5'; } from '../shared-v5';
export interface OrderParamsV5 { export interface OrderParamsV5 {
@@ -51,6 +52,7 @@ export interface AmendOrderParamsV5 {
triggerPrice?: string; triggerPrice?: string;
qty?: string; qty?: string;
price?: string; price?: string;
tpslMode?: 'Full' | 'Partial';
takeProfit?: string; takeProfit?: string;
stopLoss?: string; stopLoss?: string;
tpTriggerBy?: OrderTriggerByV5; tpTriggerBy?: OrderTriggerByV5;
@@ -86,6 +88,7 @@ export interface GetAccountHistoricOrdersParamsV5 {
category: CategoryV5; category: CategoryV5;
symbol?: string; symbol?: string;
baseCoin?: string; baseCoin?: string;
settleCoin?: string;
orderId?: string; orderId?: string;
orderLinkId?: string; orderLinkId?: string;
orderFilter?: OrderFilterV5; orderFilter?: OrderFilterV5;
@@ -102,11 +105,13 @@ export interface CancelAllOrdersParamsV5 {
baseCoin?: string; baseCoin?: string;
settleCoin?: string; settleCoin?: string;
orderFilter?: OrderFilterV5; orderFilter?: OrderFilterV5;
stopOrderType?: StopOrderTypeV5;
} }
export interface BatchOrderParamsV5 { export interface BatchOrderParamsV5 {
symbol: string; symbol: string;
side: OrderSideV5; side: OrderSideV5;
isLeverage?: 0 | 1;
orderType: OrderTypeV5; orderType: OrderTypeV5;
qty: string; qty: string;
price?: string; price?: string;

View File

@@ -14,7 +14,7 @@ export interface WalletBalanceV5Coin {
free: string; // spot only free: string; // spot only
locked: string; // spot only locked: string; // spot only
borrowAmount: string; borrowAmount: string;
availableToBorrow: string; availableToBorrow: string; // deprecated field
availableToWithdraw: string; availableToWithdraw: string;
accruedInterest: string; accruedInterest: string;
totalOrderIM: string; totalOrderIM: string;
@@ -23,6 +23,8 @@ export interface WalletBalanceV5Coin {
unrealisedPnl: string; unrealisedPnl: string;
cumRealisedPnl: string; cumRealisedPnl: string;
bonus: string; bonus: string;
marginCollateral: boolean;
collateralSwitch: boolean;
} }
export interface WalletBalanceV5 { export interface WalletBalanceV5 {
@@ -54,6 +56,9 @@ export interface BorrowHistoryRecordV5 {
hourlyBorrowRate: string; hourlyBorrowRate: string;
InterestBearingBorrowSize: string; InterestBearingBorrowSize: string;
costExemption: string; costExemption: string;
borrowAmount: string;
unrealisedLoss: string;
freeBorrowedAmount: string;
} }
export interface CollateralInfoV5 { export interface CollateralInfoV5 {
@@ -110,6 +115,7 @@ export interface TransactionLogV5 {
change: string; change: string;
cashBalance: string; cashBalance: string;
feeRate: string; feeRate: string;
bonusChange: string;
tradeId: string; tradeId: string;
orderId: string; orderId: string;
orderLinkId: string; orderLinkId: string;

View File

@@ -66,6 +66,8 @@ export interface AccountCoinBalanceV5 {
walletBalance: string; walletBalance: string;
transferBalance: string; transferBalance: string;
bonus: string; bonus: string;
transferSafeAmount: string;
ltvTransferSafeAmount: string;
}; };
} }
@@ -113,6 +115,9 @@ export interface DepositRecordV5 {
confirmations: string; confirmations: string;
txIndex: string; txIndex: string;
blockHash: string; blockHash: string;
batchReleaseLimit: string;
depositType: string;
fromAddress: string;
} }
export interface InternalDepositRecordV5 { export interface InternalDepositRecordV5 {
@@ -123,6 +128,7 @@ export interface InternalDepositRecordV5 {
status: 1 | 2 | 3; status: 1 | 2 | 3;
address: string; address: string;
createdTime: string; createdTime: string;
txID: string;
} }
export interface DepositAddressChainV5 { export interface DepositAddressChainV5 {
@@ -130,6 +136,8 @@ export interface DepositAddressChainV5 {
addressDeposit: string; addressDeposit: string;
tagDeposit: string; tagDeposit: string;
chain: string; chain: string;
batchReleaseLimit: string;
contractAddress: string;
} }
export interface DepositAddressResultV5 { export interface DepositAddressResultV5 {
@@ -151,6 +159,8 @@ export interface CoinInfoV5 {
minAccuracy: string; minAccuracy: string;
chainDeposit: string; chainDeposit: string;
chainWithdraw: string; chainWithdraw: string;
withdrawPercentageFee: string;
contractAddress: string;
}[]; }[];
} }
@@ -169,6 +179,22 @@ export interface WithdrawalRecordV5 {
updateTime: string; updateTime: string;
} }
export interface WithdrawableAmountV5 {
limitAmountUsd: string;
withdrawableAmount: {
SPOT: {
coin: string;
withdrawableAmount: string;
availableBalance: string;
};
FUND: {
coin: string;
withdrawableAmount: string;
availableBalance: string;
};
};
}
export interface VaspEntityV5 { export interface VaspEntityV5 {
vaspEntityId: string; vaspEntityId: string;
vaspName: string; vaspName: string;
@@ -220,7 +246,7 @@ export interface ConvertStatusV5 {
fromAmount: string; fromAmount: string;
toAmount: string; toAmount: string;
exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; exchangeStatus: 'init' | 'processing' | 'success' | 'failure';
extInfo: object; extInfo: { paramType: string; paramValue: string };
convertRate: string; convertRate: string;
createdAt: string; createdAt: string;
} }
@@ -236,7 +262,7 @@ export interface ConvertHistoryRecordV5 {
fromAmount: string; fromAmount: string;
toAmount: string; toAmount: string;
exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; exchangeStatus: 'init' | 'processing' | 'success' | 'failure';
extInfo: object; extInfo: { paramType: string; paramValue: string };
convertRate: string; convertRate: string;
createdAt: string; createdAt: string;
} }

View File

@@ -1,6 +1,5 @@
export interface CollateralCoinV5 { export interface CollateralCoinV5 {
collateralAccuracy: number; collateralAccuracy: number;
currency: string;
initialLTV: string; initialLTV: string;
liquidationLTV: string; liquidationLTV: string;
marginCallLTV: string; marginCallLTV: string;

View File

@@ -163,6 +163,8 @@ export interface OrderbookResponseV5 {
a: OrderbookLevelV5[]; a: OrderbookLevelV5[];
ts: number; ts: number;
u: number; u: number;
seq: number;
cts: number;
} }
export interface TickerLinearInverseV5 { export interface TickerLinearInverseV5 {
@@ -192,6 +194,7 @@ export interface TickerLinearInverseV5 {
preOpenPrice: string; preOpenPrice: string;
preQty: string; preQty: string;
curPreListingPhase: string; curPreListingPhase: string;
basis: string;
} }
export interface TickerOptionV5 { export interface TickerOptionV5 {
@@ -252,6 +255,10 @@ export interface PublicTradeV5 {
side: OrderSideV5; side: OrderSideV5;
time: string; time: string;
isBlockTrade: boolean; isBlockTrade: boolean;
mP?: string;
iP?: string;
mIv?: string;
iv?: string;
} }
/** /**
@@ -279,6 +286,7 @@ export interface HistoricalVolatilityV5 {
export interface InsuranceDataV5 { export interface InsuranceDataV5 {
coin: string; coin: string;
symbols: string;
balance: string; balance: string;
value: string; value: string;
} }
@@ -299,6 +307,7 @@ export interface RiskLimitV5 {
isLowestRisk: 0 | 1; isLowestRisk: 0 | 1;
maxLeverage: string; maxLeverage: string;
mmDeduction: string; mmDeduction: string;
nextPageCursor?: string;
} }
/** @deprecated use DeliveryPriceV5 instead */ /** @deprecated use DeliveryPriceV5 instead */

View File

@@ -29,6 +29,7 @@ export interface PositionV5 {
bustPrice?: string; bustPrice?: string;
positionIM?: string; positionIM?: string;
positionMM?: string; positionMM?: string;
positionBalance?: string;
tpslMode?: TPSLModeV5; tpslMode?: TPSLModeV5;
takeProfit?: string; takeProfit?: string;
stopLoss?: string; stopLoss?: string;
@@ -108,6 +109,7 @@ export interface ExecutionV5 {
underlyingPrice?: string; underlyingPrice?: string;
blockTradeId?: string; blockTradeId?: string;
closedSize?: string; closedSize?: string;
seq: number;
} }
export interface ClosedPnLV5 { export interface ClosedPnLV5 {

View File

@@ -107,5 +107,7 @@ export interface SpotBorrowCheckResultV5 {
side: OrderSideV5; side: OrderSideV5;
maxTradeQty: string; maxTradeQty: string;
maxTradeAmount: string; maxTradeAmount: string;
spotMaxTradeQty: string;
spotMaxTradeAmount: string;
borrowCoin: string; borrowCoin: string;
} }

View File

@@ -27,26 +27,44 @@ export interface SubMemberV5 {
} }
export type ApiKeyType = 1 | 2; export type ApiKeyType = 1 | 2;
export interface ApiKeyPermissionsV5 {
ContractTrade: string[];
Spot: string[];
Wallet: string[];
Options: string[];
Derivatives: string[];
CopyTrading: string[];
BlockTrade: string[];
Exchange: string[];
NFT: string[];
Affiliate: string[];
}
export interface ApiKeyInfoV5 { export interface ApiKeyInfoV5 {
id: string; id: string;
note: string; note: string;
apiKey: string; apiKey: string;
readOnly: 0 | 1; readOnly: 0 | 1;
secret: string; secret: string;
permissions: PermissionsV5; permissions: ApiKeyPermissionsV5;
ips?: string[]; ips: string[];
type: ApiKeyType; type: 1 | 2; // 1: personal, 2: connected to third-party app
deadlineDay?: number; deadlineDay: number;
expiredAt?: string; expiredAt: string;
createdAt: string; createdAt: string;
unified: 0 | 1; /** @deprecated */
uta: 0 | 1; unified: number;
uta: 0 | 1; // 0: regular account, 1: unified trade account
userID: number; userID: number;
inviterID: number; inviterID: number;
vipLevel?: string; vipLevel: string;
mktMakerLevel?: string; mktMakerLevel: string;
affiliateID?: number; affiliateID: number;
rsaPublicKey: string;
isMaster: boolean; isMaster: boolean;
parentUid: string;
kycLevel: 'LEVEL_DEFAULT' | 'LEVEL_1' | 'LEVEL_2';
kycRegion: string;
} }
export interface UpdateApiKeyResultV5 { export interface UpdateApiKeyResultV5 {

View File

@@ -142,7 +142,10 @@ export type StopOrderTypeV5 =
| 'Stop' | 'Stop'
| 'PartialTakeProfit' | 'PartialTakeProfit'
| 'PartialStopLoss' | 'PartialStopLoss'
| 'tpslOrder'; | 'tpslOrder'
| 'OcoOrder'
| 'MmRateClose'
| 'BidirectionalTpslOrder';
/** /**
* Position index. Used to identify positions in different position modes. * Position index. Used to identify positions in different position modes.