-
Notifications
You must be signed in to change notification settings - Fork 3
/
usage-example-client.ts
38 lines (18 loc) · 1004 Bytes
/
usage-example-client.ts
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
import { IExchangeConnector } from "../interfaces/exchange-connector-interface.ts"
import { BybitConnector } from "./bybit-connector.ts"
export class ExampleClient {
private exchangeConnector: IExchangeConnector
public constructor(private apiKey: string, private apiSecret: string) {
this.exchangeConnector = new BybitConnector(apiKey, apiSecret)
}
public async showUsageExamples(): Promise<void> {
const accountInfo = await this.exchangeConnector.getFuturesAccountData()
console.log(accountInfo)
const positions = await this.exchangeConnector.getPositions()
console.log(positions)
}
}
const apiKey = Deno.args[0] // can't provide you example data here as I can't judge your trading / gambling skills :)
const apiSecret = Deno.args[1] // can't provide you example data here as I can't judge your trading / gambling skills :)
const exampleClient = new ExampleClient(apiKey, apiSecret)
await exampleClient.showUsageExamples()