private unified read tests

This commit is contained in:
tiagosiebler
2022-09-10 19:35:17 +01:00
parent 8e60d5dfdf
commit 8d85bcb182
5 changed files with 71 additions and 53 deletions

View File

@@ -17,6 +17,8 @@ export const API_ERROR_CODE = {
/** This could mean bad request, incorrect value types or even incorrect/missing values */
PARAMS_MISSING_OR_WRONG: 10001,
INCORRECT_API_KEY_PERMISSIONS: 10005,
/** Account not unified margin, update required */
ACCOUNT_NOT_UNIFIED: 10020,
BALANCE_INSUFFICIENT_SPOT_V3: 12131,
ORDER_NOT_FOUND_SPOT_V3: 12213,
ORDER_NOT_FOUND_LEVERAGED_TOKEN: 12407,

View File

@@ -205,7 +205,7 @@ export interface UM7DayTradingHistoryRequest {
export interface UMOptionsSettlementHistoryRequest {
category: UMCategory;
symbol: string;
symbol?: string;
expDate?: string;
direction?: UMDirection;
limit?: number;
@@ -214,7 +214,7 @@ export interface UMOptionsSettlementHistoryRequest {
export interface UMPerpSettlementHistoryRequest {
category: UMCategory;
symbol: string;
symbol?: string;
direction?: UMDirection;
limit?: number;
cursor?: string;

View File

@@ -234,7 +234,7 @@ export class UnifiedMarginClient extends BaseRestClient {
* Users can access their position holding information through this interface, such as the number of position holdings and wallet balance.
*/
getPositions(params: UMPositionsRequest): Promise<APIResponseV3<any>> {
return this.postPrivate('/unified/v3/private/position/list', params);
return this.getPrivate('/unified/v3/private/position/list', params);
}
/** Leverage setting. */
@@ -351,7 +351,9 @@ export class UnifiedMarginClient extends BaseRestClient {
}
/** Exchange Coins */
exchangeCoins(params?: UMExchangeCoinsRequest): Promise<APIResponseV3<any>> {
getCoinExchangeHistory(
params?: UMExchangeCoinsRequest
): Promise<APIResponseV3<any>> {
return this.getPrivate(
'/asset/v2/private/exchange/exchange-order-all',
params