feat(): add preCheckOrder method with corresponding types and example usage, add txId and Id to deposit records

This commit is contained in:
JJ-Cro
2025-06-12 18:04:15 +02:00
parent fb41a3bb44
commit e302c9b94f
9 changed files with 60 additions and 3 deletions

View File

@@ -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