mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
29 lines
724 B
TypeScript
29 lines
724 B
TypeScript
import { GrvtClient, GrvtWsClient, EGrvtEnvironment } from "@grvt/sdk";
|
|
|
|
export interface GrvtCredentials {
|
|
apiKey: string;
|
|
apiSecret: string;
|
|
env: EGrvtEnvironment;
|
|
subAccountId: string;
|
|
instrument: string;
|
|
}
|
|
|
|
export class GrvtGateway {
|
|
private readonly grvtClient: GrvtClient;
|
|
private readonly wsClient: GrvtWsClient;
|
|
|
|
constructor(private readonly credentials: GrvtCredentials) {
|
|
this.grvtClient = new GrvtClient({
|
|
apiKey: credentials.apiKey,
|
|
apiSecret: credentials.apiSecret,
|
|
env: credentials.env,
|
|
});
|
|
this.wsClient = new GrvtWsClient({ apiKey: credentials.apiKey, env: credentials.env });
|
|
}
|
|
|
|
async initialize(): Promise<void> {
|
|
await this.wsClient.connect();
|
|
}
|
|
}
|
|
|