-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
57 lines (46 loc) · 1.4 KB
/
index.d.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { WebSocket } from 'ws'
export default class LOLSDK {
constructor (args: {
clientID?: string,
clientSecret?: string,
hostname?: string,
wsHostname?: string,
feeds?: string[]
})
fetchFeed (args: { timestamp: string|number, feed: string }): Promise<Report>
fetchFeeds (args: { timestamp: string|number, feeds: string[] }): Promise<Record<string, Report>>
subscribeTo (feeds: string|string[]): Promise<WebSocket|null>
unsubscribeFrom (feeds: string|string[]): Promise<WebSocket|null>
disconnect (): void
feeds: Set<string>
on (event: string, cb: Function): this
off (event: string, cb: Function): this
once (event: string, cb: Function): this
}
export type Report = {
feedId: string
observationsTimestamp: bigint
benchmarkPrice: bigint
} & (
{
version: 'v1'
bid: bigint
ask: bigint
currentBlockNum: bigint
currentBlockHash: string
validFromBlockNum: bigint
currentBlockTimeStamp: bigint
} | {
version: 'v2'
nativeFee: bigint
linkFee: bigint
expiresAt: number
} | {
version: 'v3'
nativeFee: bigint
linkFee: bigint
expiresAt: number
bid: bigint
ask: bigint
}
)