fix additional encoding issue for cursor with equals symbol. Add contract client return type. Add additional cursor e2e test.
This commit is contained in:
@@ -19,6 +19,7 @@ export const API_ERROR_CODE = {
|
||||
INVALID_API_KEY_OR_PERMISSIONS: 10003,
|
||||
SIGNATURE_NOT_VALID: 10004,
|
||||
INCORRECT_API_KEY_PERMISSIONS: 10005,
|
||||
DB_ERROR_WRONG_CURSOR: 10016,
|
||||
INCORRECT_PRIVATE_OPERATIONS: 3303001,
|
||||
/** Account not unified margin, update required */
|
||||
ACCOUNT_NOT_UNIFIED: 10020,
|
||||
|
||||
@@ -21,6 +21,8 @@ import {
|
||||
ContractUserExecutionHistoryRequest,
|
||||
ContractClosedPNLRequest,
|
||||
ContractWalletFundRecordRequest,
|
||||
PaginatedResult,
|
||||
ContractHistoricOrder,
|
||||
} from './types';
|
||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||
import BaseRestClient from './util/BaseRestClient';
|
||||
@@ -148,7 +150,7 @@ export class ContractClient extends BaseRestClient {
|
||||
/** Query order history. As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. To access order information in real-time, call getActiveOrders() */
|
||||
getHistoricOrders(
|
||||
params: ContractHistoricOrdersRequest
|
||||
): Promise<APIResponseV3<any>> {
|
||||
): Promise<APIResponseV3<PaginatedResult<ContractHistoricOrder>>> {
|
||||
return this.getPrivate('/contract/v3/private/order/list', params);
|
||||
}
|
||||
|
||||
|
||||
35
src/types/response/contract.ts
Normal file
35
src/types/response/contract.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export interface PaginatedResult<TList = any> {
|
||||
nextPageCursor: string;
|
||||
list: TList[];
|
||||
}
|
||||
|
||||
export interface ContractHistoricOrder {
|
||||
symbol: string;
|
||||
side: string;
|
||||
orderType: string;
|
||||
price: string;
|
||||
qty: string;
|
||||
reduceOnly: boolean;
|
||||
timeInForce: string;
|
||||
orderStatus: string;
|
||||
leavesQty: string;
|
||||
leavesValue: string;
|
||||
cumExecQty: string;
|
||||
cumExecValue: string;
|
||||
cumExecFee: string;
|
||||
lastPriceOnCreated: string;
|
||||
rejectReason: string;
|
||||
orderLinkId: string;
|
||||
createdTime: string;
|
||||
updatedTime: string;
|
||||
orderId: string;
|
||||
stopOrderType: string;
|
||||
takeProfit: string;
|
||||
stopLoss: string;
|
||||
tpTriggerBy: string;
|
||||
slTriggerBy: string;
|
||||
triggerPrice: string;
|
||||
closeOnTrigger: boolean;
|
||||
triggerDirection: number;
|
||||
positionIdx: number;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './contract';
|
||||
export * from './shared';
|
||||
export * from './spot';
|
||||
export * from './usdt-perp';
|
||||
|
||||
@@ -58,7 +58,7 @@ export function serializeParams(
|
||||
return properties
|
||||
.map((key) => {
|
||||
const value = encodeSerialisedValues
|
||||
? encodeURI(params[key])
|
||||
? encodeURIComponent(params[key])
|
||||
: params[key];
|
||||
|
||||
if (strict_validation === true && typeof value === 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user