forked from singlesly/bingx-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbingx-user-history-orders-endpoint.ts
More file actions
43 lines (40 loc) · 1.12 KB
/
Copy pathbingx-user-history-orders-endpoint.ts
File metadata and controls
43 lines (40 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {
AccountInterface,
BingxResponse,
DefaultSignatureParameters,
Endpoint,
EndpointInterface,
SignatureParametersInterface,
} from 'bingx-api/bingx';
import { BingxUserHistoryOrdersResponse } from 'bingx-api/bingx/endpoints/bingx-user-history-orders-response';
export class BingxUserHistoryOrdersEndpoint<
R extends BingxUserHistoryOrdersResponse,
>
extends Endpoint<BingxResponse<R>>
implements EndpointInterface<BingxResponse<R>>
{
constructor(
private readonly symbol: string,
private readonly limit: number,
private readonly startTime: Date,
private readonly endTime: Date,
account: AccountInterface,
) {
super(account);
}
method(): 'get' | 'post' | 'put' | 'patch' | 'delete' {
return 'get';
}
parameters(): SignatureParametersInterface {
return new DefaultSignatureParameters({
symbol: this.symbol,
limit: this.limit.toString(10),
startTime: this.startTime.getTime().toString(10),
endTime: this.endTime.getTime().toString(10),
});
}
path(): string {
return '/openApi/swap/v2/trade/allOrders';
}
readonly t!: BingxResponse<R>;
}