misc fixes for v5 rest client. Add e2e private fetch tests for v5 rest client.

This commit is contained in:
tiagosiebler
2023-02-20 12:25:54 +00:00
parent 69502f9e57
commit fc1e3945c0
4 changed files with 279 additions and 7 deletions

View File

@@ -63,6 +63,7 @@ export const API_ERROR_CODE = {
CONTRACT_MARGIN_MODE_NOT_MODIFIED: 140026,
CONTRACT_RISK_LIMIT_INFO_NOT_EXISTS: 140031,
CONTRACT_SET_LEVERAGE_NOT_MODIFIED: 140043,
SPOT_LEVERAGE_TOKEN_ORDER_NOT_FOUND: 175007,
/** E.g. USDC Options trading, trying to access a symbol that is no longer active */
CONTRACT_NAME_NOT_EXIST: 3100111,
ORDER_NOT_EXIST: 3100136,

View File

@@ -601,7 +601,7 @@ export class RestClientV5 extends BaseRestClient {
* Unified account covers: Spot / Linear contract / Options
* Normal account covers: USDT perpetual / Inverse perpetual / Inverse futures
*/
getExecutionListV5(
getExecutionList(
params: GetExecutionListParamsV5
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>> {
return this.getPrivate('/v5/execution/list', params);
@@ -764,7 +764,7 @@ export class RestClientV5 extends BaseRestClient {
nextPageCursor?: string;
}>
> {
return this.get('/v5/asset/exchange/order-record', params);
return this.getPrivate('/v5/asset/exchange/order-record', params);
}
/**
@@ -870,7 +870,7 @@ export class RestClientV5 extends BaseRestClient {
* Query the internal transfer records between different account types under the same UID.
*/
getInternalTransferRecords(
params: GetInternalTransferParamsV5
params?: GetInternalTransferParamsV5
): Promise<APIResponseV3WithTime<CursorListV5<InternalTransferRecordV5[]>>> {
return this.getPrivate(
'/v5/asset/transfer/query-inter-transfer-list',
@@ -1014,7 +1014,10 @@ export class RestClientV5 extends BaseRestClient {
getCoinInfo(
coin?: string
): Promise<APIResponseV3WithTime<{ rows: CoinInfoV5[] }>> {
return this.get('/v5/asset/coin/query-info', coin ? { coin } : undefined);
return this.getPrivate(
'/v5/asset/coin/query-info',
coin ? { coin } : undefined
);
}
/**