feat(): add preCheckOrder method with corresponding types and example usage, add txId and Id to deposit records
This commit is contained in:
@@ -176,6 +176,7 @@ import {
|
||||
P2PUserPaymentV5,
|
||||
PositionInfoParamsV5,
|
||||
PositionV5,
|
||||
PreCheckOrderResultV5,
|
||||
PreUpgradeOptionsDelivery,
|
||||
PreUpgradeTransaction,
|
||||
PreUpgradeUSDCSessionSettlement,
|
||||
@@ -926,6 +927,20 @@ export class RestClientV5 extends BaseRestClient {
|
||||
return this.postPrivate('/v5/order/disconnected-cancel-all', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-check order to calculate changes in IMR and MMR before placing an order
|
||||
*
|
||||
* This endpoint supports orders with category = inverse, linear, option.
|
||||
* Only Cross Margin mode and Portfolio Margin mode are supported, isolated margin mode is not supported.
|
||||
* category = inverse is not supported in Cross Margin mode.
|
||||
* Conditional order is not supported.
|
||||
*/
|
||||
preCheckOrder(
|
||||
params: OrderParamsV5,
|
||||
): Promise<APIResponseV3WithTime<PreCheckOrderResultV5>> {
|
||||
return this.postPrivate('/v5/order/pre-check', params);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
****** Position APIs
|
||||
|
||||
@@ -87,6 +87,8 @@ export interface GetAllowedDepositCoinInfoParamsV5 {
|
||||
}
|
||||
|
||||
export interface GetDepositRecordParamsV5 {
|
||||
id?: string;
|
||||
txID?: string;
|
||||
coin?: string;
|
||||
startTime?: number;
|
||||
endTime?: number;
|
||||
@@ -95,6 +97,8 @@ export interface GetDepositRecordParamsV5 {
|
||||
}
|
||||
|
||||
export interface GetSubAccountDepositRecordParamsV5 {
|
||||
id?: string;
|
||||
txID?: string;
|
||||
subMemberId: string;
|
||||
coin?: string;
|
||||
startTime?: number;
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface GetExchangeBrokerEarningsParamsV5 {
|
||||
}
|
||||
|
||||
export interface GetBrokerSubAccountDepositsV5 {
|
||||
id?: string;
|
||||
txID?: string;
|
||||
subMemberId?: string;
|
||||
coin?: string;
|
||||
startTime?: number;
|
||||
|
||||
@@ -103,6 +103,7 @@ export interface AllowedDepositCoinInfoV5 {
|
||||
}
|
||||
|
||||
export interface DepositRecordV5 {
|
||||
id: string;
|
||||
coin: string;
|
||||
chain: string;
|
||||
amount: string;
|
||||
@@ -161,6 +162,7 @@ export interface CoinInfoV5 {
|
||||
chainWithdraw: string;
|
||||
withdrawPercentageFee: string;
|
||||
contractAddress: string;
|
||||
safeConfirmNumber: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface ExchangeBrokerAccountInfoV5 {
|
||||
}
|
||||
|
||||
export interface ExchangeBrokerSubAccountDepositRecordV5 {
|
||||
id: string;
|
||||
subMemberId: string;
|
||||
coin: string;
|
||||
chain: string;
|
||||
|
||||
@@ -109,3 +109,12 @@ export interface SpotBorrowCheckResultV5 {
|
||||
spotMaxTradeAmount: string;
|
||||
borrowCoin: string;
|
||||
}
|
||||
|
||||
export interface PreCheckOrderResultV5 {
|
||||
orderId: string;
|
||||
orderLinkId: string;
|
||||
preImrE4: number; // Initial margin rate before checking (in basis points)
|
||||
preMmrE4: number; // Maintenance margin rate before checking (in basis points)
|
||||
postImrE4: number; // Initial margin rate after checking (in basis points)
|
||||
postMmrE4: number; // Maintenance margin rate after checking (in basis points)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user