feat(#261): add tpsl params missing from position endpoints. add new endpoint for add/reduce margin. add doc examples

This commit is contained in:
tiagosiebler
2023-06-07 16:56:36 +01:00
parent 4f563a65a5
commit 05d63839da
15 changed files with 289 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ import {
AccountMarginModeV5,
AccountOrderV5,
AccountTypeV5,
AddOrReduceMarginParamsV5,
AddOrReduceMarginResultV5,
AllCoinsBalanceV5,
AllowedDepositCoinInfoV5,
AmendOrderParamsV5,
@@ -618,6 +620,18 @@ export class RestClientV5 extends BaseRestClient {
return this.postPrivate('/v5/position/set-auto-add-margin', params);
}
/**
* Manually add or reduce margin for isolated margin position
*
* Unified account covers: USDT perpetual / USDC perpetual / USDC futures / Inverse contract
* Normal account covers: USDT perpetual / Inverse contract
*/
addOrReduceMargin(
params: AddOrReduceMarginParamsV5,
): Promise<APIResponseV3WithTime<AddOrReduceMarginResultV5>> {
return this.postPrivate('/v5/position/add-margin', params);
}
/**
* Query users' execution records, sorted by execTime in descending order
*