forked from singlesly/bingx-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoint.ts
More file actions
25 lines (18 loc) · 910 Bytes
/
Copy pathendpoint.ts
File metadata and controls
25 lines (18 loc) · 910 Bytes
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
import { EndpointInterface } from 'bingx-api/bingx/endpoints/endpoint.interface';
import { ApiKeyHeader } from 'bingx-api/bingx/headers/api-key-header';
import { SignatureParametersInterface } from 'bingx-api/bingx/account/signature-parameters.interface';
import { SignatureInterface } from 'bingx-api/bingx/account/signature.interface';
import { AccountInterface } from 'bingx-api/bingx/account/account.interface';
export abstract class Endpoint<R = unknown> implements EndpointInterface<R> {
public constructor(protected readonly account: AccountInterface) {}
apiKey(): ApiKeyHeader {
return new ApiKeyHeader(this.account);
}
signature(): SignatureInterface {
return this.account.sign(this.parameters());
}
abstract method(): 'get' | 'post' | 'put' | 'patch' | 'delete';
abstract parameters(): SignatureParametersInterface;
abstract path(): string;
abstract readonly t: R;
}